Problem with texture in Directx8
Hi!
I''m a French guy (excuse my baad english!) developping a 3d game and I''m currently working on the 3d engine with visual basic 6.0.
I''ve got some problems with the texturing:
I load a texture with the function loadtexturefromfileex, then I create a box with the object d3dx.
If i don''t use texture on this box, the box is well rendered. But If I want to use a texture on It, I got a bug on the rendering box:
Instead of the texture, the engine display JUST the main color of the texture: If I load a texture reprensenting the sky, the box will be blue even if the texture is compound of cloud....
I work more than 10 hours on this problem and I didn''t find a solution to this strange behaviour.
Have you guys some idea to solve this problem?
Thanks in advance.
"Minë corma ilyë te turë, Minë corma te hirë
Minë corma te tulë ilyë ar sinomë mornië te ava
lenya
Sinomë norëva Mordor yassen caita i morniër..."
Have you checked the texture coordinates of the vertices that make the box? My first guess would be that they are all the same in your case.
Not sure if this is your problem, but when learning to do texture blending, All surfaces were the color of the top left pixel of the texture. It turned out I hadn''t specified that I''d be using multiple textures in my FVF.
Here''s the thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=106502
It''s about the seventh post down.
Here''s the thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=106502
It''s about the seventh post down.
Hi!
I use D3DX to create all the boxes I need in the engine. So I didn''t specify any texture coordinates nor FVF.
Perhaps the problem is here.
Is it possible to specify texture coordinates with boxes created with D3DX? I don''t have my listing here but, in Visual basic, my code is something like this:
public sub addbox()
dim box as D3DXmesh
set box=d3dx.createbox(d3ddevice,width,height,depth) ''perhaps, it misses some arguments but all arguments are fill in
''set up the texture
with d3ddevice
.settexturestage ...
...
.setTexture 0,textureToDisplay
end with
box.drawSubset 0
end sub
The ''textureToDisplay'' var contain the texture loaded by loadtexturefromfileex.
I''ll try to search about FVF and texture coordinates but I never seen any function in d3dx to specify this kind of thing.
"Minë corma ilyë te turë, Minë corma te hirë
Minë corma te tulë ilyë ar sinomë mornië te ava
lenya
Sinomë norëva Mordor yassen caita i morniër..."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement