Deferred Shading plugin - need help and testing

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Deferred Shading plugin - need help and testing

Post by jonim8or »

I've converted the Deferred Shading sample into a plugin. The usage is quite easy:
0) load the plugin
1) add every scenemanager that you want to use deferred shading with to the DeferredShadingManager singleton. (often that is only one, I guess...)

Code: Select all

DeferredShadingManager::getSingleton().addSceneManager(mSceneMgr);
2) create a DeferredShading object for every Viewport that you want to use deferred shading with.

Code: Select all

DeferredShadingSystem* mSystem = new DeferredShadingSystem(mWindow->getViewport(0), mCamera);
... use the system ...
n-1) delete the DeferredShadingSystems.
n) unregister the scenemanager with the DeferredShadingManager.

I created it using OGRE_STATIC (as that is whay I use for my project). To make it also available for dynamic builds I tried to apply all the _declspec-like and CMAKE code that is used for the other plugins, but when I try to build the deferred shading sample, it gives 10 unresolved externals (all referring to functions from my plugin). So probably something is going wrong, but I'm clueless what, because static linking works fine.

I've also only tested the patch on Windows XP (openGL). I need testers to test it on the other platforms.
You do not have the required permissions to view the files attached to this post.
User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
x 218

Re: Deferred Shading plugin - need help and testing

Post by Jabberwocky »

I'm already firmly committed to a forward rendering pipeline, but if this is robust and works as simply as you say, it sounds like an awesome plugin.
Image
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Re: Deferred Shading plugin - need help and testing

Post by Wolfmanfx »

Can u describe what the plugin does? Did you converted nomans sample 1:1 as plugin? How does it generate the materials?
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

Wolfmanfx wrote:Can u describe what the plugin does? Did you converted nomans sample 1:1 as plugin? How does it generate the materials?
you are right, it is a 1:1 conversion from nomans example.
And I added support for alpha-rejection (so that trees and chicken-wire fences are now casting correct shadows).

For every material that doesn't have a GBuffer technique itself (which is what the deferred shading system assumes), it generates a material.
If a material's pass uses alpha-rejection, two materials are generated instead of one: a shadow caster material and a GBuffer material.

I'm still testing it myself a lot (yesterday I found there's a bug when using multiple windows, but will add a patch for that soon), and I'm adding features that I need myself (and that others will probably also like).
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

New version, also works with Dynamic linking (previous version didn't)
The patch zip contains full patch (since I started working on the plugin)

It also accidently fixed the bug I saw in this post where the debug and release demo looked differently.
You do not have the required permissions to view the files attached to this post.
User avatar
Lee04
Minaton
Posts: 945
Joined: Mon Jul 05, 2004 4:06 pm
Location: Sweden
x 1

Re: Deferred Shading plugin - need help and testing

Post by Lee04 »

Super good work!

I had this idea that Ogre would support both forward and deferred rendering just as it support OpenGl/DirectX and with the new sample framework and your plug-in I see this is very close to be true.
Ph.D. student in game development
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

Here's a small update. Haven't changed much since last time, but I added an example of a texture with transparency, whose shadows are cast using alpha-rejection.
sibenik.jpg
Usage of the plugin:

Code: Select all

DeferredShadingManager::getSingleton().addSceneManager(mSceneMgr);
mSystem = new DeferredShadingSystem(mWindow->getViewport(0), mCamera);
mSystem->initialize();
You do not have the required permissions to view the files attached to this post.
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

Another update, just to keep compatible with trunk.
You do not have the required permissions to view the files attached to this post.
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Re: Deferred Shading plugin - need help and testing

Post by Mind Calamity »

I haven't tested this yet (I will later), but until then, can anyone tell me if Ambient Occlusion works with this plugin ?
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
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

Yes, ambient occlusion works. This plugin is a pluginified version of the Deferred Shading demo, which contains Ambient Occlusion.

Code: Select all

DeferredShadingManager::getSingleton().addSceneManager(mSceneMgr);
mSystem = new DeferredShadingSystem(mWindow->getViewport(0), mCamera);
mSystem->initialize();
mSystem->setSSAO(true);
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Re: Deferred Shading plugin - need help and testing

Post by Mind Calamity »

Yeah, sorry for not posting earlier, but I was confusing myself for a while about how to apply the patches, and I tried and go a whole lot of errors (They're in some order I can't figure out I assume ?), do you mind zipping the plugin sources so they're not in patch format but actual compileable source code ? I would very much like to test this out.
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
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

I'll create a zip next time I'm at my job. 2nd week of january probably
Alexiss
Halfling
Posts: 74
Joined: Wed Aug 10, 2011 2:11 pm
x 11

Re: Deferred Shading plugin - need help and testing

Post by Alexiss »

Very interesting work. Any update on this ?
User avatar
Xplodwild
Goblin
Posts: 231
Joined: Thu Feb 12, 2009 3:49 pm
Location: France
x 13

Re: Deferred Shading plugin - need help and testing

Post by Xplodwild »

I think this became the DeferredShading sample
jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm
x 10

Re: Deferred Shading plugin - need help and testing

Post by jonim8or »

Xplodwild wrote:I think this became the DeferredShading sample
Nope, it's the other way around. The DeferredShading sample became a plugin.

There's no real update on this. I have a local branch (at my job, where I need this) and I'm keeping it up to date with the 1.9 dev branch. But I'm not actively developing this plugin at the moment, as we don't really need Deferred rendering yet.