Water distortion

Blitz3D Forums/Blitz3D Programming/Water distortion

Neo Genesis10(Posted 2003) [#1]
A *very* advanced topic this one. What I'd like is for a distorted effect for objects below a water mesh but I would also include parts of objects in that (example, a player's feet are below water level). I'm looking for effects similar to Phatasy Star Online's (anyone who's seen the Seabed Control Center knows what I mean).

I'm guessing either raytracing or read/writepixelfast. Neither of which would appear terribly fast.


Rob(Posted 2003) [#2]
cubemapping is what you need. You can use it for deflection too. apply it to some water of yours and play with the directions...


Neo Genesis10(Posted 2003) [#3]
Ooo... new feature. Didnt have the latest version (still using 1.83). I'm gonna have a play.


Neo Genesis10(Posted 2003) [#4]
Okay. I think I get the general gist of what CAN be done using CubeMaps... but I'm still hazy on HOW they work and more importantly how you're supposed to get a reflection or distortion with that.

Example: What textures are you supposed to use? Im leaping to conclusions here, but I'm guessing the CubeMap isnt a copy of the environment otherwise dynamic reflections would be impossible (and therefore distortions of moving entities would also be). What are the textures applied to (if any at all). If not, when do you use SetCubeFace etcetera. I could go on for ages, but it would be nice if someone but this seemingly complicated subject into kindergarten lingo for me.


_PJ_(Posted 2003) [#5]



Neo Genesis10(Posted 2003) [#6]
Great stuff. Thanks Malice. Now here's another problem for ya. Lets assume I have a nice terrain (for arguments sake, we'll say its a mesh rather than a LOD). Add a nice plane over the top of this object (again, a mesh). Now place a camera underneath the water plane.

The results were somewhat unexpected. I tried rectifying this by moving the water-rendering camera directly beneath the world camera - no difference.

Also I would like to have water distortion. Not just a bending effect, but a ripple effect (the bending as a result of cubemapping adds a nice bonus though) for objects behind it.

Tall order, but then you're all so bright ^_^

Oh yeah... and how does Blitz know which camera the cubemapped texture is being viewed from?


_PJ_(Posted 2003) [#7]

Neo Genesis10 (Posted 38 minutes ago)




I haven't had a chance to play with cubemapping much yet, and I am not sure what the effect you describe is, or how it differs from what you want. There was something in the code archives I'm certain for creating an underwater effect as a result of CameraZoom I think.

Also I would like to have water distortion. Not just a bending effect, but a ripple effect (the bending as a result of cubemapping adds a nice bonus though) for objects behind it.



I haven't had a chance to play with cubemapping much yet, and I am not sure what the effect you describe is, or how it differs from what you want. There was something in the code archives I'm certain for creating an underwater effect as a result of CameraZoom I think.


Oh yeah... and how does Blitz know which camera the cubemapped texture is being viewed from?



...? I dunno, how does Blitz know which camera the cubemapped texture is being viewed from?

;)


ckob(Posted 2003) [#8]
i believe u can set that option


DarkEagle(Posted 2003) [#9]
the same way it knows which camera all other entities are being viewed from - if it didnt, entityies would appear with the wrong perspective and orientation!


Neo Genesis10(Posted 2003) [#10]
I haven't had a chance to play with cubemapping much yet, and I am not sure what the effect you describe is, or how it differs from what you want.
Not exactly what I was looking for. Imagine its raining heavily. Think about what visual effect the ripples of a puddle would have on the ground below it. The ground would seem to move. It is this kind of distortion I would like, but heavily broken rather than bent ala cubemapping.

(by the way, I've got the hand of this cubemap malarky now and although pretty its not always easy to get the desired effect).


podperson(Posted 2003) [#11]
The classic water distortion effect is a result of pixel shading (you can see demos of it using early pixel shaders in 3DMark 2001 SE -- very nice demo showing fish swimming around a boat and pier -- and more advanced implementations in 3DMark 3003).

I'm very hazy on how cube mapping will help with distorting what you see THROUGH water -- as far as I can tell it only helps you provide a nice reflection on the surface of the water. Maybe there's a neat trick I'm unaware of.

AFAIK, to produce really stunning water you really want (a) pixel shading to do specular effects and distortion, and (b) cube mapping to do reflections. (Again, see the demos in 3D Mark 2001/2003.)


Neo Genesis10(Posted 2003) [#12]
I'm very hazy on how cube mapping will help with distorting what you see THROUGH water
Err... that was my point. Cubemapping is great for reflections - pixel perfect in fact. But I was after distortions. Is there any way to use pixel shaders in Blitz3D (via DLL imports or whatever)?