Jump to content
  • Advertisement
Sign in to follow this  
steve coward

How can one sprite texture content affect another?

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

I am experiencing a dx9 graphics bug that I am unable to locate. The bug causes spurious images to be displayed for some of the sprites in my 2D game under certain circumstances. Instead of a tank being displayed, some random rectangular portion of a texture in memory will be displayed in its place. I have noticed that when I disable fog of war, the problem disappears (or at least is much, much less prevalent.) When I enable fog of war but use a blank texture tile (all pixels erased within PaintShop) for the fog, the problem also disappears. Or if I add a few random pixels of color, the problem still disappears. But add too many and the problem reappears. At first I thought my problem was either a buffer overrun or a timing/synchronization issue, but now I am not so sure. So my question is : How can the contents of one sprite affect other sprites? Regardless of the content of a texture, the contents of my vertex buffers and all other graphics data structures must be the same in each case (i.e. same u, v, x, y, z, texture references, same polygon ordering, same number of DrawPrimitive() calls, etc.), right? Any comments would be greatly appreciated.

Share this post

Link to post
Share on other sites
Whenever I got a similar problem I most often enabled texturing without assigning a texture. Do you want to render your fog of war without texturing ? In this case it could be possible that you forget to disable texturing and the according texture units ? The same problem occurs if you are using multitexturing.

A debugging hint:
Just before rendering your fog of war, sprites ... disable texturing and all texture-units, then enable only the texture units you need and texturing(or leave it disabled if you wanted to draw a blank tile).


Share this post

Link to post
Share on other sites
I am not extremely knowledgable about advanced 3d rendering concepts.
My app is 2d. Mostly I just read in graphics from png files and then
emit these graphics (or rectangular portions of them)
as part of the scene I am rendering. So I do
not think I am doing texturing. Maybe I should not have used the word texture
in my initial post. Or maybe I am not understanding.
The only render states that I change in drawing my scenes involve
transparency. Is there a render state to enable texturing?

I have not posted code from my app because it would require the
posting of a large number of lines of code and I did not
think that people would take the time to dig into it.

I could give a summary of how it operates if that would be useful.

Just posting the draw member function of a tank unit would not give
insight into the functioning of my graphics engine/game loop. It would
consist of calls to DrawString(), DrawLine(), DrawSprite(), etc. functions.
The important point is that the tank draw function does not
know anything about the fog of war. The sprites that it renders are
separate from the sprites for the fog of war.

I am hoping that an experienced graphics programmer can give me insight
into how adding pixels (within Paintshop outside of the running of the app)
on one sprite could affect the display of another sprite when the app
is running.


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!