Sign in to follow this  

2D Vertex Shader?

This topic is 4303 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 again guys, anyone know what the correct vertex shader would be if you didn't want the poly to be projected. At the moment I use the same vertex shader, which multiplies the incoming vertex info by the World Proj Matrix. If I just wanted to display something 2D using the vertex shader how would I do this? [edit] I'm using HLSL btw, not ASM

Share this post


Link to post
Share on other sites
you only need to remove the multiplication. just return the vertices from the vertex shader as they come in.
then your screen goes from (-1,-1) to (1,1).

Share this post


Link to post
Share on other sites
Wel the vertices that are coming in, if they are pretransformed should be described on a pixel grid, specifying the actual pixels they lie on. Given the width and height of the back buffer in the shader you would have to convert the actualy coordinates to lie within the -1 - 1.

Wouldn't you?

Dave

Share this post


Link to post
Share on other sites

This topic is 4303 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this