Jump to content
  • Advertisement
Sign in to follow this  

textures dissapear as a result of using D3DVECTOR?

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

OK, So I am switching over to using vectors in my application #define CUSTOM_VERTEX_FVF D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX2 struct Vertex { //float x,y,z,rhw; previously I used D3DFVF_XYZRHW in the define D3DVECTOR position; D3DCOLOR diffuse; float u,v; float u2,v2; }; ...but as a result, the textured images in my program all dissapear. I really dont have clue how that happened, but I found that replacing D3DFVF_XYZ with D3DFVF_XYZRHW makes the textured images appear but very dark in color, redish actually. I am also using the following SetTextureStateState functions and thought that maybe they had something to do with this. pD3Ddevice->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_MODULATE); pD3Ddevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE); pD3Ddevice->SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_DIFFUSE); ...anybody ever experience this wierdness? any help would be greatly appreciated!

Share this post

Link to post
Share on other sites
Sounds like you missed something in your convertion. Is the only change you made from
struct{ float x, y, z, rhw; .... } to struct { D3DVECTOR; ... }
and the change with your fvf?
If so, you might try tossing your original struct back together and eliminate the rhw component. See if the results are the same as you described above with the change.
It sounds like your software is not sharing the same idea about how to use that structure. Dark red could mean that a piece of code is still using rhw loc which now translates down into the red component your diffuse.
Kick it around. =)

Share this post

Link to post
Share on other sites
Awesome.... I found the solution..

That thing you said about "rhw loc which now translates down into the red component your diffuse." made me realize that I still needed that rhw value. I changed my custom vertex to the following


struct Vertex

D3DVECTOR position;
float rhw;
D3DCOLOR diffuse;
float u,v;
float u2,v2;

...and now it works , 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!