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
612dbca12a
Improved particle trail management: instead of instantiating many tiny particle effects for each segment of the trail, instantiate a single particle trail effect and attach it to the entity. The particle system is made looping and simulates in world space, to have it create a proper trail. Particle trails are destroyed with a delay when detached from their entity, so that the particles have the time to finish their simulation.
5 years ago
Nico de Poel
764f2a8a0f
Optimized lightmap uploads by converting the raw byte pointer from Quake to a NativeArray (unsafe code required) and passing that directly to SetPixelData. This does away with the extra copying step and removes garbage created by Texture2D's implementation.
The old code path is still kept around since the NativeArray version doesn't work inside the Editor for some reason, but it does in standalone builds.
5 years ago
Nico de Poel
8fc85d5ecb
Reworked brush game object creation so that entity brush models are configured differently from world brush models. Rearranged the VisualStyle class to fit this strategy.
5 years ago
Nico de Poel
fc051df6da
Added support for point sampling and affine texturing to the custom Quake shader, both of which can be enabled/disabled through the visual style. Also changes all of the keywords into multi_compile, so they aren't stripped during builds (all of these are controlled through code).
5 years ago
Nico de Poel
2460110525
First experimental shader using lightmaps, based on URP's Unlit shader. Needed to change the project's Color Space to Gamma for the lightmapped output to look correct.
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.
It has been tested and found (mostly) working by manipulating the UVs on surface meshes, applying the lightmap as main texture, and using an unlit shader. This is not part of the commit.
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
722c79ab8b
Simplified call to create world material, which is just one method now that takes surface flags. The implementation will figure out which template material to use.
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
b3175ebb3b
Reworked visual style setup, reducing entity materials to just one material for both alias models and brush models, and turning material creation into a separate step. This makes it more obvious when new materials are created, and allows for more potential customization in sub-classes.
5 years ago
Nico de Poel
c5cefca10d
Minor fixes for compatibility issues with QRally:
- Handle null frame names when matching with animation regex
- Default to skin 0 when the provided skin number is out of range
- Convert polygon vertices directly to Unity coordinate positions
5 years ago
Nico de Poel
a8defed5de
Allow game and viewmodel layers to be specified at the level of each UniQuake instance. This will allow multiple instances of the game to run side-by-side with each their own rendering layers.
5 years ago
Nico de Poel
4adc71eca8
Added layer masks to separate game and view model, and added a secondary overlay camera to render the view model separately after the main pass. Fixes gun view model clipping into walls.
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
3c2ca26a99
Properly destroy brush model child game objects when clearing an entity's model. Fixes explosive barrels not disappearing when blown 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
67980400ef
Apply full bright textures to brush models. This is really starting to look a lot like Quake now!
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
a52b497ccb
Reworked entity renderer assignment: both MeshRenderer and SkinnedMeshRenderer are created at the same time on init, and are enabled/disabled on demand.
Also: destroy overridden textures, and disable lerping on alias model animator by default.
5 years ago
Nico de Poel
a2b8d32c00
Implemented automatic animating of group frame alias models, using the existing AliasModelAnimator component.
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
0dc5c1a14b
Create world submodel game objects and link them to entities, allowing doors and buttons and such to work properly. Also don't bother linking the view entity to a model.
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
2c6f5bed1c
Destroy game assets when the game is shut down. We can still inspect assets in-editor by using the Pause function.
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