- Home /
Question by
jchow · Oct 15, 2013 at 10:05 PM ·
changing shader
What sort of shader/texture issue would cause this kind of artifact?
Hi, I'm trying to multi_compile support for specifying a texture in my shader. If I have this code:
void surf (Input IN, inout SurfaceOutput o) {
half4 c = _Color;
#if TEXTURE_ON
c *= tex2D (_MainTex, IN.uv_MainTex);
#endif
I get this kind of output:
The weird thing is that the bad texture changes (shimmering differently) every time the camera angle changes, almost as though it was reading uninitialized memory. As soon as I comment out the #if and #endif, the image looks fine:
Any thoughts? Thanks in advance.
2013-10-15_1501.png
(87.3 kB)
2013-10-15_1501.png
(112.4 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613120014im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how to change color of dublicate object ? 1 Answer
Shader too bright any way to reduce further? 1 Answer
World Relative UVs with normalmaps 1 Answer
Swapping Compute Shaders 1 Answer