Hi everyone, I’m looking for some advice about importing textures into PlayCanvas. Some of our textures change color slightly after being imported, or end up with a strange bluish glow/shine. The odd thing is that all of the textures are exported using the exact same settings, but only a few of them have this issue. Does anyone know what could be causing this or how to fix it?
We are using a custom PBR shader using shader chunks. This is the metalness and gloss part…
metalnessPS: `
uniform sampler2D texture_metalnessMap;
uniform float metalness;
void getMetalness() {
dMetalness = texture2D(texture_metalnessMap, vUv0 ).b;
dMetalness *= metalness;
}
`,
glossPS: `
uniform sampler2D texture_glossMap;
uniform vec4 roughChanges; //x static bool, y: black z:white w:contrast
void getGlossiness() {
dGlossiness = 1.0;
dGlossiness *= texture2D(texture_glossMap, (vUv0)).g;
if(roughChanges.x > 0.5){
dGlossiness = mix(roughChanges.y,roughChanges.z,dGlossiness);
dGlossiness *= roughChanges.z;
}
dGlossiness = 1.0 - dGlossiness;
}
