Aquarium effects

Return to General Discussion

Aquarium effects

Postby clcheung » Sat May 02, 2009 9:41 pm

I am developing an aquarium with interactive fishes. I would like to put some good looking effect there.

I have basically the fishes done and would like some environment effects. I plan to put some rocks and the ground with normal maps, some interactive grasses, ...

In particular, I want to put in water shadow effect (any reference ?), water bubble effects (any reference, shall I implement with particles ?), fog like effects (for better depth view).

Any good references, advices, examples you can recommend ?

Thanks in advance.
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby clcheung » Thu May 07, 2009 6:51 am

Well, I have the fishes, animation, simple AI, ready:

http://www.youtube.com/watch?v=_4hCv-CKW5E

I am looking for the water shadow effects (something like Nalu demo from NVidia. Any ideas ? Can the volumetric light effect be used ?
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby rdb » Thu May 07, 2009 7:08 am

I assume you've already looked at http://www.vterrain.org/, which is always the first place to look for such things.
Crytek's presentations are always useful, too. The "Crysis Next Gen Effects" presentation from GDC 2008 is probably useful to you, it discusses some water effects.
rdb
 
Posts: 11223
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby clcheung » Thu May 07, 2009 7:20 am

Thank you very much for the pointers. I have not visited there before. It is great !
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby clcheung » Mon May 11, 2009 6:48 am

simple water caustics and terrain added :
http://www.youtube.com/watch?v=tc6Y5XxlX3M
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby ThomasEgi » Mon May 11, 2009 6:52 am

wheee :D that looks nice.
about the water caustics. how bout using 2 layers of them and move them using uv-offset?

keep up the work :)
User avatar
ThomasEgi
 
Posts: 2163
Joined: Fri Jul 28, 2006 10:43 am
Location: Germany,Koblenz

Postby clcheung » Mon May 11, 2009 7:05 am

ThomasEgi wrote:wheee :D that looks nice.
about the water caustics. how bout using 2 layers of them and move them using uv-offset?

keep up the work :)


that's a good idea ! will try out later ! Thank you !
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby aurilliance » Tue May 12, 2009 8:33 am

Well i was gonna suggest a few things but looks like you've already done them all. 1: A wide FOV will help the effect (already done) 2: Use a particle effect for bubbles i think. and 3: You've already got caustics as well :P
-Aaron
User avatar
aurilliance
 
Posts: 111
Joined: Sun Feb 15, 2009 8:35 am
Location: Brisbane, Australia

Postby clcheung » Tue May 12, 2009 8:58 am

Thank you for your suggestions.

Yes, I am thinking about particles also...and some god rays....and some other sea animals...
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby rdb » Tue May 12, 2009 8:58 am

Volumetric lighting in the water is a must.

I believe the Crysis effects paper covers this too.
rdb
 
Posts: 11223
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Hey

Postby jbskaggs » Sun May 17, 2009 1:20 am

VERY COOL!
As a potential consumer of this product may I ask:
Could you add some plants- I am really in aquariums (have three aquariums in my home) and I enjoy the plants as much as the fish- especially if the fish interact with the plants nibbling etc.

A real virtual aquarium with all the problems of real ones would be a great sim! Mysterious fish deaths, infestations, alien abductions, lethal nitrogen levels, Clown fish with pebbles sabotaging the filter.

Great job

JB SKaggs
That's the last time I use peanut butter nougat for the neuron processors in my robot!

JB Skaggs
User avatar
jbskaggs
 
Posts: 235
Joined: Thu May 07, 2009 11:10 pm
Location: kansas

Postby clcheung » Sun May 17, 2009 4:28 am

I am thinking about modeling jelly fish and other non-fish animals also...

I have not much idea on water plants yet, it sounds a great but difficult subject.
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

hey

Postby jbskaggs » Sun May 17, 2009 4:39 am

Jelly fish are cool! Maybe a rock or submerged boat beam for mystery?

In my real aquarium I have several plants that do not move even in strong current- so wouldnt be any animation to speak of. But your app is nice just as it is.

My tank has snails, skunk loaches, ghost shrimp, red tail sharks, two types tetras, angel fish, glow fish, koolie loach, sucker fish, moss, sword grass, dwarf angel hair grass, mint charlie, duck weed, floating lichen ferns, drift wood and a root tangle. The ghost shrimp are wicked cuz they will hunt in packs and kill and eat slow or dumb fish.

I have two types of light, co2 device, bubbler, power filter, and heater.

