Quantcast
Channel: Questions in topic: "hlsl"
Viewing all articles
Browse latest Browse all 206

No acceptable conversion when converting cg shader to glsl

$
0
0
I have a simple shader where at some point I perfrom logical operations component-wise between boolean vectors: float2 x_ = ( (x >= 0) && (x < a) ) ? float2(0., 0.) : float2(0.5, 0.5); This compiles ok in HLSL. However when Unity tries to convert it to GLSL, I get: > Shader error in 'Sprites/Advanced':> '&&' : wrong operand types no> operation '&&' exists that takes a> left-hand operand of type 'vec2' and a> right operand of type 'vec2' (or there> is no acceptable conversion) at line> 83 (on gles) Is there an elegant way to perform logical operations per component so that it compiles to GLSL?

Viewing all articles
Browse latest Browse all 206

Trending Articles



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