Sign in to follow this  
Followers 0
Naruto-kun

Editing textures in a shader

7 posts in this topic

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

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Just to make sure I am not missing anything, how does one "execute" the shader function?

0

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).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0