How to use a shader on a piece uv of a map?

Viewed 35

I have been looking for a solution to my problem for a long time. I am learning to write shaders and I have a problem to color only the part of the uv map, from which I load the 3D model. Could someone tell me how to do it? I tried texture2D but unfortunately to no avail. It is possible that I used this feature incorrectly. Below is my shader fragment which is responsible for color change.

 shader.fragmentShader = shader.fragmentShader.replace(
 `#include <dithering_fragment>`,
 `#include <dithering_fragment>

  vec3 base = shaderColor; 

  vec3 c = mix(gl_FragColor.rgb, base, 1.0);

  gl_FragColor = vec4(c, diffuseColor.a);
  `
);
0 Answers
Related