Jump to content
  • Advertisement

Archived

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

Cebu

ID3DXSprite and Texture issues in 8.1

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

Hey guys. I have an issue in a 2D tile engine with my textures. DX will tag on an extra line in some directions, which gives a very undesirable affect. I have already done a search on the topic and found a few articles on the subject. The obvious culprit here is filtering causing the texture to blend in with it''s surroundings (the "texture" is grabbed from a large image with many tile images). The solutions I have seen to this problem are as follows: 1) Use POINT filtering. 2) Offset the texture corners by -.5 3) Turn on clamping. 4) Repeat the borders in the texture file one time. There may be other solutions... I can''t remember. Anyways, I''ve tried all of these things, and only one thing seems to work, and that''s switching to POINT filtering after Sprit->Begin is called. Obviously this isn''t a very appealing work-around. I can''t offset the corners because I''m using ID3DSprite, which accepts a RECT, which contains longs, not floats. Repeating the borders in the textures is just too much of a hack for me to want to try, though I suppose if it''s the only choice to get real filtering, I may have to. The thing that seems like it would be the real solution in all this is turning on clamping in SetTextureStage. This seems to solve people''s problems real well, and doesn''t have any bad side-affects. Problem is, it doesn''t seem to be working for me. The people that it does seem to work for are using DX 7.0 I think, by looking at the function parameters they are using. In 8.1, I am attempting to turn on clamping like this: d3ddevice->SetTextureStageState(0, D3DTSS_ADDRESSU ,D3DTADDRESS_CLAMP); d3ddevice->SetTextureStageState(0, D3DTSS_ADDRESSV ,D3DTADDRESS_CLAMP); d3ddevice->SetTextureStageState(0, D3DTSS_ADDRESSW ,D3DTADDRESS_CLAMP); // Don''t think I need this, just trying to be thorough Again, this does nothing.. only using POINT filtering helps. Any help at all would be greatly appreciated. Sorry for the long post, I just like to be thorough the first time around. -Cebu

Share this post


Link to post
Share on other sites
Advertisement
Since no one has responded am I to assume that DirectX is just buggy? Seems pretty pointless to provide a 2D wrapper if it''s going to show "ghost" lines everywhere that won''t go away unless you use the worst possible filtering.

Oh well, I guess it''s time to write my own blitter or try tagging on some lines in in texture files.

Share this post


Link to post
Share on other sites

  • 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!