Direct3D-Rendering-Cookbook icon indicating copy to clipboard operation
Direct3D-Rendering-Cookbook copied to clipboard

question about Ch08_02Particles/ParticleRenderer.cs

Open shadercoder opened this issue 9 years ago • 1 comments

hi i have questions there is a line of code this.ParticlesPerBatch = (int)(maxParticles * 0.0128f); how did you derived the 0.0128 value? and what is the "limiter"? i still can't understand it thanks peter

shadercoder avatar Sep 12 '16 02:09 shadercoder

@shadercoder primarily this is just a constant value I chose based on achieving a suitable rate of new particles vs those that are already alive that appealed visually. The limiter and the ParticlesPerBatch work together in this way. E.g. I wanted the snow fall to be consistent with no "gaps" in the fall.

The limiter is the time in seconds between each round of "particle generation".

I could have chosen a more elegant or easy to understand solution to this - but I think at the time I had achieved the look I was after :)

You do have to be careful about the maximum value as the ParticlesPerBatch is used within the context.Dispatch call which has a max value of 65535.

justinstenning avatar Sep 13 '16 02:09 justinstenning