Deferred Rendering

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Do you think this is usefull and needs further improvements

Yes
99
93%
No
0
No votes
I really don't care
8
7%
 
Total votes: 107

ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Deferred Rendering

Post by ent1ty »

thanhle wrote:entity, how many light does your irrenderer supports?
Infinite :wink:

I saw you on irc yesterday but I was asleep when you were there... I tried porting my irrRenderer to 1.8 but i hit some bug i couldn't figure out so I just gave up. Not sure what changed between the versions that would create rendering glitches. Other than that, porting is just linking with the correct libraries i think, everything should compile out-of-the-box, or the compile errors you'll be getting are very easy to fix.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Deferred Rendering

Post by sudi »

thanhle wrote:These looks awesome.
ent1ty and Sudi why don't you guy working together and incorporate this into Irrlicht next release?
Entity?
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Deferred Rendering

Post by ent1ty »

Talk it over on the irc?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Deferred Rendering

Post by sudi »

sure
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ison
Posts: 42
Joined: Sun Mar 24, 2013 9:09 pm

Re: Deferred Rendering

Post by ison »

That would be great! Irrlicht lacks nice and fast deferred lighting.
I've also tried to port irrRenderer to 1.8 but no success. Lights are rendered but in a weird way.

Also, would it be possible to use deferred lighting as a post process effect, so there would be no need to set special material for each mesh? One could write his own shader for a mesh and then use lighting as a post process effect.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Deferred Rendering

Post by sudi »

ison wrote:Also, would it be possible to use deferred lighting as a post process effect, so there would be no need to set special material for each mesh? One could write his own shader for a mesh and then use lighting as a post process effect.
You don't know how deferred lightning works right...

You render the scene in multiple textures. One for the color, one the position of the pixel in 3d space and one for the surface normal. Now you give this to the lights when you render them so they do all the havey work actually.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ison
Posts: 42
Joined: Sun Mar 24, 2013 9:09 pm

Re: Deferred Rendering

Post by ison »

I know that you need pixel position FBO for deferred lights but currently in irrRenderer you can't specify your own shader for meshes afaik, you have to use the one provided or modify irrRenderer source. Maybe it would be better to pass user defined MRT's to deferred lighting lib, so one could write his own shader and just pass all FBOs to the library.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Deferred Rendering

Post by ent1ty »

Yes you can, only you have to make sure you output the data irrRenderer needs to calculate the lighting, in the correct format and order
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
ison
Posts: 42
Joined: Sun Mar 24, 2013 9:09 pm

Re: Deferred Rendering

Post by ison »

Oh, ok, I get it now ;D

good luck with this project, I hope it will be available in next Irrlicht version
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Deferred Rendering

Post by ent1ty »

Just a heads-up, irrRenderer is now working for Irrlicht 1.8, you can grab it here :)
(as always, comes with a pre-compiled win32-gcc demo)

Mercurial repo here: https://bitbucket.org/entity/irrrenderer


Yes, the post processing effects still suck, go google your own :P

Note: sometimes I get a crash when starting RenderTest, but it seems pretty random. If you do too, please let me know :wink:


Image
Image
Last edited by ent1ty on Thu Aug 01, 2013 4:29 pm, edited 1 time in total.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Deferred Rendering

Post by mikkis »

Hi. Thanks!
Had some problems (but worked these out).

Downloaded irrRenderer.7z, bin/RenderTest.exe crashes every time.

Opened project in VS Express 2012 (irrlicht (trunk) 1.9), made some modifications to code because it didnt compile:

CShaderLibrary.cpp

Code: Select all

 
line 24:
    irr::c8 buff[fileVertex->getSize()];
 to
    int size = fileVertex->getSize();
    irr::c8 *buff = new irr::c8 [size];
 
line 34:
    irr::c8 buff2[filePixel->getSize()];
 to
    size = filePixel->getSize();
    irr::c8 *buff2 = new irr::c8 [size];
 
and added return 0; to couple of methods, VS compiler required them.

Then debugged some more, it still didnt work.

In CRenderer.cpp, line 149:

Code: Select all

 
    if(enable && !LightMgr->getPostProcessingActive())
    {
        irr::core::dimension2du dimension= Device->getVideoDriver()->getCurrentRenderTargetSize();
        LightMgr->setPostProcessingTextures(Device->getVideoDriver()->addRenderTargetTexture(dimension, "Post-Processing-Tex1"),
                                            Device->getVideoDriver()->addRenderTargetTexture(dimension, "Post-Processing-Tex2"));
        LightMgr->setPostProcessingActive(true);
    }
 
this was always false, so it doesnt create RTTs (so crashed).

I changed that line

Code: Select all

 
    if(enable && !LightMgr->getPostProcessingActive())
to
    if(enable)
 
and now it works with irr trunk (1.9).
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Deferred Rendering

Post by ent1ty »

Thanks for reporting & providing code(the crash was only due to an uninitialized bool, sometimes it would be false and it would work, other times it would be true and cause a crash), I have updated the link in the original post ^ , it should work in a bit.
As for the missing return statements, I'll have to get a VS express copy and fix it later :P
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Deferred Rendering

Post by mikkis »

Yeah, now it works.

4 methods that need to return value:

Code: Select all

 
in CTestFramework.cpp:
   bool CTestFramework::OnEvent(const SEvent& event)
 
 
in CPostProcessingEffectChain.cpp:
  irr::u32 irr::video::CPostProcessingEffectChain::attachEffect(irr::video::CPostProcessingEffect* effect)
 
  irr::video::CPostProcessingEffect* irr::video::CPostProcessingEffectChain::createEffect(irr::video::SShaderSource &effectShader, irr::video::IShaderConstantSetCallBack* callback)
 
  irr::video::CPostProcessingEffect* irr::video::CPostProcessingEffectChain::createEffect(irr::video::E_POSTPROCESSING_EFFECT type)
 
scorpeti
Posts: 5
Joined: Thu Aug 07, 2014 7:09 am

Re: Deferred Rendering

Post by scorpeti »

Hi!
I would like to try your work, but the links in the first post are dead. Could you (or someone who has the latest version) update them again please?
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Re: Deferred Rendering

Post by sudi »

Hi scorpeti,
I lost my source and shaders as well. But i have a collection of releases someone else collected. I updated the first post.

Kindly packaged by someone else (collection of releases, no idea whats in there actually)
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Post Reply