Archived

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

Goodlife

Clamping Z with ProcessVertices

Recommended Posts

Hi all, I need to render a model, but I need all Z buffer comparisons to ''pretend'' like they''re all the value of the highest vertex in the model. To the point: I want my model to Z clip based ONLY on its highest point. The only way I can think of to do this is to run the whole model through processvertices to transform and light it, then lock the vertex buffer and manually set the z position of each vertex. Am I missing something? Is there an easier way to do this? I''m concerned about the speed of that method. Goodlife -- Goodlife ----------------------------- Those whom the gods would destroy, they first drive mad. --DirectX design team official motto

Share this post


Link to post
Share on other sites
Oh man, you guys are killing me! Ask a simple question-- ANY question-- and the answer is "why you wanna do dat?"

Anyway, for anyone who cares, you can clamp Z in DirectX by setting the minz/maxz values in D3DVIEWPORT8 to be the same value.

Share this post


Link to post
Share on other sites
If you use a vertex shader when you render it you can use any formula you like to determine the z value. But it sounds like your confused on something you doing.

Share this post


Link to post
Share on other sites