When I get stressed I will just sit and watch the world in the glass and let the stress go... I could see you app being the same way. Helping to relax and destress.

BTW I saw your boat and water effects video very nice.

JB
That's the last time I use peanut butter nougat for the neuron processors in my robot!

JB Skaggs
User avatar
jbskaggs
 
Posts: 235
Joined: Thu May 07, 2009 11:10 pm
Location: kansas

Postby clcheung » Sun May 17, 2009 4:45 am

I like aquarium very much also. Do you have any photos of your aquariums ?

The boat and water demos are all in demomaster. You can try it out if your video card is powerful enough.
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

N

Postby jbskaggs » Sun May 17, 2009 5:18 am

Where is the Demomaster?

Never thought of taking a photo of my aquarium. All we use our camera for is filimg our Aikido classes here at the children's home some of which are on youtube. Look for Kame-Do Aikido and you can see us and the kids I work with. ALthough I must be honest I hate the videos with me- cuz I look bizaare with hakama cuz I am Sumo size.)

I will take some pics of my aqaurium soon.

I aspire to make water art like yours one day- Years ago I made a rpg design doc called Bravery, it was a about a goldfish who becomes a dragon based in the japanese legend that Carp if they are brave enough can become dragons. Thus the Japanese Brave Boy day and the Carp flags everywhere.

But I lacked the art skills then to pull it off. Instead I made it a marble game like Zuma but played with dragons.

But maybe in the future I will try again as your app has reinspired me to think bigger. :)

Thanks
JBSKaggs
That's the last time I use peanut butter nougat for the neuron processors in my robot!

JB Skaggs
User avatar
jbskaggs
 
Posts: 235
Joined: Thu May 07, 2009 11:10 pm
Location: kansas

Postby clcheung » Sun May 17, 2009 7:49 am

In fact you don't need art skills to make an aquarium demo. It is pure programming skills.

You can take a look on demomaster here:
http://www.panda3d.org/phpbb2/viewtopic.php?t=5915
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby clcheung » Sat May 23, 2009 3:52 am

pro-rsoft wrote:Volumetric lighting in the water is a must.

I believe the Crysis effects paper covers this too.


I would have tried to add it. I test it on this demo first:
http://picasaweb.google.com.tw/lh/photo ... directlink

It is working well.

Then I test it with the fishes:
http://picasaweb.google.com.tw/lh/photo ... directlink

It seems not the effect I want. I would like to have the ray cast out from the light source (like the first picture). How can I make it / adjust it accordingly ?
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby rdb » Sat May 23, 2009 4:11 am

Well, that's tricky and I render the scene twice to fix that. One renders only the stuff that casts the rays, and theres a commonfilter rendering for that buffer (invoke CommonFilters with that buffer instead of base.win).
The other renders the scene normally. The result from the filter is applied on top of the usual render.

I think I'm adding a trick to use the stencil buffer in 1.7.0 - that will be compatible with ancient GPU's as well.
rdb
 
Posts: 11223
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby clcheung » Sat May 23, 2009 4:52 am

Thank you for the hint. I will try it out then.

How about the rays in (not the water caustics):
http://www.freewebs.com/kenblending/Cor ... ustics.jpg

Any suggestion on how to create this effect ?
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby rdb » Sat May 23, 2009 5:30 am

Trickier, when the water line itself is out of view. Note though that even crysis doesn't have that.

You could use the volumetric lighting for that, but the rays will only be visible when the water line is in view.

Otherwise, you could draw planes in the water with the rays on it - similar like you would do rain.
rdb
 
Posts: 11223
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby clcheung » Mon May 25, 2009 8:53 am

I blend a texture on a transparent card to make the rays instead:

Image

I've also created a low polygon rock. However, I am not able to cast the water caustics on it. I am able to do it on other nodes, but not the rock. The pseudo code is like this:

Code: Select all
        rock = loader.loadModel("models/rock10-2")
        rock.reparentTo(render)
        rock.setPos(0,0,0)
        rock.setScale(5,4,3)
        rock.setHpr(20,0,0)
        rock.setShaderOff()
        self.waterts = TextureStage('water')
        #self.waterts.setMode(TextureStage.MAdd)
        self.waterts.setMode(TextureStage.MBlend)
        self.waterts.setColor(Vec4(0.9, 0.9, 0.9, 1))

        rock.setTexture(self.waterts , texCaustics)


Any ideas ? Thank you !
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby rdb » Mon May 25, 2009 9:08 am

