Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  3D swimming pool  (Read 3353 times)
0 Members and 1 Guest are viewing this topic.
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Posted 2013-05-21 01:27:14 »

Not actually a game at this stage, I initially started working on this project to try out some environment mapping algorithm, but I ended up modelling a whole swimming pool.  (i am a big fan of swimming Cheesy)


Here is a video walkthrough:
<a href="http://www.youtube.com/v/K-kBcmXgAy0?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/K-kBcmXgAy0?version=3&amp;hl=en_US&amp;start=</a>

Some "advanced" features I have tried for this demo are,

* reflective environment mapping
* volumetric fog
* Light mapped surface
* image based occlusion culling.

Feel free to try the applet demo by clicking on the following link:

http://www.freewebs.com/phu004/swimmingPool.html

Controls are simple: "w a s d" for movement, arrow keys for changing view directions.  If you are interested in the source code, you can grab it
from http://www.freewebs.com/phu004/SwimmingPool.jar.  



Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #1 - Posted 2013-05-21 06:15:37 »

Some anti-aliasing would go a long way. Smiley

Nice work.

Offline EgonOlsen
« Reply #2 - Posted 2013-05-21 07:22:27 »

...doesn't work with Java 6 (here at work... Wink):

1  
java.lang.UnsupportedClassVersionError: main : Unsupported major.minor version 51.0

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #3 - Posted 2013-05-21 08:04:16 »

Looks nice, antialiasing would be good like HeroesGrave said.
Gonna make a fps swimming game? Wink
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #4 - Posted 2013-05-21 09:49:24 »

...doesn't work with Java 6 (here at work... Wink):

1  
java.lang.UnsupportedClassVersionError: main : Unsupported major.minor version 51.0


The applet was compiled with jdk7...  I have recompiled it with jdk5 so it should work for your system.  Damn why i am always under the impression that people either don't have java or have the latest version installed Huh  

Some anti-aliasing would go a long way. Smiley

Nice work.

Thanks for the nice word Smiley    I already used mipmap to minimize the aliasing within the texture, I have never done antialiasing  on the edges, I am under the impression that it can really kill your framerate.  You probably noticed a lot of seam popping up between textures, that's caused by T-junctions, (i.e adjacent polygons that don't share the same edge).  I realized that half way through making the demo... it really makes the aliasing look a lot worse.

Looks nice, antialiasing would be good like HeroesGrave said.
Gonna make a fps swimming game? Wink

Short answer is No:(,  currently my renderer can't import 3d models from files, all the geometry you see in the demo is hard coded in the java files. I probably use existing APIs if I ever decide to make a FPS game.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 743
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2013-05-21 16:30:52 »

Without an image in the first message, your project won't get the exposure of the sidebar.

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

Senior Newbie





« Reply #6 - Posted 2013-05-21 16:44:23 »

I like the lights on the wooden panels. They look very realistic.
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #7 - Posted 2013-05-22 02:11:21 »

Without an image in the first message, your project won't get the exposure of the sidebar.

opps, thanks for reminding me about that  Cheesy

I like the lights on the wooden panels. They look very realistic.

Glad you liked it  Cheesy The lightmap is generated with gimp, I simply blend it with the wood texture at run time. Very cheap effect at the cost of some additional memory for storing the lightmap.

Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #8 - Posted 2013-05-26 11:14:20 »

I have been trying to find a way to create anti aliased edges for my pool over the weekend. This thing is harder than i thought  Cry

What I tried first is applying a 3 x 3 box filter to the pixels that are on the edges of visible polygons, it created somewhat smoothed edges,  but the area where edges interests got over blurred and looks like they are out of focus.

Then I tried to apply the filter to all the pixels on the screen, it created an overall smoothed image.  Although that's not real anti aliasing, and it slows the performance quite a bit, I think it looks better than the unfiltered image. I have updated the applet, you can press "b" to enable/disable the filter.

Eventually I will have to go with the option I tried at the beginning.  I will need to make a better filter (maybe assign weight to neighbor pixels based on the distance to the center pixel) and make sure the same pixel  is processed exactly once by the filter.

By the way I have a question for EgonOlsen if you see this post Grin in your quake applet (http://www.jpct.net/quapplet/), What technique do you use for the anti aliasing?  I noticed the it looks really good when AA option is set to 3, were you using supersampling?


Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #9 - Posted 2013-06-01 05:20:30 »

Ok, I made some improvement to the anti-aliasing algorithm, now it only blurs the pixels which brightness changes sharply on either vertical or horizontal direction. This approach preserves image quality and smooth edges at the same time.   Also anti aliasing is now done on  a separate thread than
main thread, so it should run faster on the machines with multiple cores.

A screenshot taken at the same angle as the image in the opening post:
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline EgonOlsen
« Reply #10 - Posted 2013-06-01 08:31:07 »

Yes, jPCT uses supersampling. It supports 1.5*1.5 and 2.0*2.0 supersampling.

Offline Tim Spekler
« Reply #11 - Posted 2013-06-01 10:37:24 »

Nice graphics you have here! Yet, how can you process the antialiasing on a different thread? Isn't this performed on GPU side using a shader?? (bluring on CPU side would be time-consuming)
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #12 - Posted 2013-06-01 14:14:24 »

Quote
Insert Quote
Yes, jPCT uses supersampling. It supports 1.5*1.5 and 2.0*2.0 supersampling.

Thanks for the clarification, no wonder it looks decent  Smiley

Quote
Nice graphics you have here! Yet, how can you process the antialiasing on a different thread? Isn't this performed on GPU side using a shader?? (bluring on CPU side would be time-consuming)

The AA method I deployed does not depend on the geometry of the scene. Thus can be run in parallel with the rest of rasterization code. Perhaps it can be best explained by the pseudocode of the my gameloop:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
while(true){
update game geometry then draw it to screenbuffer1;

while(AA thread is not idle){
mainThread.sleep(1);
}
wake the AA thread, and let it perform AA operations on screenbuffer1;  

send screenbuffer2 to video memory and call paint();
swap content of screenbuffer1 with the content of screenbuffer2;
mainThead.sleep(some milliseconds); //for maintaining steady  frame rate.
}


Although CPUs are not optimized for doing graphic calculations, you can always try to utilize all the available cores to match the speed of a GPU.

Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #13 - Posted 2013-06-01 15:10:51 »

Needs some swimsuit girls.

Pages: [1]
  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.

pw (35 views)
2014-07-24 01:59:36

Riven (33 views)
2014-07-23 21:16:32

Riven (21 views)
2014-07-23 21:07:15

Riven (24 views)
2014-07-23 20:56:16

ctomni231 (55 views)
2014-07-18 06:55:21

Zero Volt (47 views)
2014-07-17 23:47:54

danieldean (38 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!