Jump to content
  • Advertisement

Archived

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

Seedload

CopySurfaceToTexture

This topic is 6344 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 pretty new to direct3d. I have modified one of the sample programs to render a landscape that I create from a heightmap read from a bitmap file. OK... simple enough. Now I want to texture the landscape with other than one texture. My problem is that my landscape is huge and I don''t believe there is enough memory in the world to store a series of textures that would cover the entire landscape. My thought is this: I will render the textures for the landscape in realtime. I want to create a surface and render a base texture, then render transparent terrain features over the base texture to create a unique texture for that area of the landscape. Then I want to call copysurfacetotexture and use the resulting texture to render my mesh. With a small set of base textures and a pretty small set of overlay textures, I can create lots of different looks using this strategy. Before I go forward, I was hoping that people might point out the faults in my plan. Thanks, Seedload

Share this post


Link to post
Share on other sites
Advertisement
Hi Seedload,

if you''re trying to acheive this with DX8 you can do the following.

From your D3D texture,
use getsurfacelevel to get a surface interface from your D3D texture.
Then you can use D3DXloadsurfacefromsurface to copy from a scr rect to a dest rect.

your destrect is actually you D3Dtexture.

This way you can have a surface with many 128x128 blocks on it and just copy what you need to your D3Dtexture.

Hope this helps,

ps: if this is using DX7, it''s been a while, i would have to look it up

good luck,

Gunner.

Share this post


Link to post
Share on other sites
yes... that helps. But I can''t use blending,alpha channels, transparency, etc. when copying a rect from one surface to another, correct?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!