Jump to content
  • Advertisement
Sign in to follow this  
Rozik

Problem rendering on texture

This topic is 4597 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 guys, i am trying to render one texture onto another texture. i therefore make one texture the rendertarget and then i render the texture with: m_Sprite->Draw(Texture->GetTexture(), Texture->GetRect(), NULL, NULL, color ); up to a certain size of texture it works without a problem but once the texture i want to render gets a certain size it gets scaled to so it doesnt even fit the main texture anymore i have no clue why it would work fine with small textures but not with bigger ones would be grat if anyone had an idea why this could be

Share this post


Link to post
Share on other sites
Advertisement
ok this is really wierd:)

i just tried a few diffrent textures and i found it doesnt even work right with smaller textures. just thought it would cause it wasnt so apearent.

what i found out though is that it only displays the textures in potences of 2

so i can display textures 2x2,4x4,8x8,16x16 and so on

thats why i found out that something is wrong with bigger textures cause when i used a 500x200 texture it would render the texture scaled to 512x256

anyone have an idea how this could happen?

Share this post


Link to post
Share on other sites
How do you load the texture? The D3DX functions all scale the texture up to the next nearest power of 2, and a lot of cards only support textures in powers of 2 anyway. You're best off sticking to power of 2 textures.

Share this post


Link to post
Share on other sites
i load the texture like this:

D3DXCreateTextureFromFileInMemory(m_Device, data, size, &tempTex)

for 3rd things useing textures the power of 2 is not a problem

but atm i am programming a userinterface

isnt there a way to render the texture in its real size
i have the size of the texture loaded with Infofromfile
do i have to scale them all or is there a easy way to get them in their real sizes

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
500x200 is not a binary scaled texture size. The hardware expects textures in a power of 2 size, i think. So 256x512 is the correct size. I know, from the little programming that I have done with games, that a 200x500 texture will be scaled to the next power of two. I am sure that is what is happening to you.

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.

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!