Jump to content
  • Advertisement
Sign in to follow this  
Naruto-kun

Editing textures in a shader

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

 

Is it possible to write to a texture in a shader? For example i have a texture array of 4 textures, the first 3 have been loaded with images, the 4th is left blank. Now i sample the first 3, perform an alpha blend on them. Is it possible to send the resulting color to the 4th texture?

 

Thanks

JB

Share this post


Link to post
Share on other sites
Advertisement

Im guessing then that the texture must be a render target and it will be filled with the returned values of the shader?

Share this post


Link to post
Share on other sites

Shaders get executed by rendering (drawing) something. For your current problem a so-called full-screen quad is recommended - a quad which covers the whole target area. With D3D10/11 one can even avoid vertices/indices and a input layout altogether by applying the following trick (it's actually a full-screen triangle, but the result is the same).

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!