Skip to main content

History: Simple SSAO

Source of version: 11

Copy to clipboard
            __Simple SSAO__  - A 1-class solution for SSAO.
{TOC()}{TOC}
!!Description
To have SSAO in OGRE usually you need tons of code and shaders, well nullsquared posted a [http://www.ogre3d.org/forums/viewtopic.php?t=42350|demo] that avoided that, and it provided a pretty decent quality, so this is his code, converted into 1 easy to use class, which can provide your application with SSAO with only 1 line of code (2 including the header "include" statement).

See [MOGRE Simple SSAO] for Mogre source code.

!!Download
You can find the full pre-compiled demo + source [https://bitbucket.org/MindCalamity/simplessao/|here].

!!Usage Instructions

1. Add the sub-directories in the 'data/ssao/materials' directory to your resource locations.
2. Derive all your materials from diffuse_template like so:
{CODE(caption="Sample Material - Sibenik")}import diffuse_template from "diffuse.material"
material sibenik/poplocenje : diffuse_template
{
	technique
	{
		pass
		{
			ambient 0 0 0 1
			diffuse 0.65098 0.647059 0.596078 1

			texture_unit
			{
				texture KAMEN320x240.jpg
			}
		}

	}

}{CODE}

The above example uses one of sibenik's (the "church" in the Deferred Shading Demo) materials. (You need to do this for all of the materials you wish to be affected by the SSAO compositor.)
3. Add this to your code:
{CODE(caption="Initializing SimpleSSAO")}PFXSSAO* mSSAO = new PFXSSAO(mWindow, mCamera);{CODE}
Assuming that mWindow is the render window, and mCamera is of course - the camera. (And they're initialized)

That's it! After that, you've got SSAO on your scene.

!!Screenshots
{IMG(src="http://img156.imageshack.us/img156/1976/portalizednossaolt5.jpg",thumb="y",button="y",height="400",width="500",desc="SSAO Off",alt="SSAO Off")}{IMG}{IMG(src="http://img329.imageshack.us/img329/9673/portalizedssaoly3.jpg",thumb="y",button="y",height="400",width="500",desc="SSAO On",alt="SSAO On")}{IMG}
{IMG(src="http://img212.imageshack.us/img212/1651/portalizednossao3cj8.jpg",thumb="y",button="y",height="400",width="500",desc="SSAO Off",alt="SSAO Off")}{IMG}{IMG(src="http://img515.imageshack.us/img515/1889/portalizedssao3rd7.jpg",thumb="y",button="y",height="400",width="500",desc="SSAO On",alt="SSAO On")}{IMG}
{IMG(src="http://img212.imageshack.us/img212/1651/portalizednossao3cj8.jpg",thumb="y",button="y",height="400",width="500",desc="SSAO Off",alt="SSAO Off")}{IMG}{IMG(src="http://img515.imageshack.us/img515/1889/portalizedssao3rd7.jpg",thumb="y",button="y",height="400",width="500",desc="SSAO On",alt="SSAO On")}{IMG}

!!Credits and related Forum topics
[http://www.ogre3d.org/forums/viewtopic.php?f=11&t=68591|SimpleSSAO - 1 Line SSAO]
[http://www.ogre3d.org/forums/viewtopic.php?f=11&t=47927|SSAO (Screen Space Ambient Occlusion) Demo + Source]
[http://www.ogre3d.org/forums/viewtopic.php?f=11&t=47927|SSAO Compositor]

!!See Also
[http://www.craftworkgames.com/blog/implementing-ssao-in-mogre/|Implementing SSAO in Mogre]

        

History

Information Version
Fri 28 of Aug, 2015 08:55 GMT-0000 Mind Calamity Fixed broken link. 12
Sun 13 of Jul, 2014 20:32 GMT-0000 Mind Calamity 11
Tue 21 of Feb, 2012 20:00 GMT-0000 pyritie 10
Mon 06 of Feb, 2012 11:14 GMT-0000 duststorm Added links to related forum topics 9
Mon 06 of Feb, 2012 11:14 GMT-0000 duststorm Added links to related forum topics 8
Mon 06 of Feb, 2012 11:13 GMT-0000 duststorm 7
Thu 02 of Feb, 2012 13:33 GMT-0000 zarfius 6
Tue 31 of Jan, 2012 12:47 GMT-0000 Mind Calamity Updated download link. 5
Wed 25 of Jan, 2012 19:12 GMT-0000 Mind Calamity 4
Wed 25 of Jan, 2012 19:11 GMT-0000 Mind Calamity 3
Wed 25 of Jan, 2012 19:05 GMT-0000 Mind Calamity 2
Wed 25 of Jan, 2012 18:34 GMT-0000 Mind Calamity 1