Screen-space distortion implementation details

Started by
6 comments, last by GameDev.net 19 years, 5 months ago
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.
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.
You should never let your fears become the boundaries of your dreams.
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. ;)
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])
>>Aye, thats what I suspected. Texture_shader looks totally evil to me,<<

it can be done under glsl as well
Got any demos or screenshots of your stuff, OrangyTang? I'd be interested to see the results of your tests.

sam.
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.
Anyone?

This topic is closed to new replies.

Advertisement