Jump to content
  • Advertisement
Sign in to follow this  
Farfadet

glsl write to texture

This topic is 4114 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, 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
Advertisement
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!