Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Problems with Vertex Shaders DX8... Help Please Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Battleline

May 11, 2005, 11:26 AM

Hello, I'm new to this forum, so I apologize for starting out by asking for help.

I'm having a problem trying to get my custom vertex shader in DirectX 8 to recognize that I'm trying to send it transformed vertices for the screen sized quad I'm trying to render. Instead, the quad appears to be picking up the world/view transformation from the last object I rendered in my scene.

Here's a screen shot:
http://www.epochstar.com/VS1.jpg

Notice my quad is being rendered in the upper left corner of the screen. I'm trying to get it to take up the entire screen. Is there something I can do in my vertex shader to make it recognize I'm dealing with pre-transformed vertices? Is there anything else I can do to get my quad to render full screen?

Thanks

 
bignobody

May 11, 2005, 12:35 PM

While the screenshot helps illustrate the problem, without some relevant code posted things become a guessing game. So here's my first guess ;)

In your FVF declaration are you using D3DFVF_XYZ instead of D3DFVF_XYZRHW?

 
Battleline

May 11, 2005, 12:36 PM



bignobody wrote: While the screenshot helps illustrate the problem, without some relevant code posted things become a guessing game. So here's my first guess ;) In your FVF declaration are you using D3DFVF_XYZ instead of D3DFVF_XYZRHW?


No, I'm using RHW. I'll post some code a little later. I'm not in a place where I can get to it right now.

Thanks

 
Steven Hansen

May 11, 2005, 01:25 PM

If you are using a vertex shader, then you have to map screen coordinates to the viewport clipping volume inside the shader. From DxDocs, "Microsoft Direct3D assumes that the viewport clipping volume ranges from -1.0 to 1.0 in X, and from 1.0 to -1.0 in Y."

I've run across and solved this problem numerous times. Post more specifics and we'll help you out further if you need it.

 
arex

May 25, 2005, 05:32 AM

Remember that you must set the matrices before (for shader) the object and need to also recalculate them again (if there is some chances been made).

 
This thread contains 5 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.