Nico de Poel
eefef2097e
Implemented split tracer trails for e.g. Scrag projectiles using Unity's radial velocity. Probably the least accurate particle effect recreation so far, but this one is very tricky to accurately emulate as it is in Quake.
Also fixed the min/max random color thing for other trails. If we want to pick a random static color between two extremes, then we need to use min/max and not a gradient.
5 years ago
Nico de Poel
5b99d8374f
Also implemented slight blood and vore ball particles trails
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
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
3e83559b6f
Renamed style files and directories, now that the structure has crystallized somewhat
5 years ago
Nico de Poel
852878765b
Allow visual style to modify the particle templates during init, so GLQuake and Software styles can share the same particle systems, but apply different particle sizes and materials. Also slightly tweaked the minimum particle size on all effects.
5 years ago
Nico de Poel
c41003a6ed
First pass of the Spawn blob explosions. The second part that has a cylindrical shape is hard to get right.
5 years ago
Nico de Poel
d44e75c620
Implemented the color mapped explosion effect introduced by the Rogue expansion pack
5 years ago
Nico de Poel
c5122fa2ea
Further tweaked particle explosion and used a curve speed modifier to more closely match the look of the original Quake effect
5 years ago
Nico de Poel
232564a411
Tweaked lava splash to look more closely like the Quake original effect
5 years ago
Nico de Poel
3077ccf1e1
Emulated the particle scale hack performed by QuakeSpasm by slightly increasing the start size of each particle (1.08 x 1.27 = 1.38) and by setting a minimum particle screen size.
5 years ago
Nico de Poel
827a504356
Redrawn particle sprite with higher hardness value (97) for a sharper edge, which makes them resemble the mathematically generated ones from QuakeSpasm more closely, as well as making them appear larger. Scaled back down the particle size settings to compensate.
5 years ago
Nico de Poel
ecdc9d1f0e
Disabled mipmapping on particle sprite so that it gets a very sharp and defined look, similar to QuakeSpasm.
5 years ago
Nico de Poel
3bbd3f8a4e
Scaled up particles even further, which now seems to match the size of QuakeSpasm pretty well
5 years ago
Nico de Poel
e321160e45
Implemented lava splash particle effect. Also made particles a bit larger across the board. This probably aren't the correct size values yet, but they do make the particles stand out better.
5 years ago
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
d5d54188c9
Moved particle render queue to one before Transparent, so that they get rendered before the transparent water. Fixes particles drawing on top of water, which looked wrong.
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
e922e06f99
Assign a player number to each UniQuake instance in split-screen as opposed to providing a library override. The UniQuake class can decide for itself how this maps to an alternate library filename. This player number is also provided to FMOD which allows its localized audio for split-screen feature to work properly.
5 years ago
Nico de Poel
e37d6f0a78
Bumped heap space to 256 MB since we'll need to go there sooner or later anyway
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
5b333f698b
Updated FMOD to version 2.01.11 (latest stable)
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
475444f904
We can share one point sampler for both diffuse and emissive textures, so reduced it down to one
5 years ago
Nico de Poel
f0bda1fcb1
Added a Software mode visual style, with point sampling and affine texturing, and without any liquid transparencies.
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
fcc41b0154
Replaced previous Lightmapped shader with a generic Quake uber-shader, which is based on the Simple Unlit shader and allows choosing between lightmapped or blinn/phong lit, as well as emissive properties. Applied this to both the Entity and World materials, which is another step towards creating a unified and authentic look.
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
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
592c326b53
Added a scene to experiment with split-screen running multiple instances of the game. Added the ability to override the default engine library name, and added additional layers for camera masking.
5 years ago
Nico de Poel
05a4de89a1
Minor things that have accumulated over time
5 years ago
Nico de Poel
e0ce62d2ec
Prevent double allocations of memory block for quakeparms, and report if allocation of hunk memory fails.
5 years ago
Nico de Poel
d3a585beee
Added a volume slider to the inspector for the audio manager, so we can silence the game during testing if audio is not needed
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
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
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
0899855b51
Updated project to Unity 2020.3.14 and fixed some minor issues after upgrade
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
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