Nico de Poel
1e948a2dd3
Marshal animation frame names as bytes and manually decode them using QuakeTextMarshaler. Fixes invalid byte sequence exception upon loading QRally.
4 years ago
Nico de Poel
bd39eb57cc
Added entity lighting support, by forwarding the shade vector and light color from the engine to Unity. The lighting calculations are replicated in the Quake shader.
This is currently per-pixel shading (as opposed to the more authentic gouraud shading) and it's only applied to alias models at the moment. Brush models will have to be figured out properly.
5 years ago
Nico de Poel
4c648a1f5a
First version of particle trail, supporting rocket trail, smoke trail and blood trail.
5 years ago
Nico de Poel
5e607f4239
Added implementation of generic "run particle effect", which is used for things like blood effects and bullet wall impacts. Also tweaked the setup of particle rendering to be more in line with QuakeSpasm, though I'll need to do a good A/B comparison sometime.
5 years ago
Nico de Poel
cce1ed6d47
Reuse the same lightmap byte buffer, since the lightmap dimensions are static anyway. Reduces the amount of garbage produced by dynamic lightmap uploading.
5 years ago
Nico de Poel
d73d86ce11
Keep hold of surface flag when converting brush model surfaces, and use this to identify liquid surfaces during material creation. Liquids now have their own material with the option to apply alpha blending depending on the type of liquid.
Also includes some first bits of particle systems. Not actually used yet.
5 years ago
Nico de Poel
59a64473b0
Marshal only one polygon per brush model surface for conversion into a Unity mesh. Any subsequent polygons are pre-tessellated versions meant for the water warping effect, which we won't need as this will be handled by GPU tessellation. Fixed garbled water surface caused by having two polygon meshes overlapping.
5 years ago
Nico de Poel
a479d7246b
Reworked coordinate and rotation conversion from Quake to Unity. It still feels weird, but entity models are now seemingly oriented correctly, and some strange edge cases with entities rotating in the wrong direction have been cleared up.
5 years ago
Nico de Poel
c9271a7772
Cache brush surface texture numbers instead of re-marshaling them on each access. Fixes textures getting mixed up on brush model entities after map switch.
5 years ago
Nico de Poel
66c62001d0
Squashed a bunch of bugs in the alias model animation system and integrated transform/animation updates into the alias model lerping system. Entities are now correctly animated, yay!
5 years ago
Nico de Poel
e6fd7b83ae
First bits of entity logic: assign alias models, update transform and animation, remove entity. Still lots of problems to solve, but it's starting to do something.
5 years ago
Nico de Poel
331aa4bccc
Some cleanup and organization:
- Removed a bunch of dead testing code
- Provide a camera to the UniQuake script which the render module can then manipulate
- Removed unused fields from QModel, which also fixes yet another text decoding issue in Zerstörer (the ö appears in the map's entity data)
- Shut down Quake engine OnApplicationQuit, which allows clean shutdown using the Play button in the Unity editor
- Use QTexture pointer as key for grouping surfaces, which removes the need for a bunch of redundant data marshaling
- Added disposal function for brush models
5 years ago
Nico de Poel
15e3faa753
Added callback function to allow Quake to send the view parameters to Unity, and apply them to the main camera. This makes actual movement through the map in Unity possible.
5 years ago
Nico de Poel
a615495c25
Recursively traverse the BSP tree and create surface meshes per node
5 years ago
Nico de Poel
11c3b2d826
Defined structs for BSP SubModels and Nodes, which will allow for a more systematic conversion to Unity meshes. Also moved more marshalling code into the data classes, which seems like a more natural place.
5 years ago
Nico de Poel
211c64a879
"Fixed" coordinate conversion from Quake to Unity, by swizzling Y and Z coordinates during vector conversion. There seems to be a lot of confusion and disagreement about Quake's coordinate system, but this setup is simple and looks correct both in-game and in-editor, and the world isn't mirrored anymore either.
5 years ago
Nico de Poel
403e7d0eb4
Added struct definitions and marshaling code to obtain texture numbers for brush model surfaces
5 years ago
Nico de Poel
05731a8e09
Removed redundant division in QTriVertex conversion, and scaled up the rest of the test scene to match. Fixes scale of imported alias models when compared to the world brush model.
5 years ago
Nico de Poel
89f3600608
Reconstruct brush model data based on glpoly_t data generated by GLQuake. We can now successfully display BSP maps in Unity!
5 years ago
Nico de Poel
3988db5f8e
Defined a bunch more data for brush models and initial marshaling of model data
5 years ago
Nico de Poel
4a7155bb1b
Fixed marshaling of multi-dimensional arrays of QGLTextures, and add a second unlit material layer with additive blending for models that use fullbright textures
5 years ago
Nico de Poel
e70d363998
Implemented uploading of skin texture data to Unity, and linking loaded alias models to their primary skin texture
5 years ago
Nico de Poel
428eebb941
Pass along alias frame type and correctly count the total number of poses in a model, so that the correct number of pose vertices are marshaled and we can identify models that use group frame animations instead of typical single frames. Quake's model formats are weird.
5 years ago
Nico de Poel
96d2a1fe7b
First setup to upload brush models (specifically: the world model) from Quake to Unity. Updated the QWorld class to include the fields added by QuakeSpasm.
5 years ago
Nico de Poel
ab880f9cfb
Added a custom marshaler to decode screen texts received from Quake, which uses single-byte characters and a non-standard character set. Fixes string conversion errors and a fatal exception whenever the "ö" character is printed in the Zerstörer mod.
5 years ago
Nico de Poel
61a845338e
Further mesh conversion research: animation frames are now converted into blend shape animations, which can be played back either with or without smoothing.
5 years ago
Nico de Poel
834ff9a794
First test converting models from Quake into Unity meshes, including normals and UVs. It's still far from perfect (back side UVs are not handled at all yet) but it's a good demonstration of what will be possible.
5 years ago
Nico de Poel
0f02005c58
Reimplemented uploading of alias model data, which now includes all vertex, triangle index and UV data
5 years ago
Nico de Poel
3b4382954a
Some renaming and reorganization
5 years ago