- Home /
opengl es Shader variables, wrong values in shader (iOS 6)
Hi all,
There is some problem with shader variables. for example
c# code:
...
Shader.SetGlobalVector("test", new Vector4(1,10,100,1000));
...
cg code (pixel shader):
fixed4 test;
fixed4 ps_main(VS_OUTPUT) : COLOR
{
return test * float4(1, 0.1, 0.01, 0.001);
}
On PC, Mac platforms output will be white color - (1*1, 0.1 10, 100 0.01, 1000 0.001) but on ipad (opengl ES 2.0, ios 6) output is red color, means that test vector set as clamped or I don't know how it was modified. (1*1, 0.1 1?, 0.01 1?, 0.001 1?)
So is there some ES standard or specification, or anything else that I can read about it.
p.s. I was working on manual fog using unity variables unity_FogStart, unity_FogEnd, etc. Unity standard fog is working ok, but mine - doesn't at all, cause unity_FogEnd.x is near 1.0 value, instead of (for example) 700.
Your answer
Follow this Question
Related Questions
clipping shader for OpenGL quad 0 Answers
ES2.0 Diffuse Shader? 0 Answers
Shader not working in OpenGL (Working in DirectX) 0 Answers
[iOS] Metal API looks good, OpenGL doesnt 1 Answer
GLSL shader adding UV offset 1 Answer