Use TexGen or projected textures.
This link explains a nice tex gen way:
http://www.opengl.org/resources/code/sa ... /caustics/

For objects obscuring the caustics, you'll also want to do a depth render from top with ARB_shadow enabled, that is multiplied by the caustic stage.
rdb
 
Posts: 11223
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

m

Postby jbskaggs » Mon May 25, 2009 4:45 pm

Mind you this is beyond me-

Couldn't you have a translucent overlay over the whole image? And use 2d sprites for shadows under the fish?

That way your fish and the rock both have the light effects? That's how I would do it in 2d animation and I think a similar approach should work in 3d.

But I am just guessing.


JB Skaggs
That's the last time I use peanut butter nougat for the neuron processors in my robot!

JB Skaggs
User avatar
jbskaggs
 
Posts: 235
Joined: Thu May 07, 2009 11:10 pm
Location: kansas

Re: m

Postby clcheung » Tue May 26, 2009 12:40 am

jbskaggs wrote:Mind you this is beyond me-

Couldn't you have a translucent overlay over the whole image? And use 2d sprites for shadows under the fish?

That way your fish and the rock both have the light effects? That's how I would do it in 2d animation and I think a similar approach should work in 3d.

But I am just guessing.


JB Skaggs


Yes, but how to create the translucent overlay ? Do you mean a flat plane ? The emulated rays in the picture above is a flat plane. But on the ground...I am not sure if the effect is good or not....let me try it out.
Last edited by clcheung on Tue May 26, 2009 12:48 am, edited 1 time in total.
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby clcheung » Tue May 26, 2009 12:47 am

pro-rsoft wrote:Use TexGen or projected textures.
This link explains a nice tex gen way:
http://www.opengl.org/resources/code/sa ... /caustics/

For objects obscuring the caustics, you'll also want to do a depth render from top with ARB_shadow enabled, that is multiplied by the caustic stage.


Do you mean calling setTexGen with TexGenAttrib.MWorldPosition ?

I add:
texturestage.setSort
rock.setTexGen
rock.setTexScale

I get the caustics now. I want to share the water caustics texture but it is too bright on a rock. I am using TextureStage.MBlend / TextureStage.MAdd to blend the caustics to the ground and rock. Without writing a shader, it looks like I can't control too much the blending result....I have to modify the caustics texture for the rock to get a more acceptable appearance.
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

h

Postby jbskaggs » Tue May 26, 2009 12:55 am

But wouldn't the light be brighter on the rock because it is a darker color? On the other hand lava rock would also make the light appear fuzzy or more diffuse, with less defined edges.

Sometimes the effect may not look correct but in reality it may match what we see in nature more closely.

BTW have you been to Nvidia's examples on caustics and shaders?

JB Skaggs
That's the last time I use peanut butter nougat for the neuron processors in my robot!

JB Skaggs
User avatar
jbskaggs
 
Posts: 235
Joined: Thu May 07, 2009 11:10 pm
Location: kansas

Postby clcheung » Tue May 26, 2009 1:19 am

I believe a dark object will not become white even if a strong light is cast on it. A rock is less reflective than the sand ground, so a simple blending on top looks strange.

I have only tried "Nalu" demo. Do you know other good water caustics demos ?
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Postby rdb » Tue May 26, 2009 2:16 am

clcheung wrote:I get the caustics now. I want to share the water caustics texture but it is too bright on a rock. I am using TextureStage.MBlend / TextureStage.MAdd to blend the caustics to the ground and rock. Without writing a shader, it looks like I can't control too much the blending result....I have to modify the caustics texture for the rock to get a more acceptable appearance.

If you want more control, try CMInterpolate combine mode.

Otherwise, I think MModulate will make the most sense - then just adjust the range of the greyscale values in the texture with GIMP or so.
rdb
 
Posts: 11223
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

o

Postby jbskaggs » Tue May 26, 2009 2:58 am

I didnt know it turned white! I thought you meant it wasn't diffusing properly.

JB Skaggs
That's the last time I use peanut butter nougat for the neuron processors in my robot!

JB Skaggs
User avatar
jbskaggs
 
Posts: 235
Joined: Thu May 07, 2009 11:10 pm
Location: kansas

Postby clcheung » Thu May 28, 2009 7:23 am

Some rocks and a plant added !
Image

Now need some other animals...sea horses, jelly fish, more plants....and a shader to move the plants.
User avatar
clcheung
 
Posts: 574
Joined: Wed Jan 21, 2009 7:23 am

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests