[GSoC 2011 - Accepted] Modern Illumination Techniques

Threads related to Google Summer of Code

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby spacegaier » Tue Apr 26, 2011 10:44 am

One general note: Please always add important points such as the link to the Ogre fork where you will do your work also to the wiki page, so that those key information are stored at a central place. Thanks!

Regarding compositors: Nothing I am aware of. There is an Ogre sample that deals with compositors, you could have a look at.
Ogre Admin [DevTeamMember, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your sparetime? Help the Ogre wiki grow!
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
 
Posts: 3843
Kudos: 86
Joined: 04 Feb 2008
Location: Germany

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Tue Apr 26, 2011 11:49 pm

I've looked trough the compositor demo(and the deferred shading demo), but my biggest problem right now is adding a second geometry pass. Is there any sample that does that?

Updated the wiki(will polish it a bit; not quite familiar with wiki syntax). Will also try and keep it updated.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Mind Calamity » Thu Apr 28, 2011 5:03 am

The techniques that you mentioned are very impressing, when you complete this project it will be open source and the we will have access to it, right ?

Light techniques in general are really interesting, and I'd love to take a look at how they're implemented, and probably "steal" some code :D .

Good luck!
User avatar
Mind Calamity
Ogre Magi
 
Posts: 1196
Kudos: 76
Joined: 25 Dec 2010
Location: Macedonia

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby spacegaier » Thu Apr 28, 2011 6:36 am

Yes, the code will be open-source. There soon should be an Ogre fork, where you can follow it.
Ogre Admin [DevTeamMember, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your sparetime? Help the Ogre wiki grow!
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
 
Posts: 3843
Kudos: 86
Joined: 04 Feb 2008
Location: Germany

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Thu Apr 28, 2011 10:25 am

Also be sure to follow the wiki page, I'll start updating my progress there as soon as I get some schoolwork of my hands and start coding.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page

For this message the author andrei_radu has received kudos
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby LBDude » Fri Apr 29, 2011 6:57 am

I'm looking forward to following your progress :)
My blog here.
Game twitter here
LBDude
Gnome
 
Posts: 389
Kudos: 22
Joined: 26 Jul 2010

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby psx » Sat Apr 30, 2011 8:53 pm

Hi Andrei.
I'm very glad that you have taken this work.
Right now I'm implementing deferred shading (more advanced than in a sample)
and I would like to help you as much as I can.

andrei_radu wrote:I've looked trough the compositor demo(and the deferred shading demo), but my biggest problem right now is adding a second geometry pass. Is there any sample that does that?


ok. You can do it by compositor script, or in code.

Script looks like this
Code: Select all
compositor
{
    technique
    {
        target mrt_output //This renders to GBuffer
        {
            pass render_scene //This renders geometry .. Look at manual
            {
                 material_scheme gb_out_scheme
            }
        }

        target output  //This renders to screen
        {
            pass render_scene  //This renders geometry again
           {
                // You can use
                // different material scheme
                // visibility bit mask
                // queue groups
           }
        }
    }
}


So if you need more info - just ask
psx
Gnoblar
 
Posts: 15
Kudos: 0
Joined: 14 May 2009

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Mon May 02, 2011 6:18 am

The current deferred shading demo already does more than one geometry pass. After the opaque scene is lit the transparent objects are rendered in normal (forward) mode. Check out "compositor DeferredShading/ShowLit" in the deferred.compositor script.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Wed May 18, 2011 8:07 am

Hi,

Coding season is nearly upon us, so it is a good time to read up on mercurial and set up a fork that you will use to develop your project.
I recommend first reading a bit about distributed source control (if you aren't familiar with it). I used http://www.hginit.com as its fairly friendly and simple.
Afterwards, create a user on bitbucket and fork ogre. Some URLs to help you do that :

http://www.ogre3d.org/developers/mercurial
http://www.ogre3d.org/docs/OGREDevelope ... index.html
http://www.ogre3d.org/tikiwiki/Getting+ ... TortoiseHG (if using windows)

The fork name should be Ogre-GSoC2011-ModernIllumination

Once you set it up, try committing something minor (creating a directory for your demo or something) to see that the pipeline is working. Also make sure that the fork compiles (shouldn't be a problem).

Good luck!
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Mon May 23, 2011 6:31 pm

Hey, as I posted in my proposal, I have exams for the next 3 weeks, so I won't be doing any heavy coding during this period(though I hope to finish deferred lighting asap). In addition to that, my laptop broke, and I'm expecting a new one in 2-3 days, so that's when I'll create the fork. Will update with progress.
Andrei
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Wed May 25, 2011 1:50 pm

Here's my bitbucket reppo: https://bitbucket.org/andreiradu/ogre-gsoc2011-modernillumination. Got my new comp, and will start working on deferred lighting.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Assaf Raman » Wed Jun 15, 2011 10:29 pm

Hi, where do we stand with this project?
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
 
Posts: 3089
Kudos: 78
Joined: 11 Apr 2006
Location: TLV, Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Mon Jun 20, 2011 5:14 pm

Hey, sorry for the lack of updates, I'm in the process of moving, so I don't have a steady internet connection.
I almost finished the shaders for deferred and inferred lighting, and am currently in the process of integrating that. I was thinking of highjacking the current deferred shading plug-in and adding a drop-down that controls the technique used(that way we can do a comparison). Is that ok?
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page

For this message the author andrei_radu has received kudos
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby jonim8or » Thu Jun 23, 2011 8:58 am

I'd love to see the Deferred Shading plugin get into the Ogre trunk. At the moment I'm using my own branch of the Ogre project, with deferred shading plugin, and have to regularily synchronize it with Ogre trunk.

Here's my most recent version of the patch. However, it has some problem with Dll's (I always use Ogre_Static)
Attachments
deferredshadingplugin.patch
Recent version of the "move deferred shading from sample to plugin" patch I did
(219.77 KiB) Downloaded 231 times
jonim8or
Goblin
 
Posts: 276
Kudos: 9
Joined: 08 Dec 2008

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Fri Jun 24, 2011 6:09 pm

I was actually referring to the deferred shading example. Sorry for the confusion.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Sun Jun 26, 2011 5:18 pm

I will probably be late with the first stage. I'm a bit caught in the complexity of the custom rendering passes and material generators. At the moment I've figured out how to generate the material for the lights, but I'm having issues with generating the material for the final pass. One of the main advantages of deferred lighting over DS is that a lot of parameters are passed in this stage in stead of being kept in the G-Buffer(albedo, spec. power, spec. intensity, screen space speed, and pretty much any precomputed lighting). Some of these are not currently used at all.
Should I generate some materials for a couple of permutations, like the current sample does, or should I try finding a more streamlined solution?
I also think I found a bug. The specular exponent is hard coded in the shader, and what is read from the G-Buffer is multiplied(kind of like a specular power).
Code: Select all
float3 light_specular = pow(dot(normal, h),32.0) * lightSpecularColor.rgb;
total_light_contrib += specularity * light_specular;

Is there some explanation for this?
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Sun Jun 26, 2011 6:14 pm

I think I took those functions from the deferred rendering demo that I inherited in my GSoC project. Different implementation parametrize different parts of the lighting equation. Your proposal is valid, but is it critical for your project?

As for the project, I think its naive to say "probably" will be late, as according to your plan you have both light-pre-pass and inferred lighting done by tomorrow. Good luck with that =)
Of course I'm teasing you, but self-honesty is good.

Tactically speaking :
From what I understand, light pre-pass is made of three steps
A) Render a sort-of G-buffer, storing depth and normals
B) Render the lights to the L-buffer, sampling the G-buffer in order to carry out the lighting equation
C) Render the objects of the scene, sampling the light buffer instead of calculation light equations.

