Modified Deferred Rendering Engine (Proof of concept)
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Modified Deferred Rendering Engine (Proof of concept)
But I noticed multiple things missing it the pipeline, ie pointlight-shadows, shadow filtering, glowmaps, specular maps, antialiasing, light-power, cube mapping, transperancy, shadow-transperancy, optimised dierctionl shadows, etc.
Which it is understandable, considering one had to reimplement to entire Ogre3d Material System with deferred shading materials.
But since I needed some of the functions I put them in and created a custom version of the Deferred Shading Pipeline and implemented the following functions: pointlight-shadows, shadow filtering, glowmaps, specular maps, spotlight texture projection, light-power, cube mapping, a settings file in CaveEngine/Media/DeferredShadingMedia/deferred.cfg,transperancy (1,0, no alpha) and shadow-transperancy and tested it with a little sceneloader and Scenes I made in ogitor.
But it still has a lot of problems, namely bad linux pwerfomance, being based on dead Nvidia technology (cg), IMO bad code thats bad on bitshifting codes for Material names, no directx support, confusing code and not many settings.
So I will probably start from scrach again and use better source and glsls and hsls shader code, where I'll also put much more features.
This post is mainly hear to show of my prebuilt demo for the current code for deferred shading.
Also I didn’t take me a year to make it. I had a lot of school stuff I had to work on and there were entire months were I did nothing.
All in all It took me a few weeks to put this together at max. Sorry that it took so long, there was a lot of other stuff I had to do.
So heres a few screenshots:
And heres the binarys:
Windows:
https://mega.co.nz/#!XUEmwaDD!gkCG_oAO6 ... xc3NkauU70
Linux:
https://mega.co.nz/#!fAMmSb5J!TbyO3huLa ... GpisU-atjs
Source:
https://mega.co.nz/#!SJ8GDLzR!PsycxOQOH ... s9Le2-4yK4
Please give me feedback on what to put in the from-scratch version. When I'll post that one, there will be proper documenation and a better demo.
Btw, you can play around with the cfg file in Media/deferredshading/deferred.cfg to change shadow resolution and sampling rate, but sam plinjg ruins the framerate
-
- Greenskin
- Posts: 122
- Joined: Fri Jan 20, 2012 6:44 pm
- Location: Russia,Moscow
- x 1
Re: Modified Deferred Rendering Engine (Proof of concept)
except crash on exit and some shader compiling errors(not DS shaders)
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Re: Modified Deferred Rendering Engine (Proof of concept)
-
- Orc Shaman
- Posts: 737
- Joined: Fri May 31, 2013 2:28 am
- x 65
Re: Modified Deferred Rendering Engine (Proof of concept)
if you consider a from-scratch version then you might consider coding it with HLMS system that was ported back to 1.10
HLMS 1.10 backport is already merged, just need to wait for samples( PBS ) and backport docs to merge-in
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Re: Modified Deferred Rendering Engine (Proof of concept)
- Zonder
- Ogre Magi
- Posts: 1168
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 73
Re: Modified Deferred Rendering Engine (Proof of concept)
And nice work!
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Re: Modified Deferred Rendering Engine (Proof of concept)
thx
-
- Orc Shaman
- Posts: 737
- Joined: Fri May 31, 2013 2:28 am
- x 65
Re: Modified Deferred Rendering Engine (Proof of concept)
its located in ogre-bitbucket 2.1 branch under ../docs/2.0/*porting_manual_draft..
https://bitbucket.org/sinbad/ogre/src/4 ... dt?at=v2-1
also much information is spread on the ogre2.x forum thread...( basically just type 'hlms' on the google search bar... )
you can also take a look at 2.1 hlms implementations of PBS/unlit/forward+ and play with the code a bit...
i dont know much on the state of 1_10 backport, but iv'e read some folks already started using it( porting forward+ to 1_10 )
so i think it should be similiar if not the same...
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..
coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Re: Modified Deferred Rendering Engine (Proof of concept)
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Modified Deferred Rendering Engine (Proof of concept)
I tested your deferred shading demo. It looks amazing!
I'm trying to integrate your logic in my code. But I'm always getting the following exception: Named constants have not been initialised...
I debugged into the code and the exception comes from GBufferMaterialGenerator.cpp when trying to set auto named constants:
Code: Select all
const GpuProgramParametersSharedPtr& params = ptrProgram->getDefaultParameters();
params->setNamedAutoConstant("cSpecularity", GpuProgramParameters::ACT_SURFACE_SHININESS);
if (numTextures == 0 || permutation & GBufferMaterialGenerator::GBP_HAS_DIFFUSE_COLOUR)
{
params->setNamedAutoConstant("cDiffuseColour", GpuProgramParameters::ACT_SURFACE_DIFFUSE_COLOUR);
}
Could you please help me with this?
Regards
Lax
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Modified Deferred Rendering Engine (Proof of concept)
When I use the profiles from your code e.g.:
Code: Select all
if (mIsSm4)
{
ptrProgram->setParameter("profiles", "vs_4_0");
}
else
{
ptrProgram->setParameter("profiles", "vs_5_0 vp40");
}
Code: Select all
params->setNamedAutoConstant("cWorldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
params->setNamedAutoConstant("cWorldView", GpuProgramParameters::ACT_WORLDVIEW_MATRIX);
Code: Select all
const GpuProgramParametersSharedPtr& params = ptrProgram->getDefaultParameters();
params->setNamedAutoConstant("cSpecularity", GpuProgramParameters::ACT_SURFACE_SHININESS);
if (numTextures == 0 || permutation & GBufferMaterialGenerator::GBP_HAS_DIFFUSE_COLOUR)
{
params->setNamedAutoConstant("cDiffuseColour", GpuProgramParameters::ACT_SURFACE_DIFFUSE_COLOUR);
}
Code: Select all
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program DeferredShading/GBuffer/FP_2353: The compile returned an error.
(0) : error C6015: Output 'COLOR2' not completely written
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
13:46:50: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1627)
Maybe this topic is to complicated and maybe I should keep my hands off this issue...
But I had the hope, to have each possible shader scenario covered (shadows, normal mapping, ssao, etc.).
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Modified Deferred Rendering Engine (Proof of concept)
So the question is, how to get it working with DirectX?
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
- tod
- Troll
- Posts: 1394
- Joined: Wed Aug 02, 2006 9:41 am
- Location: Bucharest
- x 94
- Contact:
Re: Modified Deferred Rendering Engine (Proof of concept)
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Modified Deferred Rendering Engine (Proof of concept)
Oh, why would the compiler do such a thing?compiler finds some variables are not used and removes them
How to prevent, that the variables are removed?
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Re: Modified Deferred Rendering Engine (Proof of concept)
Please do not use this code for anything but experimentation
-
- Hobgoblin
- Posts: 583
- Joined: Mon Aug 06, 2007 12:53 pm
- Location: Saarland, Germany
- x 50
Re: Modified Deferred Rendering Engine (Proof of concept)
http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62
-
- Goblin
- Posts: 253
- Joined: Sat Sep 28, 2013 3:46 pm
- x 10
Re: Modified Deferred Rendering Engine (Proof of concept)
Hope I get it into beta this year.
Ill keep updateing the HLMS_DS Demo thread, so keep an eye on that, I'll update it as soon as I got some new features and fixes into it.