Jump to content
  • Advertisement
Sign in to follow this  
LevyDee

Quick, simple shader question

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

Is a vertices position in 3d space, automagically transformed to screen space when passed to the pixel shader?

Share this post


Link to post
Share on other sites
Advertisement
No. The vertex shader has to output a vertex position in homogoneous clip space, which is the space you're in after applying a projection matrix. Usually this will involve transforming from object space to world space, then to view space, and then applying the projection (or this can all be done in one step using a combined transformation matrix). The rasterizer will then handle clipping, interpolation, division by w, and the viewport transform. After the viewport transform the position will be in "screen space".

Share this post


Link to post
Share on other sites

The rasterizer will then handle clipping, interpolation, division by w, and the viewport transform. After the viewport transform the position will be in "screen space".


Thats what I was looking for. Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!