Sign in to follow this  
Farfadet

glsl write to texture

Recommended Posts

Hi, Is it possible to write to texture memory from a vertex shader ? What I'm trying to do is override the rasterization, which is not programmable. The shader replaces the built-in interpolation function by my own, looks up a texture in texture 1, and writes the resulting pixel colors in texture 2 ; subsequent pipeline functions are simply ignored. I know it's not possible to read and write to the same texture, but in this case there's one texture to read from and another to write to. What I'm looking for is the inverse of the V2 = texture2D(sampler,coord) function.

Share this post


Link to post
Share on other sites
Hmm not sure but maybe with PBO you can? I am guessing here never looked at it.

You could probably use two shaders one that does the calculations and outputs to a 2nd buffer with glFragData[1] and then in the second shader use that data...

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