PDA

View Full Version : Oceans and water



bracer
30-10-2018, 10:06 AM
Hi guys!

I'm looking for some examples of water/ocean made in pascal and with preferably GLSL-shaders.
I have a hard time making a "simple" reflective water with scrolling normal maps using GLSL...
The reflection can simply be a sky texture.
I'm mainly using Lazarus + GLScene.

Thanks in advance!
/Daniel

SilverWarior
30-10-2018, 08:34 PM
Are you talking here about reflection of things on water surface like reflection of coastline or ships on water surface or are you talking about caustics (subsurface light refraction and reflection) https://en.wikipedia.org/wiki/Caustic_(optics)

bracer
30-10-2018, 09:56 PM
Hi SilverWarrior!

The reflection can for now be a skytexture, with clouds and maybe a sun. So either a simple texture blended in or a cubeMap.
I'm trying to make it like this one:

https://www.youtube.com/watch?v=mbE4QFb1TVU

His Github: https://github.com/ludwigpe/WaterSimulation
But it's neither Pascal or GLSL, so I have a hard time implementing it in GLScene.

Cheers

SilverWarior
31-10-2018, 03:13 PM
Unfortunately I personally don't have much experience with GLScene so I can't help you directly.

But after searching the web a little I found this: http://glscene.pbworks.com/w/page/6437712/TGLWaterplane
This should be a component for GLScene which adds water scene with optional waves so I'm guessing this is what you are essentially looking for. It comes with full source code so I'm guessing it should be enough for you to get started.

bracer
31-10-2018, 03:34 PM
Hi SilverWarrior!

Thanks for the reply!
Yes, I'm familiar with that component.
Unfortunatly it doesn't using scrolling normal maps, but the reflection is cool.

bracer
31-10-2018, 03:35 PM
There is also a waterShader unit, https://sourceforge.net/p/glscene/code/HEAD/tree/branches/GLSceneLCL/Source/Shaders/glslwatershader.pas
But it also does not use normal maps.