refactor(particlesys): Cleanup retail volume particle depth handling - #3188
refactor(particlesys): Cleanup retail volume particle depth handling#3188Mauller wants to merge 1 commit into
Conversation
PR Summary by QodoParticleSys: Make volume particle depth configurable while preserving retail defaults
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Vol depth 0 ignored
|
bbbc607 to
a596261
Compare
|
The overall direction looks good, but I think two issues should be addressed before merging:
Other than these configuration and round-trip concerns, the change looks clean and the CI results are good. |
a596261 to
291a2e3
Compare
291a2e3 to
53eef90
Compare
53eef90 to
c32d92c
Compare
|
Fixed based on feedback and did a little more cleanup around it as well. |
c32d92c to
ffa3dc6
Compare
|
Updated with recent suggestions along with a little extra cleanup around the same area. |
| //RENDER IT! | ||
| if( sys->getVolumeParticleDepth() > 1 ) | ||
| const UnsignedInt volumeParticleDepth = sys->getVolumeParticleDepth(); | ||
| if( sys->isUsingVolumeParticles() && volumeParticleDepth > DEFAULT_VOLUME_PARTICLE_DEPTH ) |
There was a problem hiding this comment.
I might clean this up in the particle batching PR, it becomes more significant for ignoring misconfigured volume particles as it skips all of their setup.
There was a problem hiding this comment.
Why is testing for volumeParticleDepth > DEFAULT_VOLUME_PARTICLE_DEPTH not sufficient?
There was a problem hiding this comment.
Because that information is not meant to tell you the particle type.
There was a problem hiding this comment.
I didn't want to drop the early depth test since it helps escape earlier in the batching code.
There was a problem hiding this comment.
So non-volume particles cannot be drawn with depth >= 2 ?
There was a problem hiding this comment.
They don't get draw by RenderVolumeParticle() they use Render. Non volume particles also don't make use of the volume depth variable.
There was a problem hiding this comment.
What happens if a non volume particle with depth 2 is passed to RenderVolumeParticle? Does it do anything?
| //RENDER IT! | ||
| if( sys->getVolumeParticleDepth() > 1 ) | ||
| const UnsignedInt volumeParticleDepth = sys->getVolumeParticleDepth(); | ||
| if( sys->isUsingVolumeParticles() && volumeParticleDepth > DEFAULT_VOLUME_PARTICLE_DEPTH ) |
There was a problem hiding this comment.
Why is testing for volumeParticleDepth > DEFAULT_VOLUME_PARTICLE_DEPTH not sufficient?
ffa3dc6 to
1034a5b
Compare
| Bool isUsingDrawables() { return m_particleType == DRAWABLE; } | ||
| Bool isUsingStreak() { return m_particleType == STREAK; } | ||
| Bool isUsingSmudge() { return m_particleType == SMUDGE; } | ||
| Bool isUsingVolumeParticles() { return m_particleType == VOLUME_PARTICLE; } |












This PR is a refactor to cleanup the handling of volume depth for volume type and normal particles.
The particle system class originally returned a hard coded value from
getVolumeParticleDepth()instead of returning the variablem_volumeParticleDepth.This value is now retrieved from the particle template and exposed to configuration through the ini field of
VolParticleDepth.To preserve the retail particle behaviour, we identify uninitialised volume particles and set their particle depth to the original hard coded value. Otherwise the configured by ini value will be used.
EDIT - For normal particles we now also initialise their depth to 1.