Killtex in HLSL?

Started by
1 comment, last by yoda101 20 years ago
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!
Advertisement
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.
[sub]My spoon is too big.[/sub]
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!

This topic is closed to new replies.

Advertisement