Kinect "FillHoles" shader Error in Stride

hi all,

I am trying to port the “fill holes” shader for kinect to stride, but it won’t compile:

“cannot implicitly convert from const float2 to float4”

my guess was, that the stride filter base shader wants a float4 for output, but this also won’t work:

return float4( float2(lerp(depth, c_o.r, Smooth-Reset), confidence - Decay*0.1f), 0,0);

It would be cool if one of you shader folk could have a quick look at it. This should be quite easy to fix. I can’t find where this conversion happens. (3.2 KB)

1 Like

well, one of the errors seems to be that you’ve got multiple returns - some are float2 and some are float4 type. however, your function signature wants a float4 return type.
so: change the signature to float2 Filter(float4 tex0col) and all returns accordingly.

still, this does not solve it entirely for me. i’m stuck with the next error: lerp: implicite truncation of vector type

Thank you, I totally missed the multiple returns! It compiles if all of them return float4. I guess this has to do with stride’s base shaders, and they don’t allow for outputting float2. On the node itself I can set the shader to output float16.

@tonfilm is it possible to just process r16 in the pixel shader and output float instead of float4? (840 Bytes)

the pixel shader output must be float4, you can’t change that, but if you only write into the red channel and the output format is R16 all is fine. the shader won’t do extra work…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.