Your comments

I have news! I have pictures of compiled code that works and doesn't work. It seems to be a problem with the piecewise math between a float 2 and a float.




sorry for the slow responses on my part. I actually don't know how to make a shader write to depth while in the SF interface. I have only ever solved this by including this in a shadow pass (since an object needs to write to depth in order to cast a shadow) or by setting a default fallback shader that has a shadow pass in it. I don't suppose that helps you much though. Glad you got it working

I can confirm that this sometimes results in actual incorrect UVs. I regularly use this offset in the first step of making a radial mask, and the UVs displayed in the node seem to be what is being used in the calculation ie. the remap has a correctly centered mask and the multiply has the mask in the lower left hand corner.

sorry for the slow reply, masked materials should draw to depth -- as should anything in the deferred pipeline.

Can you include an image of the result? You may just need to let your shader write to depth if it isn't.