Skip to main content
GameDev.net gamedev.net
🔒 Locked

problem with textures

Started by acidkobra Nov 30, 2002 at 3:41 PM 1 replies 350+ views
Original Post
acidkobra
acidkobra
I figured out my old problem and it is working great. But now I went to add textures and am having another problem. I load a texture in with D3DXCreateTextureFromFile. Then use g_pD3DDEVICE->SetTexture. defined the vertex data and everything. I create a simple imgae in paint and run the program. The texture loads in and is displayed but it only shows the base color? So like i make the whole image red and put blue spots on it but it only displays the red. Why is this I can show some code if it would help. Also I am sure it is not the video card drivers or anything like that because I have compiled other samples and they work fine. The main thing I can think of is that I don''t really define u and v cordinantes. but I thought it would default to 0,0 where do i define these anyway? The only thing that defines man from animal is our knowledge of computer programming.
The only thing that defines man from animal is our knowledge of computer programming.
PiXeLatiOn
PiXeLatiOn
-You MUST specify texture component in your vertex FVF .
-You MUST include texture coordinates in each vertex .
Try this , you will feel the relief that every coder does when a bug is solved
-Da Mr.RaSt3RiZah-
flareman
flareman
One more point of notice: make sure you assign the correct u and v values to the proper vertices; I remember the first time I tried to texture a polygon: I accidentally had set all vertices to u = v = 0.0f, which gave the entire polygon the top-left texture pixel color - what a jerk I am :D

-----------<<>>-----------
Flareman (a.k.a Ga1adaN)
Primus ante Adain
flareman@freemail.gr
-----------<<>>------------
-----------<<>>-----------Flareman (a.k.a Ga1adaN)Primus ante Adain[email=flareman@freemail.gr]flareman@freemail.gr[/email]-----------<<>>------------

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.