Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  LWJGL water shader demo.  (Read 8788 times)
0 Members and 1 Guest are viewing this topic.
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Posted 2009-08-04 00:05:39 »

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.




My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline lhkbob

JGO Knight


Medals: 32



« Reply #1 - Posted 2009-08-04 17:11:47 »

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.

Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #2 - Posted 2009-08-04 18:22:09 »

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.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SimonH
« Reply #3 - Posted 2009-08-04 18:29:42 »

Oops;
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
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...

People make games and games make people
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #4 - Posted 2009-08-04 18:39:33 »

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.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline lhkbob

JGO Knight


Medals: 32



« Reply #5 - Posted 2009-08-04 20:07:41 »

Much improved, I like it

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 12


Game Engineer


« Reply #6 - Posted 2009-08-04 20:38:27 »

That looks great. It really looks 3D.

See my work:
OTC Software
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #7 - Posted 2009-08-05 11:10:53 »

Cool, thanx guys for all the feedback.

time to get this working in game  Cool


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.


My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline indexunknown

Junior Member





« Reply #8 - Posted 2009-08-05 11:55:37 »

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.
Offline Bonbon-Chan

JGO Coder


Medals: 12



« Reply #9 - Posted 2009-08-05 12:36:17 »

A round 1800 fps :
- GeForce 8800 GT
- Windows Vista 32bit
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #10 - Posted 2009-08-05 13:12:06 »

750fps - Vista 64 bit - nVidia 8600 GT

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline lhkbob

JGO Knight


Medals: 32



« Reply #11 - Posted 2009-08-05 15:42:41 »

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

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #12 - Posted 2009-08-06 04:50:47 »

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

looks nice.

Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #13 - Posted 2009-08-06 07:55:45 »

66fps, Nvidia Quadro NVS 285 Win XP 64bit

Offline Mike

JGO Wizard


Medals: 69
Projects: 2
Exp: 5 years


Java guru wanabee


« Reply #14 - Posted 2009-08-06 12:22:37 »

150fps - NVidia Quadro NVS 110M on Windows XP

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #15 - Posted 2009-08-06 13:48:20 »

if you press "ENTER" it will uncap the vSync, if you would like to know your max frames per second with the shader.
66fps, Nvidia Quadro NVS 285 Win XP 64bit

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

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Epitaph64

Junior Member


Projects: 1



« Reply #16 - Posted 2009-08-09 03:34:58 »

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

Offline Mike

JGO Wizard


Medals: 69
Projects: 2
Exp: 5 years


Java guru wanabee


« Reply #17 - Posted 2009-08-09 12:08:09 »

38 fps on an Intel 82915G running Windows XP

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline JuddMan

Senior Member


Medals: 1


Your Ad Here


« Reply #18 - Posted 2009-08-14 14:38:08 »

2200FPS on ATI HD4850 (CPU is AMD 4600+, windows xp)
Offline Apo
« Reply #19 - Posted 2009-08-14 15:56:33 »

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

Senior Newbie





« Reply #20 - Posted 2009-08-14 16:14:30 »


Oops, I don't think it was happy with my desktop setup, it ran in the lower left corner of a frame that spanned both my monitors.  I assume your demo was dedicated fullscreen?  If anyone else runs a nvidia card dual screen on linux, I'd love to know how did you set up you X11 conf file...

Nice effect man, looks really good.
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #21 - Posted 2009-08-14 18:33:40 »

