Devmaster tutorial on SSAO

Short and to the point explanation of SSAO.



http://devmaster.net/posts/shader-effects-screen-space-ambient-occlusion

hehe i didn’t know that @erlend_sh is there on people list, and now i just look and see him there.

@oxplay2 said:
hehe i didn't know that @erlend_sh is there on people list, and now i just look and see him there.
haha, ye I should probably remove that, it's a bit misleading... I just threw myself in there when I was testing the features of the new site and setting up jME's new entry.

@jmaasing thanks for the link. I want to get such an effect:

http://devmaster.net/posts/shader-effects-refraction

@mifth said:
@jmaasing thanks for the link. I want to get such an effect:
http://devmaster.net/posts/shader-effects-refraction

SimpleWater and PostWater has it.
1 Like
@nehon said:
SimpleWater and PostWater has it.


WOW!!! And how to make it? Is there any tut or example?

uh…use the WaterFilter or the water processor…

@nehon said:
uh...use the WaterFilter or the water processor....


I'm trying to modify TestPostWaterLake.java but i cannot turn reflection and color off.

My code:
[java]
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
final WaterFilter water = new WaterFilter(rootNode, lightDir);
// water.setWaterHeight(-20);
water.setUseFoam(false);
water.setUseCaustics(false);
water.setUseSpecular(false);
water.setUseRipples(false);
// water.setDeepWaterColor(new ColorRGBA(0f,0f,0f,0f));
// water.setWaterColor(new ColorRGBA(0f,0f,0f,0f));
water.setWaterTransparency(0.0f);
water.setMaxAmplitude(0.3f);
water.setWaveScale(0.008f);
water.setSpeed(1.5f);
water.setShoreHardness(10.0f);
water.setRefractionConstant(0.5f);
// water.setShininess(0.3f);
// water.setSunScale(1.0f);
// water.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
fpp.addFilter(water);
viewPort.addProcessor(fpp);
[/java]

Screen:
http://i.imgur.com/qlL60.png

Is it possible switch reflection and color of water off?

what do you want to do exactly?

You want limpid water?

Actually the simpleWater has a better refraction scheme that uses the real Fresnel factor

I want the same effect like here: http://devmaster.net/posts/shader-effects-refraction

There is a web-test below…



i’ll try simpleWater too…

oh ok…sorry, i just looked at the picture



Well… i don’t think you can adapt any of the JME solution in the end…

The simple Water can be vertical, but only a plane area… here it’s like a volume effect.

Hmm, heat has can be simulated by a particle system…



On init: Create a offset texture for the particle system, red for x offset and green for y offset.


  1. Render the scene normally.
  2. Render the heat haze particles in a separate viewport with the depth test on and the depthbuffer from your original scene (1). Additive blending would probably work.
  3. Sample the heat offset texture from step 2 and use these values to offset sampling of the main texture.



    Something like this might work…
1 Like
@kwando said:
Hmm, heat has can be simulated by a particle system..

On init: Create a offset texture for the particle system, red for x offset and green for y offset.

1. Render the scene normally.
2. Render the heat haze particles in a separate viewport with the depth test on and the depthbuffer from your original scene (1). Additive blending would probably work.
3. Sample the heat offset texture from step 2 and use these values to offset sampling of the main texture.

Something like this might work...

heheheh you never stop ;)

My water project uses non-flat refractive areas. It works pretty much like simple water. You factor in normals of meshes (or particles if using kwandos approach), and keep in mind that the resolution of the rtt scene should be slightly larger then the regular screen resolution. Otherwise, say you got a refractive object covering the entire 800x600 screen. At the right side the refraction algorithm causes a fragment to get a pixel in position 810, due to the refraction offset. There are plenty of those. If you haven’t made a small buffer by rendering a slightly larger version of the scene, you will get artifacts.

@nehon said:
heheheh you never stop ;)

I take that like a compliment :P