Jump to content
  • Advertisement
Sign in to follow this  
vladic2000x

A question about Reflection if Fixed Pipeline

This topic is 4744 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 there. I'm sorry for asking about reflection again, cause this forum in my opinion is full of threads about reflection. But all they are discussed in shaders. Unfortunately i don't have a shader capable card, therefore is someone has experience with projective part in fixed function pipeline please reply. Now, i understand the math behind the projective texturing , but there is probably something wrong in implementation, because even applying the remmaping matrix to coordinates they do not change from (-1,1) to (0,1). I can't post a screenshot but it looks like this --------- |tex|tex| --------- |tex|tex| --------- Take a look at the code below, which handles the projective part, and please reply if i missed something. D3DXMATRIX remapMat; // 0.5 0.0 0.0 0.0 // 0.0 -0.5 0.0 0.0 // 0.0 0.0 1.0 0.0 // 0.5 0.5 0.0 1.0 //this is the content of matrix (DirectX ) //used to remap the view*world transformed vertices //from(-1,1) to (0,1) //next tell to hardware to use as input coordinates for //texture, transformed vertex coordinates (camera space transformed) d3d_dev->SetTextureStage(0,D3DTSS_TEXCOORDINDEX,D3DTSS_TCI_CAMERASPACEPOSITION) //tell hardware to divide the values from prev call by w (from tex coord) d3d_device->SetTextureStage(0,D3DTSS_TEXTURETRANSFORMFLAGS, D3DTFF_PROJECTED| D3DTFF_COUNT4) //modify obtained coords by remap matrix d3d_device->SetTransform(D3DTS_TEXTURE0,&remapMat); thx.

Share this post


Link to post
Share on other sites
Advertisement
Hello,

I think you should visit my thread. It's all there. :)

http://www.gamedev.net/community/forums/topic.asp?topic_id=345603

Share this post


Link to post
Share on other sites
Thx Maskotti
but on the thread you specified i think is something wrong
after calling to d3d_dev->SetTextureStage(0,D3DTSS_TEXCOORDINDEX,D3DTSS_TCI_CAMERASPACEPOSITION)
you still provide a texture transform which includes if i'm not wrong a view transform which is already included in the call above.
Anyway i fixed my problem
i just multiplied the remap matrix by the projection matrix

Share this post


Link to post
Share on other sites
Quote:
Original post by vladic2000x
Thx Maskotti
but on the thread you specified i think is something wrong
after calling to d3d_dev->SetTextureStage(0,D3DTSS_TEXCOORDINDEX,D3DTSS_TCI_CAMERASPACEPOSITION)
you still provide a texture transform which includes if i'm not wrong a view transform which is already included in the call above.
Anyway i fixed my problem
i just multiplied the remap matrix by the projection matrix


Yeah, there wasn't everything in the source I specified, but everything essential for building matrices etc. ;-) I'm glad you managed to fix the problem anyway.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!