66 Commits (cd4ee6cba762eb3062eda7ffff5834aa8c2b6295)

Author SHA1 Message Date
Nico de Poel cd4ee6cba7 Reworked native-to-managed interface to particle effects, to group together similar types of effects and distinguish them using an enum. This reduces the need for a ton of similar-looking overloads and all of the callback delegate boilerplate that comes along with it. 5 years ago
Nico de Poel 946b8572d4 Recreated the teleport splash particle effect 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 b25f2a54a9 Added a first version of the particle explosion effect, reconstructed using Unity's particle system as close to Quake's original particles as I can right now. 5 years ago
Nico de Poel 2a23096293 Entity null checks are rather useless here since GetEntity never returns null 5 years ago
Nico de Poel 46cafd0c63 Renamed "target" pointers to "context" to fit in line with the rest of the callbacks refactoring 5 years ago
Nico de Poel 2a4ec90ff1 Reworked setup of native-to-managed callbacks. The "target" pointer is no longer a part of the callbacks struct, instead this is now supplied and stored as an opaque "context" pointer along with a pointer to the callbacks struct. These are provided through separate SetCallbacks functions before initializing the UniQuake native plugin. This cleans up several functions and requires less use of global pointers, while also making it easier to see how things fit together and how to add new modules in the future. 5 years ago
Nico de Poel ec87ac10b0 Added profiler sampling to the Game and Render callbacks, to make it easier to measure performance of native-to-managed callbacks 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 c9a3d0430c First implementation of dynamically updated lightmap textures. These are uploaded from the Quake engine to Unity on map load, and whenever a lightmap texture changes. 5 years ago
Nico de Poel f668c97b52 Reworked the entity animation system, so that blending between poses is pulled fully to the Unity side. With this we can detect the situation where we are trying to blend from one animation sequence to another. Since this is not possible in UniQuake due to each animation sequence being converted to a separate mesh, we instead hold the poses for a frame as if we're not using animation lerping at all. This fixes the occasional animation glitch where the previous sequence would be animated a bit too far, which can be very noticeable on non-looping animation sequences (e.g. the Chthon's rise animation). 5 years ago
Nico de Poel cd7423ae34 Use ref when passing structs by pointer through P/Invoke. This fixes positions and angles not being updated correctly in 32-bit builds. This was not a problem in 64-bit mode (probably because an entire vec3_t fits into a single register and the call is optimized as such) but it is in 32-bit mode. 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 fab7f6503f Allow entity skin number to be passed and apply the corresponding textures to the entity material 5 years ago
Nico de Poel c12ff0c503 Organize alias model textures into skins and animation frames 5 years ago
Nico de Poel fdaee3321f Start on organization of textures into texture sets, and implemented a basic test for alias model entities, which are now properly textured including fullbright (emissive) textures. 5 years ago
Nico de Poel 2e35a148b8 Use visual style reference to set up world and entity renderers and textures. With this we can clear out a LOT of debug code that was kept around for reference. 5 years ago
Nico de Poel 5390483b0b Upload non-world brush models and allow them to be assigned to entities. It's not terribly pretty but it (mostly) works. There still seems to be an issue with texture assignment on subsequent map loads. 5 years ago
Nico de Poel c14faf2666 Dynamically create either MeshRenderer/MeshFilter or SkinnedMeshRenderer based on whether the model being assigned is animated or not. Gets rid of warnings on un-animated SkinnedMeshRenderers, and removes unnecessary components on brush model entities. 5 years ago
Nico de Poel 9345b0d15c Allow GameModule to directly access entities. Removes some pointless indirection and boilerplate code in GameState. 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 1a1c219bf6 Removed frame number stuff from SetEntityModel since it's not producing the correct values. Correctly detect non-world brush models and sprites, although they're not implemented yet. 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 453664031c Moved creation of game objects for the world to GameState, which is where the bridge between Quake's game logic and Unity's game objects will happen. Also includes destruction of said game objects, so that the world is properly destroyed and recreated on map change. 5 years ago
Nico de Poel a886f3d993 First steps in reorganizing the project, so that assets and game state are managed separately from the interop modules. This will allow for a clearer picture of where gameplay-related interactions should take place, and how entities and such should be linked to their associated assets. 5 years ago
Nico de Poel 45bfa16950 Use emissive property on default material to simulate fullbright pixels, instead of adding a second unlit material 5 years ago
Nico de Poel f944b7d4ff Moved some files around 5 years ago
Nico de Poel 3de63008b7 Further cleaned up BrushModel code and moved creation of debug game objects into RenderModule, where the models can be linked to their textures now as well. The result: properly textured maps are being rendered! 5 years ago
Nico de Poel 331aa4bccc Some cleanup and organization: 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 32897138b5 Build a single giant mesh for every texture-lightmap group of surfaces. Greatly improves rendering performance. 5 years ago
Nico de Poel 5598ceeeed Group surfaces based on texture and lightmap, while keeping them grouped inside each brush submodel 5 years ago
Nico de Poel e753e1cc34 Recreate the BSP tree structure through a GameObject hierarchy. This gives a bit more insight into the structure of the map data. 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 9ce90431f4 Reapplied model origin offset, which now actually makes sense 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 02a8e6b844 Fixed non-smoothed animations not actually landing on the key frames 5 years ago
Nico de Poel eaaac619b3 Change the Z-position of models in the test scene every time a RenderModule is instantiated, so that subsequent runs of Quake don't cause all of the uploaded models to overlap 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 e8e04b666d Allow run-time switching between lerped animations and keyframe-only animation, and made the playback speed configurable 5 years ago
Nico de Poel 3da2d4ba59 Made a few tweaks to make texture uploading work properly in headless mode 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 10e54f10ca Added a separate code path for converting frame group animations, and renamed some variables to use the correct frame/pose terminology 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