How to fake GI on complex scenes?


#1

I started a thread in the Max forum though not quite as specific as this one. I also think this is perhaps quite generic so thought I’d catch more people in this forum.

Here is my fake GI scene that needs improving.

Now this is created by inserting an array of lights around my building with soft shadows as per a tutorial I saw on 3D t0tal.

The problem is, this technique seems aimed more at scenes where you’re illuminating an object centred within the aray rather than an interior/exterior where there are lots of objects blocking some of the lights in the ‘fake GI dome’.

The walls on the far side are in fact blocking half of the array of the lights that are located just outside the extents of my model.

What would be the best approach for this? Do I need to do something more complicated?

I ultimately want to use this technique in an animation so I can show buildings being constructed, including close ups

I’m aiming for fast renders, hence I don’t want to use a skydome.

[my scene has also 8 photometric lights illuminating the building by the way]


#2

Why do you want to fake the GI? In your case, I think real GI would be the way to go. Assuming you’re using the latest version of Max, Mental Ray’s Final Gather lets you bake out a sequence of FG maps (which can be fairly low resolution in your case) for the entire animation range, and then interpolate between them to avoid flickering.


#3

I want to significantly reduce the render time to those I’ve done using Final Gather or GI and also because my last animation (using Max 2009) looked crap because of flickering. I rendered a FG map every 4 frames on low or medium I believe.

I’m using 2010 and am on subscription so could upgrade to 2011 if required - I’m aware they’ve made some improvements however, even saving an FG map every 4 frames or so, a fake GI solution will still be significantly faster.

Here’s my other similar thread and will prob give you better understanding of why I’m heading in this direction:

http://forums.cgsociety.org/showthread.php?f=6&t=884346


#4

If your lighting is static, disable specular reflections as well as disable specularity on your lights. Then use mental ray’s batch bake and bake in all of your diffuse lighting and shadows into texture(s). The initial render time will be long but you’ll save so much time for an animation. After this, do a specular and reflection pass and whatever other passes you need. Hope this helps out.


#5

