Sign in to follow this  
Farfadet

glsl write to texture

Recommended Posts

Farfadet    175
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
Farfadet    175
Yes, ot to a P-buffer, but my problem is that the rasterization will always be done with the built-in function, and I don't want that. Thanks anyhow.

Share this post


Link to post
Share on other sites
MARS_999    1627
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
V-man    813
The answer is simple : no

You can only write from a fs and it would have to be to a FBO
Forget about p-buffers. Why use them when FBO is better?

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