Jump to content
  • Advertisement

Archived

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

mikeyj21

Two questions regarding textures in DX8

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

Hi! This is my first post, so be gentle! Regarding the use of textured quads in directx8... I am using D3DXCreateTextureFromFileEx to load a large bitmap full of textures, from which I texture various quads with sections of the bitmap using texture co-ordinates. I know that there is a powers of two limitation, but does this apply to the source bitmap, the size of the texture I am using from within this, or both? For example, I originally loaded a 1000*1000 .bmp (bearing in mind that this ''parent'' texture is never displayed), which contained a number of 256*64 ''sprites''. I chose the 1000*1000 size because it made mapping the texture co-ords easy, but then it occurred to me that the ''power of two'' rule might not only apply to the ''sprites'', but to the whole ''parent'' texture, and changed it to a 1024*1024 .bmp., but this then makes the texture co-ords awkward. Am I going about this the wrong way? Many thanks in advance, --Mikey--

Share this post


Link to post
Share on other sites
Advertisement
Did you try it with a 1000x1000 texture first? If not try it. If it works its ok, although im not sure but it might not run as effeciently as it would if you used a 1024x1024 texture.

Share this post


Link to post
Share on other sites
I'm not entirley sure but I think newer cards are fine with non-power of 2 sized textures. But to be safe I think it's better to stick to power of 2 sizes. If it makes it easier for you, you can just waste the 24 pixel border

[edited by - tiffany_smith on March 5, 2004 7:09:02 PM]

Share this post


Link to post
Share on other sites
Hi!
I''ve tried it with both 1000*1000, and 1024*1024, and both work. I prefer the former method, because it makes the texture co-ords easier to work with, and I initially assumed that, because the ''parent'' texture was never displayed, then it wouldn''t cause problems. But, after getting some strange artifacting, I switched to the 1024*1024 size. Unfortunately the problem did not go away (and is still haunting me now... I will probably beg for help within the next few days if I can''t solve it!).
I just want to know the established and/or correct way of doing this (or do people load a separate texture for each ''sprite''... that would mean loads!)

Cheers!

Share this post


Link to post
Share on other sites
Hi Again!

I think I''ve solved my own problem... after days of head-scratching, all it took was the very act of posting the question, and a prod in the right direction!
The strange artifacting I referred to earlier was parts of adjacent textures appearing alongside other textures, as if the texture mapping co-ords were incorrect. Well, they were, but I was fooled by my changing the bitmap size from 1000*1000 to 1024*1024, and it not making any difference... what I am pretty sure was happening was that DX was scaling my bitmap to 1024*1024 in the first case, so the problem was the original set of co-ords. They were based on 1000*1000, so when the bitmap was scaled up, then they were ''out'' by a few pixels! All I had to do was divide the texture co-ords of the sprites by 1024 rather than 1000!

Thanks!

--Mikey--

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!