Had a chance to play around this afternoon so I made a little scene using the AO light shader technique I sometimes find useful. The scene has 6 Photometrics using ies profiles + 1 “Sun” that you can turn on depending on the time of day you are impling and a photometric free light that is actually off but is a container for the AO shader. Bascially you are baking the AO into the image at render time. Similar to the ArchiDesign AO option but global and with a bit more control I think. Here are some shots from the scene. (the car isn’t in the file, I just wanted to see how 3 mil polys + complex shaders would effect the rendertime.

Render Time 2:16

Render Time 0:32

Render Time 0:41
So as you can see the poly count isn’t what ads render time in this scene but rather the shaders.

Source File

Just one of many ways to go at it. BTW those were rendered @ 800x600 on a Core i7 3.2 Machine.

Here a shot of that same technique used in production for an animation I recently completed.

http://sconlogue.cgsociety.org/gallery/862106/


#6

Thanks for the info everyone - I’ll try these techniques.

Sconlogue - your link to the Max file doesn’t work.


#7

Put it in a zip. It should work now.


#8

Scanlogue - I Just tried your suggestion with an AO shader in the freelight that is off.

Results are good. [I kept the other lights in my scene also] I experimented with different settings within the shader and ended up with render times of:

  • 9mins 08 sec using same settings ads before but with the AO light shader using 16 samples and max distance at 3.0m.

  • 8mins 21sec same again with 16 samples but max distance at 1.0m in the AO shader.

So these times are a bit more than with using the array of lights but the visual results are closer to what I want.

However - I see a problem with this method. It relies on the position of the free light that contains the AO shader.
Move the light to the other side of the buiding and the AO renders black. [tried with whilst using material override]

kanooshka - I was trying to avoid baking out as it’s quite long winded. I will try this though however I’d like to also continue working on methods that will increase productivity on still frames.


#9

Strange when I move the AO light around it renders fine. Try turning all lights off. Override with a complete matte white A&D shader. You should get the Dark gray / blue ao from the gradient in the bright slot. As long as you don’t turn the light shader itself off you should be good. Also your render times seem pretty slow even if you have a bunch going on in there. What’s the specs on your machine and what res are you rendering @? Also are you using area Shadows on those other lights? If you are that can slow things way down. If you want to optimize the render times this is how I break down scenes:

  1. White Matte A&D Material in the material override, Complete matte, in fact click FG & highlights just to be sure your not generating any glossy reflections.
  2. Throw all my geometry in there. Make sure it’s to the proper scale.
  3. Place a camera in a spot reasonably similar to what the “heaviest” shot in your animation will be. Meaning where the most geo fills the screen. For example in my test scene that cam angle is as heavy as you can get for that scene.
  4. Set your resolution to what you will use as final output. So if it’s 1080HD go with etc. Also set sampling to what you need in the final render.
  5. hit render and record your time. It should be pretty fast.
  6. Add the Photometric free light with AO in the light shader slot. Turn the light off. Hit render, record. Now you know how much a hit you take from AO. Tweak as needed.
  7. Add all your other lighting. No shadows enabled first. Render, record.
  8. Now apply your shadows. Remember not all your night really need to cast shadows. Use falloff or IES profiles or whatever else you want but don’t turn on shadows of any type unless you scene really benefits, and when you do start with regular Raytraced shadows with area/shape set to point. Render, record.
  9. Now if you need soft shadows again only set that on the lights you really need it from. Don’t forget to try MR Shadow maps as an alternative to Raytraced area shadows. They often get nice results without as bug a hit to render time. Render, record, tweak.
  10. Add your materials. Again if it doesn’t really need to reflect don’t let it. Many folks go with very blurry reflections all over the place not realizing it’s killing their render time. FG / Highlights works great for near matte finishes. Or use interpolation. When you do need that real blurry reflection 12 to 16 samples should do it.

It’s rather long winded but it doesn’t fail to bring the inefficiencies out into the light.


#10

I’ll try that when I get a moment, my PC is pretty slow, only 2x2.4GHz.

Your scene rendered reasonably quick, a couple of minutes, however I’m wondering if that’s because it was fairly simple in comparison. Mine has a lot more objects casting shadows. I guess the trial will be to delete my scene apart from the lighting and import yours and compare render times.

My photometrics are using ray traced shadows and I’m rednering 800x600pix for the test. I’m using the same view in every shot, as per the images posted previously.


#11

Not had chance to follow your list of suggestions yet, however your suggestion for shader setup is now working properly. I needed to change diff/ spec, to ambient in the light settings.

I did a quick flythrough animation - left it over night, my 4 sec movie took 9hrs 46mins 16 secs!

No flickers though and I only used 8 samples this time in the AO shader. At work it would be about quarter of the time. Hopefully your suggestions will help me refine the lighting a bit more though. Still halved the render times I was having before.


#12

Sconlogue - I tried as you suggested and it’s quite interesting to see the results.

Rather than default lights to begin with (forgot how to switch them back on again!) I started with 2 onmi lights, no shadows. White matte Arch&Des mat override = 18 seconds.

[deleted omni lights then:]

AO shader in photometric light that is off (this shader is included in all further tests) = 25 secs

Photometric inteterior lights on x 8 (no shadow) = 40secs. With ray trace shadows = 54sec

Interior lights off, Sun spot light on (no shadow) = 37 seconds. With Ray trace shadows = 1:09

Interesting how this one light had the most significant affect on the render time.

Interior lights and external spot on (ray traced shadows) = 1min 33 secs.

Interior lights only again (shadow map & mr shadow trial) = results were over a min each time and were not as desired, even when experimenting with bias (right down to 0) I was having light leaks. tried 512 & 1024 map size - There may be other settings that can resolve this however I don’t know them! Anyway - ray traced was quicker.

So this tells me that the problem is my materials, not the lighting! Do you think this is conclusive? Or maybe my PC?! Are there any further tweaks I can do to the lighting before I move onto materials?

I definately needed this systematic approach.

EDIT - Just tried sticking the gloss on full for all my scene materials, and hitting ‘highlights&FG only’ for the partially hidden pipe supports.

Rendered in 6min 05. I think rendering in passes will be the way to go and post process once my materials and lighting are sorted.


#13

Interesting results! The only other light test I might try is using a good old teapot in the center of your building with all the other interior machinery off. Then turn off your material override, save a scene state with the materials selected and then assigned a standard material to all your visible Geo. Render, record. Now test an a&d material on the teapot with all kinds of different looks and settings. Really get a feel for what slows things down. Also get a sense for how to optimize. Just a few materials with inefficient settings can bring the whole scene to it’s knees. Also the results you got with a matte a&d seem strange. Way too long. It should render about as quick as a standard material I would think.


#14

Just tried switching off the interior plant and walkways to re-render.

With AO shader only, no lights, the render time was 24 secs, only 1 sec faster than with everything on.

With interior photometric lights and sun spot on, both using ray traced shadows, it took 1min 15sec, compared with 1min 33sec with everything on.

Tried using a standard material instead of arch design for the matte white material overide, and it was one second faster for AO shader and 5 seconds slower with all lights switched on - I kind of expected this - I had read the A&D material was optimised to run faster than standard (obviously depending on settings).

So it looks like rendering AO is slower than you would expect because of my PC spec.

Perhaps this is the best lighting setup I’m going to get. Ray traced shadows were faster than shadow maps even with a 512 map size so don’t think there’s anything else I can change really - apart from my processor!

I’ll try the teapot suggestion too to get a feel for what really screws over the render time.


#15

I just ran some more tests but using texture baking.

I reverted back to my original settings with final gathering using a skylight and again using the photometric interior lights and sun target spot.

This is definately the way forward for animations [providing I don’t stumble across new problems when using this technique for animations of course]

I ran my test without any of the interior plant or walkways. I just had 9 collumns, 2 beams, the crane, 3 clad walls and the floor slab.

The FG scene with materials as they were originally, blurry reflections etc took 3mins, 20sec.

The baked version that looks almost identical with the entire baked material plugged into the self illumination slot on the orig arch design material took 1min 34.

(I’m a little unsure as to whether this is meant to be done this way i.e. placing entired baked material into the self ill slot - but it works)

edit - I switched reflections and spec off for the baking btw and then back on again after I plugged the complete map into the self ill slot of mrA&D material for my render.


#16

That definitely is the way to go when it comes to baking. Then if you want to do reflections/specular highlights create a separate pass with the non-baked materials and then composite the passes together in whatever compositing package you use.


#17

Yeah I figured I’d have to do something different for the transparent objects as they don’t like being baked.

How would you approach baking the clad windows in my scene? Would you use the skylight and FG as well as other scene lights again and exclude the other scene objects from the calculation?


#18

Most glass objects are not very diffuse so you should not really need to use final gather. Glass relies more on reflection refraction. If you do want to achieve some diffuse light on the glass, you may be better off just hand placing a few lights and linking them to the glass. In the end, baking glass objects does not work very well at least in my experience, and you may be better off rendering your animation with some lights diffuse illuminating the glass at render time.


#19

Well for the whole scene, original setup using FG it took 17mins 9 secs.

Baked textures, and using only lights to emit spec only, no FG, reflections back on. My scene renders in 2mins 12sec. It’s not perfect yet, I need to re-render certain elements and tidy up a few UVs but it’s looking good - thanks alot.

based on a comparison between orig render time of scene on home and work PC, this would render in 15secs at work.


#20

Glad to help and happy that it’s working well for you.