Jump to content
  • Advertisement
Sign in to follow this  
unforgiven12

DirectX 10 Render to texture.

This topic is 3081 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 all

I am trying to create a texture that moves on a 2d object. E.g. picture a 2d triangle that has a texture on it that changes from blue to red.
Thus I am trying to find out how to render to a standard 2D texture. (DirectX 10)
Does anybody have any examples of this or hints etc that may be helpful????
I have tried many times but can’t seem to get it to work.

Thanks
Unforgiven

Share this post


Link to post
Share on other sites
Advertisement
Create a standard render target with the dimensions you want and create a shader resource view. Bind the render target with OMSetRenderTargets, render your scene, then switch render targets back to your main screen target and you will be able to bind the shader resource view as a standard texture.

Share this post


Link to post
Share on other sites
This isn’t that complicated at all.
1. Create your Texture with CreateTexture2D.
2. Create a shadere resource view for your texture.
3. Create a render target view for this texture
4. For every frame:
a. Use OMSetRenderTargets to switch to your texture render target
b. Render whatever you want.
c. Switch back to the back buffer with OMSetRenderTargets.
d. Use the shader resource view to render the object with our texture.

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!