A and B are similar steps to the deferred shading demo. Are you done with them yet? Can we see screenshots of intermediate buffers? (They are very good signs of progress). Maybe some code?
C is actually closer to forward rendering, as the objects are all processed again. The shader complexity here is big, and I'm not sure which approach is best for the demo. Its your call on whether to go for material generation or just manually write enough materials to get the demo working.

Some things that might be helpful :
A and B can probably be achieved by stripping down the deferred shading framework (Only output depth and normal to G-buffer, and have much simpler shaders for the L-buffer)
C will likely be a render_scene instructive in a compositor, with a custom material scheme. In order to have access to the L-buffer in the materials, the best approach would be to use the 'content_type compositor' directive, which will allow you to easily link between the materials that need the L-buffer texture and the texture itself.

Strategically speaking :
You might need to rething your timeline. You now have a better idea of the complexity of your project. Have a look at your proposal and see the items and estimates beyond the current task. Do they still make sense? It is better to make decisions early than to say "I will probably be late with the next task".
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Sun Jun 26, 2011 8:51 pm

Well, at the moment the GBuffer renders correctly(Normals+Depth), and the light buffer seems to work fine as well(see the pic, ignore the settings). The GBuffer needs more work for inferred lighting, but nothing major. My main issue now is putting them back together, and I think I'll use a material generator here, and only cover the basic cases that are covered by the initial demo.
Image

Concerning the schedule, I will definitely drop depth peeling, since it's not really useful in the context. I will also leave SSDO for the last 1-2 weeks, and drop it if needed. I'll be able to do a better evaluation after I start working on LPV. Does that sound ok?
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Mon Jun 27, 2011 9:07 pm

Whether your new schedule is achievable or not is up for you to decide :)
One thing for sure - you should put the pedal to the metal if you want to achieve something meaningful in this GSoC!
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Sat Jul 02, 2011 1:53 pm

The last part of deferred & inferred lighting to implement is the second geometry pass. Everything else seems to be working fine.
My issue is that I can't really use a render_scene pass, since I need to set the lightBuffer texture as an input, and as far as I can tell, I can't set an input to a render_scene pass. Modifying this seems a bit daunting, and I don't really see other uses for it. So my current solution is to implement a custom compositor pass for this stage. This has the added advantage that it can be more easily modified to use the culling results from the previous geometry pass. My problem is actually rendering the scene in it. Do I update the viewport, or use _renderScene on the camera, or the sceneManager? Or do I add a render target and let ogre do the rest?(and if so, what's the best way of doing that?).
I've also started thinking about the next step, which would be implementing reflective shadow maps, and have sort of similar questions. I would, obviously like them to be done using compositors, and offer easy integration. Should I add a new 'shadows' option? Something like shadows {on|off|reflective}. Another issue is that this requires shaders, so I'm not sure what the fallback would be. Another option is to implement this as a render_custom pass, but I would like to avoid that(it's easier for a user to modify a script than to add code). Either way, the result of this pass would be extra lights added to the scene. (As a quick reminder, Reflective Shadow Maps render shadowmaps with some extra info besides depth( normal and flux), then sample these maps and generate light sources based on them.
I'd appreciate some input.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Sat Jul 02, 2011 2:10 pm

Like I said in the previous post, you can use the compositor content type to reference the L-Buffer texture in your materials.
This allows you to reference an internal texture in a certain compositor in regular materials. This was designed with techniques such as inferred lighting in mind, so it should be right on the money.

You can read more about it here.

As for the reflective shadows :
A) Feel free to add as many options to the deferred shading demo (Which will probably change its name at the end of this GSoC to 'illumination techniques demo' or something similar) as you wish
B) All of the advanced techniques require shaders, so there's no real reason to have fallbacks IMO. It would be nice if the demos ran on shader model 2, but the real advanced stuff might require 3 as well. Don't worry about supporting as much hardware as possible in this stage. Just keep it in CG :)
C) I don't know exactly what reflective shadow maps are (will read a bit about them soon) but you can see how I implemented shadow mapping in the deferred framework by looking at the light-casting custom composition passes.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Sun Jul 03, 2011 10:33 pm

Ok, deferred lighting is running, albeit with a couple of bugs. The redness in the image is caused by the specular term(it somehow gets weird values). There's also a slight bug with the tex coords(you can see the LBuffer repeating itself along the edges of the window). And the shadow casting lights don't get rendered. Will get on this tomorrow, and I hope to get the demo ready by the end of the week.
Image

I was talking about adding the RSM option to ogre itself, not the demo. It's a feature that can be used for other effects as well, and it affects the way shadowmaps get rendered. From what I see the deferred demo uses prepareShadowTextures to get the shadow maps. I wouldn't really be able to do that, since I need a shader to be used when rendering the shadowmaps, and each map will be a MRT. The other option is using a custom compositor pass for RSMs.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Sun Jul 03, 2011 10:50 pm

Good to see you're making progress! The mid-term isn't far away, and its a good idea to get some good progress in so we are sure that you will get what you planned in time.

since I need a shader to be used when rendering the shadowmaps

I don't really get this point. Ogre already has many shadow techniques that use shaders. Why is this a problem?

and each map will be a MRT

Can you explain into more detail what kind of rendering setup you need to be able to pull it off? Maybe its less (structural) work than you think.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby andrei_radu » Mon Jul 04, 2011 7:55 am

RSM is a particular implementation of Instant Radiosity. Instant radiosity works by casting rays from each light source, and finding the intersection with scene geometry. At each intersection point a Virtual Point Light(VPL) is generated. These lights simulate first bounce GI(obviously, the algorithm can work recursively to generate second bounce GI, but definitely not in real time). The problem is that ray tracing is relatively slow and GPU unfriendly, so RSM uses the Z-Buffer as a primitive ray tracer. For each light, a 'fat' shadow-map is generated(it contains depth, normals and flux-a scalar specific to the light type; these need to be MRTs). These shadow-maps are then sampled, and VPLs are generated. These are then used to light the scene. My problem is not using a shader on the shadow receiver, but using a fragment shader on the shadow caster(this might be already possible, but I'm not aware of it). My other problem is generating and deleting a large number of lights(we're talking hundreds, maybe more) each frame in an efficient manner.
This is both a step to achieving LPV, and a nice to have technique on it's own(it's a rather fast and good looking GI technique), though I'm not sure if it will work in real time in Ogre.
My Google summer of code 2011 topic: Modern Illumination Techniques
My Google summer of code thread
My Google summer of code wiki page
andrei_radu
Google Summer of Code Student
Google Summer of Code Student
 
Posts: 55
Kudos: 8
Joined: 18 Mar 2011

Re: [GSoC 2011 - Accepted] Modern Illumination Techniques

Postby Noman » Mon Jul 04, 2011 1:34 pm

Using a pixel shader for the shadow caster is standard. Every technique does that. Even the current deferred shading demo does that. (Check out ShadowCaster.___ in the Samples\Media\DeferredShadingMedia directory).

The only problematic part might be to tell Ogre that the shadow maps need to be MRTs. This will require a small change in Ogre. It is up to you to decide whether or not you want to go forward with it. You can also start discussions elsewhere about this specific topic (the normal developer forum might be a good place).
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 714
Kudos: 2
Joined: 31 Jan 2005
Location: Israel

PreviousNext

Return to Google Summer Of Code

Who is online

Users browsing this forum: No registered users and 0 guests