SSAO Compositor
-
- Gnoblar
- Posts: 11
- Joined: Thu May 12, 2011 10:18 am
Re: SSAO Compositor
The link http://www.nullular.com/files/ssao_demo.7z ins't working. Can somebody upload this demo, please?
-
- Halfling
- Posts: 58
- Joined: Mon May 26, 2008 9:32 pm
- Location: St. Petersburg, Russia
- x 1
Re: SSAO Compositor
I was looking for it and finally found it on one of my old hard drives, so here's REALLY PERMANENT download link - http://sheen.me/ogre/ssao_demo.zip
-
- Gnoblar
- Posts: 11
- Joined: Thu May 12, 2011 10:18 am
Re: SSAO Compositor
Thank you very much Sheen, at last I can see this famous demo running!
- Lee04
- Minaton
- Posts: 945
- Joined: Mon Jul 05, 2004 4:06 pm
- Location: Sweden
- x 1
- lordsme
- Gremlin
- Posts: 167
- Joined: Sun Mar 11, 2007 1:11 pm
- Location: Turin, Italy
- x 10
- Contact:
Re: SSAO Compositor
Hi guys,
I'd like to contribute to this topic posting my solution for objects that have "alpha-rejection materials", such as tree leaves, metal grids, etc.
The idea is to modify SSAO scene geometry shaders in order to discard pixels using the same texture of their base material.
Here's the Cg shader code:
I'd like to contribute to this topic posting my solution for objects that have "alpha-rejection materials", such as tree leaves, metal grids, etc.
The idea is to modify SSAO scene geometry shaders in order to discard pixels using the same texture of their base material.
Here's the Cg shader code:
Code: Select all
void SSAO_SceneGeom_Alpha_Tex_VS
(
in float4 in_uv : TEXCOORD0,
out float2 out_uv : TEXCOORD3,
in float4 p : POSITION,
in float3 n : NORMAL,
out float4 cp : POSITION,
out float4 vp : TEXCOORD0, // view-space position
out float4 vn : TEXCOORD1,
uniform float4x4 wvpMat, uniform float4x4 wvMat
)
{
cp = mul(wvpMat, p);
vp = mul(wvMat, p);
vn = mul(wvMat, float4(n, 0));
// copy UVs for the pixel shader
out_uv = in_uv.xy;
}
float4 SSAO_SceneGeom_Alpha_Tex_PS(
in float4 vp : TEXCOORD0
,in float4 vn : TEXCOORD1
,uniform float far
// ,uniform float coef
,in float2 uv : TEXCOORD3
,uniform sampler2D AlphaSampler : TEXUNIT0
) : COLOR
{
// test alpha
float alpha = tex2D(AlphaSampler,uv).a;
if (alpha < 0.47) // same as OGRE pass directive "alpha_rejection greater 120"
discard;
// a coef should help to tune scenes with different unit scales
float coef = 0.25;
float4 c = float4(length(vp.xyz) * coef / far, normalize(vn.xyz).xyz);
return c;
}
My Portfolio
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
- lordsme
- Gremlin
- Posts: 167
- Joined: Sun Mar 11, 2007 1:11 pm
- Location: Turin, Italy
- x 10
- Contact:
Re: SSAO Compositor
Here are some better screenshots.
The second one features some other fx too (lens flares, bloom, FXAA, gamma, GaussLighten, Vignetting... )
Thanks to tree[d] for quick trees!
The second one features some other fx too (lens flares, bloom, FXAA, gamma, GaussLighten, Vignetting... )
Thanks to tree[d] for quick trees!
My Portfolio
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
http://davidedigiannantonio.weebly.com
MESH - Mise-en-scene Helper
http://www.mesh-project.org/
ASALab @ Virtual Reality & Multimedia Park
http://www.vrmmp.it
-
- Gnoblar
- Posts: 1
- Joined: Fri May 09, 2014 11:15 am
Re: SSAO Compositor
Don't suppose anyone still has a copy of the code for this one? seems all the mirrors are dead
- Mind Calamity
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: SSAO Compositor
I do, and I made a simple to use class a few years ago, you can find it in my signature, but in case I change it in the future, here's a link:TomSmithGR wrote:Don't suppose anyone still has a copy of the code for this one? seems all the mirrors are dead
http://www.ogre3d.org/tikiwiki/Simple+SSAO
The screenshots seem to be down, I'll try to make new ones ASAP.
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
- Jefferian
- Halfling
- Posts: 63
- Joined: Sun Jun 12, 2011 12:53 am
- Location: Italy
- x 1
Re: SSAO Compositor
Uh, not only the screenshot. The download itself is dead as well, actually.Mind Calamity wrote:I do, and I made a simple to use class a few years ago, you can find it in my signature, but in case I change it in the future, here's a link:TomSmithGR wrote:Don't suppose anyone still has a copy of the code for this one? seems all the mirrors are dead
http://www.ogre3d.org/tikiwiki/Simple+SSAO
The screenshots seem to be down, I'll try to make new ones ASAP.
- Mind Calamity
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: SSAO Compositor
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt