I’ve currently 2 problems…
I want to add an animated noise overlay on an existing texture for a model.
To achieve this, I’ve created a fragment shader for the CustomProceduralTexture.
The texture can be set with .setTexture(‘u_emissiveTexture’, textureObject)
The position of the texture2d is wrong. The problem is, that vPosition is the wrong value because the texture2d needs the correct vTextureCoord, not the vPosition.
The output would be
gl_FragColor = texture2D(u_emissiveTexture, vTextureCoord) + vec4(color, 1.0);
Currently it is
gl_FragColor = texture2D(u_emissiveTexture, vPosition) + vec4(color, 1.0);
When i try to declare
varying vec2 vPosition;
varying vec2 vTextureCoord;
varying vec2 vUV;
and use vTextureCoord it fails, because the vertex-shader that is used by CustomProceduralTexture does not declare vTextureCoord.
How can I solve this problem?
I declared a glowLayer (Make Mesh Glow - Babylon.js Documentation) which works fine with emissive colors but i can’t get it to work with an emissiveTexture. It’s just not glowing.
And it doesn’t matter if it’s the CustomProceduralTexture or if i set the emissiveTexture directly with the right image.
Thank you all for the great support and piece of software you’ve provided