Ocean-Shader from OGRE succesfully adapted to GE

It uses an environment map instead of render to texture. Looks pretty much like the Original.
If you plan to adapt other shaders from OGRE, take care of the swapped Y and Z axis. I hope you like it and can use it in your projects.
Play a bit with the uniform parameters to change or improve the look. If you achieve a further improvement please post your version in this thread.
You can turn and move with the cursor keys

http://blendpolis.de/f/download.php?id=28917

http://blendpolis.de/f/viewtopic.php?t=13446&highlight=

Penguin, you are simply amazing.

If it was allowed I would swear the crap out of this forum… Censored overjoy scream

Is it possible to synch the height of an object with the waves?

3D-Penguin
Thank’s for this thread this is just amzing I know for a fact that this is going to be very helpfull indeed for my current project. :cool:

Keep up the great work :stuck_out_tongue:

AND REMEMBER KEEP ON BLENDERING BLENDER ARTISTS !!! :cool:

Wow!

If I hadn’t seen it, I wouldn’t have believed it.

wow!

very cool, thank you for this :slight_smile:

Wow! Incredible!

Thank you very much.

Does the download has the same setup of your screenshot?

Thanks a lot for your very motivating feedback.

Is it possible to synch the height of an object with the waves?
This depends imho on the ability of GE sensor to react on shader-displaced vertices.I didn’t try yet, good question.

Does the download has the same setup of your screenshot?
Exactly. I was only turning albeit to the side.

wow, VERY cool, i’ll have fun playing around with this you are the man… penguin!

If we only had render to texture… nevertheless the shader looks amazingly good :cool:

I made a python script which continually reads vertex position. As I expected, the GE thinks the vertex stays stationary. I believe it is because the shader is applied after GE has already finished drawing a frame. So at least that method can’t be used to synch an object to the waves :frowning:

That means that the “get hit object” function won’t work either, doesn’t it? :frowning:

wow!
I was just playing with this again… I rotated the view a bit and ran the scene… some very neat effects with the colors.

not much of a CPU hit either.

this is a great thing to have :slight_smile: thanks again for this

Neat! This looks really nice in realtime. 3D-Penguin you are the shader guru man! This and all your other shaders are awesome.

Hope to see more soon = )

Indeed this is cool…thanks…

looks amazing, good work.

@3d-penguin…SWEET! So are you using vertex displacement… bump mapping and cube reflection map??.. or are you just moving the wave with an equation… looks very cool… been meaning to start playing with vertex displacement…

edit: Just looked at the file… and it’s not using displacement(only works on nvidia cards anyway)

a cool link to an article about using vertex displacement for oceans… dunno if you’ve seen it?:eyebrowlift2:
http://www.gamasutra.com/features/20060103/kryachko_01.shtml

Do you know how to add in the fog info from blender into the shaders…? it is possible… just not to sure how to do that yet… it would be the next step on making the shader look even more styling!..

I’m just messing with the file… dropping in a different a cube map sky that will be relfected plus controlling the speed through blender… seeing as a there are a lot of uniforms delcared it pretty easy to hool them into blender…:cool: nice work

go to bed for 14 hours and you miss all kinds of good stuff.

I made a python script which continually reads vertex position. As I expected, the GE thinks the vertex stays stationary. I believe it is because the shader is applied after GE has already finished drawing a frame. So at least that method can’t be used to synch an object to the waves

At the framerate the shader runs i thought it might be possible to use the vertex position from the previous frame (error < 3%) . But if they seem to stay stationary… no good, too bad.

Do you know how to add in the fog info from blender into the shaders…?

Not yet, i put it on my list. Good idea.

here’s a quick mod I did for the file… screen shot below… you can change the speed of the wave by pressing + and - on the keypad and you can change the wave frequency using [ ] keys… I will host it in a sec if anyones interesed?savefile is giving me grief… plus I gotta compress the textures… Kinda high jacking your thread??

It uses the same textures for the sky box as it does for the cubemap relflection…:eyebrowlift2: now a nice sun… some fog… moving clouds… animated sun beams… um high based foam… heh heh and it will be perfecto!:eek:

link to file:
http://savefile.com/files/677188

edit: you could use the extra slot for a foam map blended over the existing shader based on hieght>>??

http://img182.imageshack.us/img182/6765/oceanimageuh7.th.jpg

I will host it in a sec if anyones interesed?savefile is giving me grief… plus I gotta compress the textures… Kinda high jacking your thread??

You could host it on www.mihd.net. And thanks for your contribution, you (or other) will not be “hijacking” the thread. On the contrary, cause i was asking expressively for improvements. Please continue.

Hmm, the shader leaves one texture unit free. It should be possible to add an alphamap to adjust the transparency in gl_fragcolor. gl_fragcolor is a vec4 with rgba as content where the a controls the intensity/ transparency. Or what else should we do with the free texture unit?