Good day comrades,
One good mate created a shader for older version of ThreeJS days ago:
new THREE.ShaderMaterial({
...
vertexShader: `
#define USE_MAP
varying vec2 placer;
uniform vec4 offsetRepeat;
void main() {
placer = uv * offsetRepeat.zw + offsetRepeat.xy;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,
fragmentShader: `
#define USE_MAP
uniform sampler2D map;
varying vec2 placer;
void main() {
#ifdef GAMMA_INPUT
fragColor.xyz *= fragColor.xyz;
#endif
gl_FragColor = vec4(1.0);
vec4 fragColor = texture2D( map, placer );
gl_FragColor = gl_FragColor * fragColor;
}`
});
Some time ago I’ve tried to update the ThreeJS core to resent version and got a thing, that object is not getting texture - it’s just black thing.
Can anyone help me this this? I am not in the shaders at all and, sadly, I don’t have the contact with that mate anymore.
!Update:
If to remove the fragColor
from line
gl_FragColor = gl_FragColor * fragColor;
then the model texture is white. So my guess is that fragColor
has wrong parameters.
So it seems that something has been changed in texture2D( map, placer )
since old versions. Any ideas?
Trying to make a fiddle, no results so far… Sorry…
Thank you in advance.