Archived

This topic is now archived and is closed to further replies.

Killtex in HLSL?

This topic is 5009 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I know that the HLSL equavalent is clip() , However I have no idea on how to use this and I cannot seem to find any references to this anywhere. I would realy appreciate if anyone can help me on this. I''m trying to render out two views (for reflections and refractions) for a water shader and the geometries below and above the water needs to be cliped. I know that I some how need to pass in a plane equation to this but how? Realy would appreciate if anyone can prove a little sample code i.e. the vertex shader output that is required and the PS shader syntax. Thanks!

Share this post


Link to post
Share on other sites
clip(x) discards the pixel if any component of x is < 0.0. So, x can represent the distance of the point to a plane. If any of x''s components are negative, it''s behind the plane. I don''t recall right offhand what the plane equations are, but it''s all over the web.

x can be any float template type. (float1, float3, float2x4, etc).

I like pie.

Share this post


Link to post
Share on other sites
Thanks,

So just to be clear, at what stage do I apply the clip() i.e. Do I first need to render the scene to a texture then use clip() to disregard the unwanted pixels on the rendered texture, or are the geometries clipped before the render to texture takes place? when you say pixel what pixel is this refering to if you get my drift. Thanks!

Share this post


Link to post
Share on other sites