Mac OS X, Java 1.6.0_13:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
DATA BUFFER INT DETECTED INSTEAD OF BYTE!!!! 
jar:http://users.on.net/~bobjob/demo3.jar!/objViewer/water512.jpg
java.nio.BufferOverflowException
   at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:335)
   at java.nio.ByteBuffer.put(ByteBuffer.java:812)
   at game.loader.image.TextureLoader.loadImage(TextureLoader.java:304)
   at game.loader.image.TextureLoader.loadImage(TextureLoader.java:359)
   at game.loader.image.TextureLoader.load(TextureLoader.java:141)
   at game.loader.image.TextureLoader.loadTexture2D(TextureLoader.java:52)
   at game.loader.image.Texture.loadTexture(Texture.java:133)
   at game.loader.image.Texture.loadTexture(Texture.java:74)
   at game.loader.image.Texture.loadTexture(Texture.java:121)
   at game.loader.image.Texture.loadTexture(Texture.java:50)
   at basicWater.MainGUI.loadResources(MainGUI.java:127)
   at basicWater.MainGUI.<init>(MainGUI.java:43)
   at basicWater.MainGUI.main(MainGUI.java:36)

Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #22 - Posted 2009-08-14 19:33:25 »

Mac OS X, Java 1.6.0_13:

1  
2  
3  
4  
DATA BUFFER INT DETECTED INSTEAD OF BYTE!!!! 
jar:http://users.on.net/~bobjob/demo3.jar!/objViewer/water512.jpg
java.nio.BufferOverflowException
   at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:335)


Macs JRE default behaviour seems to store load images in Integers rather than 4 Bytes. I have tried to fix the problem hopefully it works now.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #23 - Posted 2009-08-14 20:20:05 »

In XP 32bit i'm getting ~3000fps on a Q6600 with sli 8800gtx; though presumably it isn't using both cards.

:edit:

hang on i'll try forcing sli on to see if it makes a difference.....

:edit:

Nope, no difference - except SFR mode that caused it to limit @ ~600fps.

Ok, enough willy waggling  Roll Eyes

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #24 - Posted 2009-08-14 22:00:46 »

I tweeked the program a bit, so there is a decent performance increase.

Sorry to say if you run the program now, yours stats wont be a proper comparison to the other results previous to this post. Just thought Id give you a heads up.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #25 - Posted 2009-08-15 15:29:47 »

74fps on my Acer Aspire One!

Tbh i'm surprised it even ran; for a moment I thought it hadn't, as the window was full of garbage for a few seconds while it was loading.
What looked like the residual contents of either the screen buffer or some textures in vram.
You might want to put an explicit clear in there somewhere, to accomodate shoddy Intel ogl drivers (GMA 945)

Interestingly, vsync did not function correctly, when eneabled the fps was fluctuating at ~61-62fps.
Can't think of an explanation for that behaviour =/

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #26 - Posted 2009-08-15 15:33:57 »

Interestingly, vsync did not function correctly, when eneabled the fps was fluctuating at ~61-62fps.
Can't think of an explanation for that behaviour =/

its possible the video card doesnt support vsync in window mode, ands its falling back on the timer sync method.
edit: Or your desktop frequency is higher than 60hz

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #27 - Posted 2009-08-15 16:03:24 »

Just used GMABooster to up the clock of my graphics chipset to 400mhz (it's underclocked in the AA1 to reduce battery drain & heat output).

In this synthetic test it boosted the fps to ~104fps!
Definitely a gpu-limited test =)

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #28 - Posted 2009-08-21 17:18:55 »

Macs JRE default behaviour seems to store load images in Integers rather than 4 Bytes. I have tried to fix the problem hopefully it works now.

It works now, and looks extremely good Smiley
Offline bobjob

JGO Knight


Medals: 10
Projects: 6


David Aaron Muhar


« Reply #29 - Posted 2009-08-21 20:54:37 »

It works now, and looks extremely good Smiley
sweeeeeeeet!
Iv seen that error before and im so glad i actually found a way to get rid of it.

My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (20 views)
2014-04-15 18:08:23

BurntPizza (16 views)
2014-04-15 03:46:01

UprightPath (29 views)
2014-04-14 17:39:50

UprightPath (14 views)
2014-04-14 17:35:47

Porlus (30 views)
2014-04-14 15:48:38

tom_mai78101 (55 views)
2014-04-10 04:04:31

BurntPizza (112 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!