Shader Chunk to access uv1?

So, studying your generated this.material._shader.definition.fshader;, you can find the order at which your specific material is being shaded. The shader main method will look something like this:

void main(void) {
	dDiffuseLight = vec3(0);
	dSpecularLight = vec3(0);
	dReflection = vec4(0);
	dSpecularity = vec3(0);

	#ifdef CLEARCOAT
	ccSpecularLight = vec3(0);
	ccReflection = vec4(0);
	ccSpecularity = vec3(0);
	#endif
   dVertexNormalW = vNormalW;
   dAlpha = 1.0;
   getViewDir();
   getNormal();
   getReflDir();
   getAlbedo();
   getSpecularity();
   getGlossiness();
   getFresnel();
   addAmbient();
   addReflection();
   dLightDirNormW = light0_direction;
   dAtten = 1.0;
	   dAtten *= getLightDiffuse();
	   dAtten *= getShadowVSM16VS(light0_shadowMap, light0_shadowParams, 5.54);
	   dDiffuseLight += dAtten * light0_color;
	   dAtten *= getLightSpecular();
	   dSpecularLight += dAtten * light0_color;


	#ifdef CLEARCOAT
	gl_FragColor.rgb = combineColorCC();
	#else
	gl_FragColor.rgb = combineColor();
	#endif 

	gl_FragColor.rgb += getEmission();
	gl_FragColor.rgb = addFog(gl_FragColor.rgb);

	#ifndef HDR
	gl_FragColor.rgb = toneMap(gl_FragColor.rgb);
	gl_FragColor.rgb = gammaCorrectOutput(gl_FragColor.rgb);
	#endif
gl_FragColor.a = 1.0;

}

From there you can find the right shader chunk to override. Usually I search with the name of the method the Playcanvas engine repo to quickly find the right shader file, to get the name of the shader chunk.

1 Like