When sampling the same texture twice in a surface shader, I have the following:
At the end of my surf() method, when I get my main sample from the following code:
float3 mainTextureSample = tex2D(_TextureMap, textureUV);
o.Albedo = mainTextureSample.rgb;
I get the following output:
If I use the following code:
float3 detailTextureSample = tex2D(_TextureMap, detailUV);
o.Albedo = detailTextureSample.rgb;
I get the following output:
If I use this code to try to combine the two:
float3 mainTextureSample = tex2D(_TextureMap, textureUV);
float3 detailTextureSample = tex2D(_TextureMap, detailUV);
o.Albedo = mainTextureSample.rgb - detailTextureSample.rgb;
I get the following:
Since the detail sample is returning black, I’d expect to see something like:
Am I doing something wrong? My shader was working in 5.3, but in 5.4 it seems that it isn’t calculating things the same way?