That’s weird: unless I’m missing something, there are no numeric-type constructors in that function. I wish Unity’s shader compilation errors were more helpful.
yes, the posted code from jesta didn’t not have that float4(0), but he didn’t post a completed code, so it may be in the fragment code somewhere.
Anyway, it is just a general idea how i fixed that d3d11 warning issue. hope it helps for others.
Something if you get the problem in fragment or other function codes, then you will get the error message for Program vert from unity editor.
The vert code from jesta has no problem at all, so the error is from other code.
just don’t trust all the error message from unity editor, need to try to test which code get the errors.
I recognize this function from the “photoshop-maths shaders” blog page. Like all their shaders – while it works, it’s a little on the bloated side (which is better for clarity and understanding though). Here’s my slightly leaner version:
void colorAdjust(inout half3 col) {
col = lerp(0.5, col * _ContrastSaturationBrightness.z, _ContrastSaturationBrightness.x);
col = lerp(Luminance(col), col, _ContrastSaturationBrightness.y);
}
The call to Luminance() assumes/requires that UnityCG.cginc is #included though — which I need for other things in my post shader anyway…