Jump to content
  • Advertisement
Sign in to follow this  
OrangyTang

OpenGL Screen-space distortion implementation details

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

This thread got me interested in doing screen-space distortion effects in OpenGL. I'm fine on the theory, but actually implementing it in OpenGL leaves me a tad lost. 1. I've got a basic version working with two input textures, the distortion vectors and the actual image. I use the distortion vector to offset the texture coords of the actual image. Thats dead easy to do with GLSL, but is it possible (in some cross-vendor way) to do this for lower spec hardware? 2. I can't figure out how to do proper signed blending to compose multiple distortion maps into the final distortion texture. Is there an extension I'm overlooking? 3. How do people generate/create your distortion sprites/textures to use? So far I've been pre-processing a greyscale image into a distortion map (much like generating a normal map from a heightmap) but is that going to be suitable for everything? Cheers.

Share this post


Link to post
Share on other sites
Advertisement
1) You can do it on GF3 and up using DSDT/DUDV textures. You need NV_TEXTURE_SHADER using OFFSET_TEXTURE_2D as texenv. It's a bit tricky to get it working. I sugest you look at nvidia for old GF3 demos. I'm using this extension for water disortion on GF3/4. I don't know about radeons. For cross vendor, I doubt you can do it.
2) Add signed?
3) I also use heightmaps and then convert them to DSDT or normalmaps.

Share this post


Link to post
Share on other sites
Quote:
Original post by _DarkWIng_
1) You can do it on GF3 and up using DSDT/DUDV textures. You need NV_TEXTURE_SHADER using OFFSET_TEXTURE_2D as texenv. It's a bit tricky to get it working. I sugest you look at nvidia for old GF3 demos. I'm using this extension for water disortion on GF3/4. I don't know about radeons. For cross vendor, I doubt you can do it.

Aye, thats what I suspected. Texture_shader looks totally evil to me, and I'm not really keen to use it if its nvidia only :(.

Quote:
2) Add signed?

Could you give more detail? I'll swear blind that theres a blend mode for signed add, but much googling and searching always turns up texture environment signed-add stuff.
Quote:
3) I also use heightmaps and then convert them to DSDT or normalmaps.

Great, at least I got one thing right. ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
Quote:
2) Add signed?

Could you give more detail? I'll swear blind that theres a blend mode for signed add, but much googling and searching always turns up texture environment signed-add stuff.


I thought the same thing, but it turns out that (at least according to my Red Book anyways) the only add signed there is is indeed todo with texture environment and i dont think any extension exists which adds it to the blend equations either (i'll probably check in a bit, just cba to reach for my extensions book atm [grin])

Share this post


Link to post
Share on other sites
>>Aye, thats what I suspected. Texture_shader looks totally evil to me,<<

it can be done under glsl as well

Share this post


Link to post
Share on other sites
Got any demos or screenshots of your stuff, OrangyTang? I'd be interested to see the results of your tests.

sam.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Nothing to show yet really, until I can figure out how to do this signed blending multiple distortions just overwrite the previous, which looks ugly. :(

Anyone any ideas?

OT.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Anyone?

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!