Advertisement Jump to content


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


Homogenous divide by W?

This topic is 5845 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

From what I understand, the output position of vertex shaders should be in clip space meaning x,y, and z should be -1 to 1 (z from 0 to 1) so I set up a basic vertex shader to test this. I set constant 5 (c5) to something like (.5, 0, 0, 10) and mov c5 into oPos. Naturally the vertex appears at .05. I change w to 1 and the vertex appears at .5. Great. Same thing works for y values. Terrific. Not z values though. If I change z to 1.0 using the above examples, my vertex disappears; most values of Z cause the vertex to not appear. Testing finds the acceptable values of Z to be exactly 1/100th of W or less. Value of .3Z needs a 30.0W or nothing is rendered. What can be causing this or this normal? I've set my Viewport range from 0 to 1 and my Projection matrix is 0 to 100 but its not even being sent to shader at all. More testing shows that changing the zF of the projection matrix does alter this (ie. zF of 10 means the W need only 10* the z value of the vertex). Any chance this could be some sort of driver problem? [edited by - Kalthorn on January 18, 2003 7:49:48 PM] [edited by - Kalthorn on January 19, 2003 2:15:55 AM]

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
I think perspective divide is done outside a vertex shader, so u don''t have to do it. I may be wrong tho I new to this stuff.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!