Problem with D3DXSprite
I''ve stopped using D3DXSprite, and wrote my own code that does the exact same thing, but everything is batched, and when a texture or renderstate change is made that change is added to a link list, and every vertex between the two changes is drawn using DrawPrimitive and the current texture texture and renderstate. None of my code uses the D3DXSprite functions anymore, but when I removed the code I start getting problems. The problem occurs when I remove the begin and end calls with the sprite interface. With the calls in the graphic engine everything draws fine. With out those calls only 1 of the 2 triangles for each textured quad is drawn. Does anybody know why this is happening, and how to fix it?
G''day!
It''s hard to guess based on what you''ve said. My first guess would be that you have culling turned on and your quad isn''t set up properly, does D3DXSprite turn off culling? I can''t remember.
Anyway, try turning of culling and see if your quad shows up.
Stay Casual,
Ken
Drunken Hyena
It''s hard to guess based on what you''ve said. My first guess would be that you have culling turned on and your quad isn''t set up properly, does D3DXSprite turn off culling? I can''t remember.
Anyway, try turning of culling and see if your quad shows up.
Stay Casual,
Ken
Drunken Hyena
quote:does D3DXSprite turn off culling? I can''t remember.It realy dosent have culling at all.
Instead, if your width/height vars overlap your X/Y vars, the sprite would be drawn upside down, umm, like ; everything would be mirrored on the axis that overlaped.
[ my engine ][ my game ][ my email ]
SPAM
Wait, not width/eight -- but if say scaling was (-1.0,1.0) then the sprite would be mirrored on the X axis, and if scaling was (1.0,-1.0) it would be mirrored on the Y axis and mirrored completly if it was (-1.0, -1.0).
[ my engine ][ my game ][ my email ]
SPAM
[ my engine ][ my game ][ my email ]
SPAM
Given that he said he has stopped using ID3DXSprite, he will have to turn culling off manually.
Render states etc are important - make sure that you've:
+ Turned culling off (D3DRS_CULLMODE, D3DCULL_NONE)
+ Turned lighting off (D3DRS_LIGHTING, 0)
+ Got the projection, view and world matrices set up correctly.
+ Got your texture stages set up right.
EDIT :: I basically agree with Drunken Hyena - it sounds like a culling problem.
John B
[edited by - JohnBSmall on April 17, 2002 4:38:37 PM]
Render states etc are important - make sure that you've:
+ Turned culling off (D3DRS_CULLMODE, D3DCULL_NONE)
+ Turned lighting off (D3DRS_LIGHTING, 0)
+ Got the projection, view and world matrices set up correctly.
+ Got your texture stages set up right.
EDIT :: I basically agree with Drunken Hyena - it sounds like a culling problem.
John B
[edited by - JohnBSmall on April 17, 2002 4:38:37 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement