Archived

This topic is now archived and is closed to further replies.

Arnau

Problems with textures in a rectangle built with TransformedTextured vertices

Recommended Posts

Hi, In my application (written in c# and managed dx9) I have drawn several rectangles with some textures, using TransformedTextures vertices. In my card, everything works fine, the textures are ok. But I''ve executed the application in another computer, with the same directory tree, and the textures don''t appear. My card is a ATI Radeon 9600 and the other one is a Radeon 7500. The rectangles appear solid, painted with different colours, although the textures that apply to meshes or cubes with positionTextured vertices appear ok. Does anybody know why does this happen? Maybe any presentParams of the device??? Thanks in advance, Arnau.

Share this post


Link to post
Share on other sites
If you''re running your app from visual studio on the machine with the 9600, remember that the working directory will not be the same directory where your compiled .exe file is.

Unless your application takes relative paths to files into account, make sure that your .exe file is in the same directory as your textures. Don''t just go into the Debug or the Release directory and run the .exe file. Copy your .exe file into the same directory as your textures and you should be good to go.

neneboricua

Share this post


Link to post
Share on other sites
Thanks, but the working directory is relative, and, in fact, the application loads correctly the graphics, because the meshes and textures for the meshes (which are in the same directory as the textures that don''t appear) are drawn correctly.

But I don''t know why, the textures applied to transformed figures aren''t drawn. I''m totally lost!

Thanks,
Arnau

Share this post


Link to post
Share on other sites
Hi,

I''ve put the Radeon 9600 card in the pc that didn''t work, and it worked fine, so it must be something in the code that is not compatible with the Radeon 7500 card. I''ve tested it in a NVIDIA GeForce MX 440 and it didn''t work also.

But, in a Intel 82845G/GL, all the textures appear ok, but after a while, they get cracked, like if the texture coordinates were all wrong.

How can I know what is wrong??

Arnau

Share this post


Link to post
Share on other sites
First, make sure that it works correctly when using the reference rasterizer. Another idea is to call IDirect3DDevice9::ValidateDevice in the first frame right before your call to Draw*Primitive. That would check to see if the render states you''ve set are compatible with the card you''re running on. The return value will tell you what (if anything) could be wrong.

neneboricua.

Share this post


Link to post
Share on other sites
Hi

In another forum have answered the question.

The problem was that I forgot to add the vertex.Rhw = 1.0f; in each vertex.

Thanks for your help!

Share this post


Link to post
Share on other sites