Shader error in these few lines

I keep getting an error for the following piece of code. If I set tex and selectN to some values and remove the following code, it works fine. What am I doing wrong? (The error doesn’t help me out, and points me to the wrong direction entirely). Any help would be great!

	float3 selectN;
	
	float2 tex;
	if (dist == 0.0) {
		selectN = N2;
		tex = intersection2.xy;
	} else if (dist2 == 0.0) {
		selectN = N;
		tex = intersection.xy;
	} else if (dist < dist2) {
		selectN = N;
		tex = intersection.xy;
	} else {
		selectN = N2;
		tex = intersection2.xy;
	}

Full code: http://pastebin.com/krrjtdag
Error: Shader error in ‘Clipping/ClipShaderWithColor’: Shader program had errors at line 20

Apparently I got a more useful error as well: Arithmetic instruction limit of 64 exceeded

Could you post the error and the rest of the shader?

Added the error and full shader

Line 20 points to your #pragma exclude. Have you targeting different models to see if the rest of the code works?

1 Answer

1

#pragma target 3.0 fixed it.