Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Floating point error message in shader

$
0
0
I'm using a 3rd party shader. I don't notice any issues in the Unity editor (although I probably didn't open a scene that uses the shader). This code compiles cleanly for OSX, but gave an error message - "unknown variable 'f'" - at the line "float avg = (orgCol.r + orgCol.g + orgCol.b)/3f;" when I compiled for Windows 64-bit. Changing the "3f" to "3.0f" eliminated the compilation error. All the documentation I've seen suggests that 3f is legal floating point scalar syntax. Has anyone else seen this issue? //Our Fragment Shader fixed4 frag (v2f i) : COLOR{ fixed4 orgCol = tex2D(_MainTex, i.uv); //Get the orginal rendered color //Make changes on the color float avg = (orgCol.r + orgCol.g + orgCol.b)/3f; fixed4 col = fixed4(avg, avg, avg, 1); return col; }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>