This successfully assigns the fragment shader to the particle system but the vertex shader doesn’t perform the uv calculation for the animation sheet.
Now the Engine.createEffectForParticles() says:
“Please note that some parameters like animation sheets … not supported in this configuration, except if you pass the particle system for which you want to create a custom effect in the last parameter”
Unfortunately the result is the same, the custom fragment shader is executed but the vertex shader still doesn’t setup the uvs correctly. Here is what I did:
let effect = engine.createEffectForParticles(“myeffect”,
, // uniforms
, // samplers
“”. // define string,
null, // fallbacks
null, // on compiled,
null, // on error
Hi. We will transfer an example to PG.
As atm we need to use babylon version 5.0.0, can you let us know if there have been any changes regarding this issue/particles/shader in the newer versions?
Just in case if need to update the version, that is important to know.
Here is the playground without custom shader, where everything is working as expected:
With effect applied after creating the particle system (the particle system goes into the createEffectForParticles() method):
Now the other way around, the effect is created first and passed to the constructor of the ParticleSystem:
Looking at the captures from SpectorJS, it seems that only the non-effect version of the particle system uses the correct vertex shader when the animation sheet is enabled.
Otherwise a vertex shader which doesn’t perform the correct uv calculation is used.