I have a very basic shader that I got from the forums to test something non-related out. When applying it to render , a ParticleEffect 's uv coordinates completely resets and I believe flips upside down as well. Any ideas as to what might be happening here? Will provide particle code if needed, but I’ve tried it with a several particles and still get the same issue. FWIW, tried both setTextureFromNode and setTextureFromFile which yielded same results. I will provide the particle code if needed, but it is the same result for all the ones I have tried.
My guess is that’s it’s simply that, by applying the shader to “render”, it affects all things parented below “render”–which includes your particle effect.
(Specifically, it may be that the particle system is applying a texture-transform to achieve the UV range shown in the “expected result” image–but your shader-code doesn’t seem to apply texture transforms, and so the one applied to the particles is having no effect.)
You might perhaps try either applying your shader to a node that is an ancestor of (or that is) your scene-node, but that is not an ancestor of your particle system, or explicitly disabling shaders on your particles via a call to “setShaderOff()” on the NodePath associated with your particle system.
The former might look something like this:
myScene = loader.loadModel("sceneModel")
myScene.reparentTo(render)
myParticles = ParticleEffect()
myParticles.loadConfig(fileName)
myParticles.start(parent = render, renderParent = render)
myScene.setShader(myShader)
# Note that the shader now applies to the scene--
# but does >not< apply to the particles.
The latter might look something like this:
myScene = loader.loadModel("sceneModel")
myScene.reparentTo(render)
myParticles = ParticleEffect()
myParticles.loadConfig(fileName)
myParticles.start(parent = render, renderParent = render)
render.setShader(myShader)
myParticles.setShaderOff()
# Note that the shader now >does< in a sense apply to the particles--
# but that this has been disabled by the call to "setShaderOff"
(You could also implement texture-transforms in your shader, of course–but as you say that the shader is only being applied as an experiment it may not be worth the bother.)