A question about Reflection if Fixed Pipeline

Started by
2 comments, last by Maskotti 18 years, 7 months ago
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.
Advertisement
Hello,

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

http://www.gamedev.net/community/forums/topic.asp?topic_id=345603
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
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.

This topic is closed to new replies.

Advertisement