Repository navigation
Conversation
|
Noticed some previous changes for previous PRs got added in, will fix tomorrow. |
6022095 to
3c71865
Compare
|
aligned branch with the latest changes on main |
|
@marchc1 @callumok2004 I had a look in-game and all the particle operators should be implemented now, I could use help with testing / looking if behavior is different than in garrysmod etc.. Or even a first pass on the code changes |
|
This is quite a lot of code, I also see that it implements quite a few functions that don't have really anything to do with particles so it would be actually better to split this up into smaller PRs that are easier to review. |
|
I did ask earlier in the discord what should be done but I've been told it was fine-ish (?). Regarding the extra functions they're necessary for the full impl of particles, I'm thinking |
I understand this is a big system but I would still split it to what is not directly relevant first, you are also implementing the full set of operators which on their own are rather modular, it's just a lot of code to go through but I'm not going to be in the way of blocking the PR if @marchc1 or @callumok2004 decide this is fine. |
|
I'll try to split the new function implementations that are separate from the particle system into other PRs as a first pass, that should at least reduce the load of this one. I think I can also separate the Lua bindings as another PR. |
|
@ZehMatt I've opened 4 PRs that match all the new things that have been implemented for particles to work but are not directly particle code. |
…ission control and collection creation
…model particles - TE effect dispatch with ClientEffectRegistration and EffectDispatch string table - ParticleEffect / ParticleEffectStop callbacks, DispatchParticleEffect and StopParticleEffects - C_ParticleSystem think, CNewParticleEffect, ParticleProperty and ParticleMgr hooks - lua: CreateParticleSystem(NoEntity), CNewParticleEffect methods, Entity particle methods, ParticleEffect(Attach), game.AddParticles - AE_CL_CREATE/STOP/ADD_CP particle anim events and model keyvalue particles - implement GetModelKeyValueText - EffectData defaults Scale=1 and AllowOverride=true - replace randomfloats .bin with inline RandomFloats.cs
…ers and render cache - Spritecard shader (C# + GLSL) ported from the SDK, without depth blending - C_OP_RenderSprites: spritecard and non-spritecard paths, sorted render list - render cache batching and DrawRenderCache in opaque renderables - NewParticleEffect.DrawModel per the GMod decomp - sheet loading from VTF resource data - emit_instantaneously and emit_continuously - Position Within Sphere Random, Lifetime Random, Lifespan Decay, Movement Basic - material system: IsSpriteCard, user clip transform override, camera position/vectors recompute
… remaining renderers Operators: - control point, movement, remap and transform operators ported from GMod client.dll Initializers: - bulk of the remaining initializers - query support for hitbox sampling (GetRandomPointsOnControllingObjectHitBox, HitboxToWorldTransforms, IsBrushModel) Forces and constraints: - builtin force generators - constraints: distance, distance to path, planar, world collide, world trace (with shared collision cache) and box - NoiseSIMD and RandSIMD helpers Emitters: - instantaneous and continuous emitters reworked to match GMod - emit noise and emit to maintain count added - PrevSimTime reset to 1e23 every simulation step, as GMod does Renderers: - render_sprite_trail, plus a splinecard vertex shader (GLSL port of splinecard_vs20) for $splinetype materials - render_screen_velocity_rotate - render_rope: BeamSegDraw path and spritecard spline path. BeamSegDraw can now write into an external MeshBuilder with indices. - Render models: renderer, precache and IParticleSystemQuery hooks. It draws nothing yet: the client query has no GetModel, GetActivityNumber or DrawModel. - definition Precache now calls renderer Precache, as GMod does - IModelRender.SetupLighting added to the engine (not wired to the particle query yet)
- add the remaining initializers, split by category (collision, control point, hitbox, parent, position, random, remap), including Cull relative to model, Remap Control Point to Vector and Remap Speed to Scalar - ParticleSystemQuery: closest hitbox, desired hitbox and point-in-hitbox queries, plus Studio_MaxFrame for sequence-based lifetimes - implement IEngineClient ComputeLighting, ComputeDynamicLighting, GetLightForPoint and GetLightForPointFast from engine.dll; the normal is now optional - ParticleCollection: random vector queries advance the seed by 3 and sphere radius uses pow(r2, 1/3), both to match GMod - add attribute field and control point clamp helpers
…ounds fixes - util.ParticleTracer / util.ParticleTracerEx, the client "ParticleTracer" effect, GetTracerOrigin (with the SWEP GetTracerOrigin hook) and FX_TracerSound - IntersectRayWithRay and CalcDistanceSqrToLineSegment - CNewParticleEffect:Render() - GL46: remap texcoord 6/7 to the wrinkle/specular locations to stay within 16 vertex attributes, and only bind flex streams when TC4/TC5 are unused; spritecard shader locations updated to match - ParticleCollection: fix the tint blue channel, initialize the constant normal attribute, and match GMod's RecomputeBounds (skip screen space effects, SSE min/max NaN semantics, summation order) - ParticleSystemDefinition: parse the "normal" constant
ec02530 to
fa8dc78
Compare
This PR is a draft to follow along the progress of the implementation of the particle system in sdn.
Any feedback/suggestion/tips are of course more than welcome, testing is also greatly appreciated as it's going to be fairly difficult to test all the cases involved here.
PS: I'm very sorry in advance for the amount of changes being pushed here.
PS2: Ghidra and Claude are being used in this process.