LWJGL water shader demo.

I havnt posted anythiing in a while so heres something i have been working on:

Water Shader Demo

Controls.
Light Source: w,s,a,d,q,e
Spin: spacebar
plane size: y,u,h,j,i,o,k,l

Debugging:
Disable VSync: enter
height size (decrease, reset, increase): Numpad1, Numpad2, Numpad3
normal size (decrease, reset, increase): Numpad4, Numpad5, Numpad6

There is still room for alot of improvement. I havnt made support for reflections or specular. But i think this is decent enough for an RTS.


http://users.on.net/~bobjob/water_shader.jpg

The lighting looks realistic and the water really reminds me of a lake during a cloudy day. I think the one thing to improve is that it looks funny having the waves be much larger than the base water texture.

I changed the diffuse texture, to more of an ocean texture.

if you place the light higher in the sky, it should look more like a day time scene.

Oops;

Texture Units available = 2
line 7, column 35:  error: invalid texture coordinate reference
line 20, column 21:  error: invalid texture coordinate reference
line 21, column 21:  error: invalid texture coordinate reference
line 22, column 21:  error: invalid texture coordinate reference
line 23, column 21:  error: invalid texture coordinate reference
line 33, column 21:  error: invalid texture coordinate reference
line 37, column 21:  error: invalid texture coordinate reference

line 1, column 1:  error: program type not supported on this hardware

line 1, column 1:  error: program type not supported on this hardware

org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
	at org.lwjgl.opengl.Util.checkGLError(Util.java:54)
	at org.lwjgl.opengl.Display.swapBuffers(Display.java:640)
	at org.lwjgl.opengl.Display.update(Display.java:660)
	at basicWater.MainGUI.<init>(MainGUI.java:40)
	at basicWater.MainGUI.main(MainGUI.java:31)

I only got a crappy MMX card so it’s no real surprise…

yeah sry, it uses shaders, and a few textures in one pass.

seems like your hardware can only handle two textures when multi-texturing.

As its just a demo, I didnt make a low quality version.

I should have put specs in the original post.

Much improved, I like it

That looks great. It really looks 3D.

Cool, thanx guys for all the feedback.

time to get this working in game 8)

I also put in some more error handling, checks if your card can support the demo
also,
if you press “ENTER” it will uncap the vSync, if you would like to know your max frames per second with the shader.

500 fps on ati hd 3650 , 512mb 8x agp , not even pci-express, i think all java 3d games should include advanced shader and mapping techniques to show that it isn’t that slow compared to cpp as the impression generally is.

A round 1800 fps :

  • GeForce 8800 GT
  • Windows Vista 32bit

750fps - Vista 64 bit - nVidia 8600 GT

1100 fps, Nvidia 8600 MT (Mac Pro OS X 10.5.7)

2400 fps. nVidia GTS 250, Core i7, Windows 7 64 bit

looks nice.

66fps, Nvidia Quadro NVS 285 Win XP 64bit

150fps - NVidia Quadro NVS 110M on Windows XP

Did you press enter? I got 66.666667 fps with vSync.

Wow, 2200 fps steady on 1.8 ghz single core AMD 3000+ and 8800GTS 320 mb

38 fps on an Intel 82915G running Windows XP

2200FPS on ATI HD4850 (CPU is AMD 4600+, windows xp)

450 fps on my laptop (Duo T8300, GeForce9500M GS, Windows Vista)