See to Red round line on picture. When source texture (Text RGB) of the second layer have some colored pixels on self border, it ends blurs across all base texture (Base RGB).
If I make one pixel space from border on Text RGB texture, the blurred black trace disappeared. Which error in shader have this symptoms?
Why when I import shader with this code
string Textshader = " SOME ... CGPROGRAM ENDCG
(ALL SHADER TEXT SEE BELOW)";
Material material = new Material(Textshader);
this error appears:
Shader error in âTextShaderâ: Parse error: syntax error at line 23
where âCGPROGRAMâ places.
The first effect you are seeing is clamped texture sampling. If you sample UV coordinates outside [0,1], the returned value is defined by the source textureâs wrap mode. Repeat will use the fractional component of the coordinate, effectively tiling your texture. Clamp will clamp the coordinate to [0,1], giving you the result you see above. If you include a border of a certain colour, that border will be smeared out as far as you sample.
The second problem is likely with your shader source. Have you tried compiling it as a standalone shader? You might get better feedback from the compiler there. Chances are itâs something small like a missing brace.
This error appears in any tested shader when it contains CGPROGRAM section, because compiled program have no way to compile CGPROGRAM section âon the flyâ. Other sections have only options which not needed to compile.
Am I right?
P.S. if so, than maybe exists some way to precompile shaders without adding they to project in *.shader files?