PDA

View Full Version : Taking it slow with GI, Caustics, Final Gather (beginners)


Jozvex
10-27-2005, 07:58 AM
Ok, hello people!

This may actually be a pointless thread, but maybe not. Are there any beginners (to indirect illumination, and just MR rendering) still out there who browse this forum? I've put together a very basic scene, with just a few objects and shaders, that currently uses Final Gather (multibounce) and Caustics for indirect illumination. Here's two renders:

Direct Illumination only, rendertime 18 seconds (1.5ghz):

http://www.jozvex.com/temp/BasicDirect.jpg

Direct + Final Gather (4 bounces) + Caustics, rendertime 3 minutes 25 (1.5ghz):

http://www.jozvex.com/temp/BasicIndirect.jpg

Ok so yes, it's pretty basic looking. BUT basic is good!! I get a lot of emails like:

Nervous Voice X: "Dear Jozvex, I'm currently in the middle of production on a gigantic scene. There are millions of objects and passes and shaders of all kinds. I have never used GI, FG or Caustics before but my boss wants them and my time is running out. Please help me."

Me Thinking: "Good lord......."

It is SOOOOO much easier to practice and learn about ALL aspects of Mental Ray on a basic little scene like mine. You can still clearly see the FG and Caustics, or what sampling settings do, or how tuning the BSP settings will affect your scene. All this in a predictable and non-stressful environment. *long relaxing sigh* See? Much better!

Here is the scene file for everyone with Maya 7, no custom shaders needed:

http://www.jozvex.com/temp/FGTuning.mb

If there's demand I'll make a 6.5 version, but I used at least 1 new feature of Maya 7 for this scene that will change things (FG Presample Density).

My idea is that we can use this thread to talk about any settings I used in this scene (I tweaked everything like sampling, BSP, FG, Caustics, lights, shadow/photon shaders, per object settings etc) and also to make different variations, like perhaps GI instead of FG, maybe AO etc.

It's a bit like Mental Ray with training wheels or something? Keeping it based on a simple scene is important to keeping the rendertime low, and also limiting the number of bugs or weirdities occuring.

Tell me if this thread is or isn't needed!!

:scream:

doms
10-27-2005, 09:33 AM
Hey J, any info from you is worth 50 pages of the MR manual, maybe it hasn't occured to Mental Images that some people who use there product are fulltime specialist render monkeys. Without forum posts/ user tutorials there is no way i would be using there product. Good-on-ya M8 and keep it coming!

creaminds
10-27-2005, 09:44 AM
[sorry for my bad english]

I'm so glad to see that some one has thought of us.
I think that is extraordinary that you think of doing this for us.

I will download your scene and test it.

I have some general questions for you about GI and FG:

when is appropiate to use fg and gi?

when you render an indoor scene is best to use gi combined with fg?
when you render an outdoor what I can use?
how do you put your emmiting lights to simulate the real world light ?
How you can establish the intensity?

Maybe are stupid questions and if so I'm so sorry.

elvis75k
10-27-2005, 04:05 PM
Thanks JOz.. wonderfull read.

ps. . restore your avatar!! :)

Bernard397
10-27-2005, 06:09 PM
Hello Jozvex,


I'm also trying a little bit of MR...
Is it possible to do a Cornell Box rendering in Maya Mental ray ?


http://www.richardrosenman.com/cornell.htm



thanks ,



bernard

jammin
10-27-2005, 06:21 PM
oh yeah, i SOOO need this.

gonna try this with max -should be pretty much the same, right?

YourDaftPunk
10-27-2005, 10:14 PM
Here is a cornell box in Mental Ray with GI and Final Gather.

Here is it with a 3d scan.
http://www.lickmypixel.com/images/cornell_buddha.jpg

Box version is attached.

-shawn

Jozvex
10-28-2005, 02:12 AM
Hey J, any info from you is worth 50 pages of the MR manual

Aww that's nice of you to say. I should point out though that really I have no degree in rendering, or certification to say that I'm not just making it all up as I go along!! I'm still waiting on the Rendering with Mental Ray book too, so I don't even have that. Anything I know is from either the Maya help files, the internet, or just from my experience with MR and other renderers.

when is appropiate to use fg and gi?

Well, really whenever you like. Let's look at your other questions though for more detail:

when you render an indoor scene is best to use gi combined with fg?

Probably I would say yes. Why? Well, photons are really quite fast for getting a good rough estimation of indirect lighting. They're much faster for getting lots of bounces than FG is. Also, they will give different results to FG multibounce because they actually come from the lights! Just like real lights the photons shoot from the light into the scene. FG doesn't come from lights, it just looks at the scene and says "Oh look, this part of the room is bright, lets brighten the other objects close to here." FG is still great, but it's not really based on real life.

So why not just use GI photons and no FG? Because in real life there's a LOT (practically infinite amount) of photons everywhere all the time. Mental Ray would just die, or take years to calculate that many photons. So, because we use much less photons, we get blotches. Blotches can be solved for one still image, but for an animation it becomes way harder to solve because the photons get randomly shot out, differently on each frame. So the blotches will move on each frame, which looks terrible.

Then comes FG! The whole point of FG (at least originally) is to stop the GI blotches. It evens it all out. Can you use FG multibounce with GI? No, and you wouldn't want to. Why? Well because it would probably look really strange! Final Gather happens after the GI right? So Final Gather would be taking your (lets say 5) GI bounces and then bouncing those 3 (or whatever) more times on top. The lighting would just become all wrong. With each bounce of GI the effect becomes weaker. Bounce 10 has much less effect than bounce 2. So FG would take the finished GI and create a very strong bounce 2 from that, almost doubling the lighting etc.

Why would you use Final Gather multibounce instead of GI + FG? One reason is that it's much easier to setup. You practically just turn it on, tweak some settings and go. You don't have to setup photons on each light etc. Also, we know that GI photons can create blotches. Well, Final Gather can certainly create blotches too. So unless you are confident that you can handle both GI and FG well, you might end up with GI blotches + FG blotches! FG multibounce takes the GI blotches out of the equation.

Some other things to consider are that Final Gather gets much slower if you have lots of reflective and refractive objects, especially glossy reflections/refractions. So GI + FG will be faster for scenes like that, unless you use a shader by Francesca called Ctrl_rays, which can tell FG to pretend the reflections are not glossy. You can get Ctrl_rays from this post:

http://forums.cgsociety.org/showpost.php?p=2740832&postcount=5

Ok I think that's enough on one question! Haha!

when you render an outdoor what I can use?

It depends on the scene! Probably FG is best for outdoors. In an outdoor scene, unless you have some kind of building, where there are some partly enclosed spaces, most of the GI photons (if you use GI) will not land on anything (eg they hit the ground, (first hit doesn't count) and then go into the sky), and will just fly off into space. The more photons that fly off into space, the slower your scene will calculate. Why? Because, a lot of people don't know this but the number of photons you set on your lights is NOT how many photons will be sent out! It is the number of photons from that light that must be collected on objects before the light will stop shooting them! That's very important, because if most of your photons are not being collected, Mental Ray just keeps on shooting and shooting them out until it finally has the right amount collected, which could take ages! So if you're using GI, make sure that photons will be collected easily (perhaps using a focussed spotlight instead of a point light, etc).

Now, there are other things you can use for outdoors instead of FG or GI. Some of those are Ambient Occlusion, HDRI using area lights with importance sampling, or HDRI using lightmaps with importance sampling. That last one is particularly good and I've been using it a lot lately. I'll show everyone how in a different post of this thread. :thumbsup:

how do you put your emmiting lights to simulate the real world light ?

There are a lot of different things that help with that. If you don't have it already I highly recommend Jeremy Birn's book 'Digital Lighting and Rendering' for lots info about that: http://www.amazon.com/exec/obidos/tg/detail/-/1562059548/qid=1130461496/sr=8-1/ref=pd_bbs_1/002-5270297-7484848?v=glance&s=books&n=507846

And it looks like there's a second edition coming out next year! Cool.

How you can establish the intensity?

Well, if you use a combination of the Mental Ray physical_light shader, plus the mib_cie_d shader you can use real light temperatures! Then you can use that same colour for the photon intensity. I can go into this more later if you like.

Jammin! Most of it should be similar in Max yes! If something isn't the same (like I know that in Max the sampling settings are different etc) then just ask.

Ok well I'd better stop typing now before my fingers fall off!! More to come later!

goldenarm
10-28-2005, 08:36 AM
Good thread Jozvex! You are a great contributor to these forums, count me in on this one! BTW i miss the SMG pic...any chance of bringing her back? ;P

MainlineX
10-28-2005, 09:18 AM
Heya :)

Awesome thread btw.......This question might seem like a stupid question but I need to ask it, cause I am fairly new to this whole Mental Ray thing....anyhow my question is this....

I opened up the scene and rendered it, everything works fine. The only thing that confuses me is, I checked the shadow attributes on both lights and none of them are casting shadows, yet the shadows are still visible? How does that work? Is that where the mib_shadow_transparency comes into play?? Like I said I am a noob with this sort of thing..hehe...

Any feedback would be greatly appreciated :)

Thnx,
Mills :)

creaminds
10-28-2005, 09:20 AM
Jozvex thank you so much for your info .... it has clearead a part of my brain..... :D

Last night I was looking at the thread hosted here on cgtalk about rendering vray like interiors in mental ray, and I have decided to learn as much as I can about Mental Ray.

I have another question for you:

Where do I start ?

Tnks.

beau
10-28-2005, 01:15 PM
First of all, let me thank you for such a cool thread.
I downloaded your scene and rendered, the result is exactly like the picture above, but I got a warning when rendering said: Warning: (Mayatomr.Scene): CubeShape: empty UV set map1 detected, ignored// I also have another simple scene, an object with regular dgs_material shader which show the same warning when rendering.

Tried searching through cgtalk and maya help but couldn't find an answer, any idea?

Thanks, looking forward for more tips:)

BertMac
10-28-2005, 03:00 PM
Wow cool thread indeed
I was following the" VRay-like interior renders with mental ray" thread as well
but most of the time my brain did not get it or something :sad:
Even the tutorial from Dragon did not work for me
i mean i had the rendering right but i did not know what i was doing or why i was doing it

this lil text of yours clarified allot more already :applause:
Keep it up
thanks

Jozvex
10-29-2005, 02:12 AM
BTW i miss the SMG pic...any chance of bringing her back? ;P

Ha! I know, it's funny like that. Ever since I randomly captured that picture from a DVD (Scooby Doo) I've liked it, but I always thought people must think I'm weird. Some people would write to me asking if I was a girl (sorry guys, hehe) or why I chose such an un-manly avatar. Hello people! In 2006 even the manliest of people should be able to have non-manly avatars if they like, hehe. That's why I thought I'd replace her, to choose something less "weird". But, you (and some others) are right, I should get her back again. It's easy to recognize me from it, plus she had that "looking at the post" kind of look. So, not only will I get her back, I'll give her a resolution boost too.

I opened up the scene and rendered it, everything works fine. The only thing that confuses me is, I checked the shadow attributes on both lights and none of them are casting shadows, yet the shadows are still visible? How does that work? Is that where the mib_shadow_transparency comes into play??

That's a perfectly good question!! No, the mib_shadow_transparency nodes are just letting me brighten the shadows up a bit. Brighter on the cylinder than on the cube especially, because it's a transparent object. Without them both shadows were really too dark for what they should be. The shadows are coming from the KeyLight only, and it's because I've used a physical_light shader on the light. Physical_light shaders always cast shadows, or at least in Maya they do!

I used a physical_light shader on the light because they automatically have a more realistic falloff, and they also help to get GI and Caustics (in this scene caustics only) set at the right brightness/intensity. How? Because the light shader's brightness uses the same 'energy' values as the Photon Intensity back on the Maya light. Once you've setup the physical light to look good in your scene, you can just use the same value (the V from the HSV colour on the physical_light node) as the Photon Intensity to get correct GI brightness. It just helps a bit. When you just use a Maya light by itself you have to sort of guess the photon intensity, which is fine because after all you are in charge of lighting your scene, but it's good to have a realistic match between direct and indirect light.

You'll actually notice that I increased the photon intensity to be slightly (comparatively) brighter than the direct lighting intensity, because I figured if I'm going to use caustics you might as well be able to see it!! Without going too overboard.

Last night I was looking at the thread hosted here on cgtalk about rendering vray like interiors in mental ray, and I have decided to learn as much as I can about Mental Ray.

I have another question for you:

Where do I start ?

Haha! Good question, but not an easy one to answer. For such a great and now popular renderer I don't know why more good quality training and help isn't out there. I haven't seen them myself but apparantly Digital Tutors has a good beginner Mental Ray DVD. I hope by now that everyone knows ~*NOT*~ to buy the DVD for sale on Motiondesign.biz. It's a big gigantic scam. I and MANY others bought that DVD years ago (back when I was just starting out in MR) and none of us ever got it. It was kinda expensive too.

Right now the help file, online tutorials and forums, and the Rendering with Mental Ray book are the best places to start or continue learning. Plus nothing beats hands on practise too of course.

I downloaded your scene and rendered, the result is exactly like the picture above, but I got a warning when rendering said: Warning: (Mayatomr.Scene): CubeShape: empty UV set map1 detected, ignored// I also have another simple scene, an object with regular dgs_material shader which show the same warning when rendering.

It does that in my scenes here too. It seems to be a new error to Maya 7. I have no idea why it happens but I think we can safely ignore it.

When I finally have a bit more time I'll write about how I chose the settings for the FG and caustics etc.

:thumbsup:

MainlineX
10-31-2005, 07:59 AM
Ahhh...Makes sense to me now :) Thnks for that bit of info :)

Mills :)

bgawboy
10-31-2005, 03:16 PM
Regarding the training, we are trying to change that. See http://www.mentalimages.com/2_1_7_0_training/index.html
and the left panel of
http://www.lamrug.org/
which will track the new offerings as soon as I can put the web info together.

I am working on a CG Workshop beginning mr class called Using mental ray.

I will be doing some test runs on some of the material with an actual beginning training class to be held in LA soon. I gave a two hour preview of the class at the annual RFX BBQ event.

The training class will have some differences from the CG workshop, since the training class will be a single-day class. The CG workshop will have more in it because they typically last for 6-8 weeks. So, I think I'm going to offer several 1-day classes that build on each other.

Our other classes are 3-day intensive classes in developing Phenomena or writing Shaders.

Jozvex
10-31-2005, 09:19 PM
Sounds great! Though LA is more than a bus ride away from every other place in the world.

I know it has to start somewhere, but it would be great to have better written info too.

:)

bgawboy
11-01-2005, 03:44 AM
The CGWorkshop class will be an online class offered through the CG Society. No geographical bounds.

Jozvex
11-01-2005, 04:47 AM
Ohhhhh, my apologies on that part then!

creaminds
11-02-2005, 11:07 AM
Putting my hand on practice I have to ask you how I should setup my scene to obtain this kind of effect:

http://www.isism3.ro/render/keytoon.jpg

The image is copyrighted by keytoon animation studios.

I have model something that looks like this:

http://www.isism3.ro/render/logo.jpg

Please help me to light this scene corectly.

Thnks in advance.

anthonymcgrath
11-02-2005, 11:24 AM
hey Josvex - this is a great Q&A thread. i'm quoting you below here (dont know the hyperlink chaff so here it is...


"Now, there are other things you can use for outdoors instead of FG or GI. Some of those are Ambient Occlusion, HDRI using area lights with importance sampling, or HDRI using lightmaps with importance sampling. That last one is particularly good and I've been using it a lot lately. I'll show everyone how in a different post of this thread."


I know its off the subject of your training wheels image but can you elaborate for me (and others) the hdri using lightmaps and IMPORTANCE sampling. this last one you say is particularly good but its the first time I've heard it used. Can you demonstrate this?

on a sidenote guys the raytype node is very cool too for using a lower res hdr to light up the scene and a higher res hdr for refs n rafs :) I think i plugged it into a hdr last time and it worked a treat and speeded things up alot when using fg giving just as good results.

now onto more important things - Josvex.. BRING BACK THE SMG AVATAR - that expression on her face was priceless and spotted amidst everyone elses haha!

ant

Dervish
11-02-2005, 12:43 PM
Ok so yes, it's pretty basic looking. BUT basic is good!! I get a lot of emails like:

Nervous Voice X: "Dear Jozvex, I'm currently in the middle of production on a gigantic scene. There are millions of objects and passes and shaders of all kinds. I have never used GI, FG or Caustics before but my boss wants them and my time is running out. Please help me."

Me Thinking: "Good lord......."




hehe, that could be a mail of mine ^^, but that i actually brought up the fancy lighting stuff myself, doh ^^, im lighting the scene with FG only, no lights, just a selfilluminated white cube( it has reasons for not being a sphere ) around the scene and some "lightcards"(selfiluminated planes, boxes, tubes,...) around the place, now that i have no lights in there, i cant really adjust brightness very well, id like to though, without adding lights in there, without any big hit in rendertimes( its an animation ), any ideas? working with max8 by the way ( same mr version as maya 7 i think )

sporadic
11-02-2005, 01:33 PM
Love it. Thanks for doing this Josvex. I've been avoiding the GI FG and so on in MR so far because every time I got to the MR manuals, I get nowhere (and I'm a computer geek. What were they thinking when they wrote that stuff?)

Anyway, I don't have 7. Can you do that 6.5 thing? I didn't see if anyone else had asked earlier in the thread, but I at least would be interested.

Thanks!

cpan
11-02-2005, 06:43 PM
hi Jozvex, just one question (since i'm too lazy to check it myself ehy :D)

what does the FG Presample Density option do? what is the effect of changing that?


10x

YourDaftPunk
11-02-2005, 07:11 PM
Creaminds, I set up something similar for you to play with. The materials are wrong and the light is a bit harsh (maybe move it away some) but it is close.

http://www.lickmypixel.com/images/keytoon_mr_01.jpg

ajsfuxor
11-02-2005, 10:58 PM
nice thread Jovex...looks like a great follow up to the massive "VRAY like renders" thread.

Keep it up!!

Jozvex
11-03-2005, 04:28 AM
*Sorry, I wrote a gigantic tutorial here, only to discover something doesn't work!!*

If people saw it and wonder where it went, it'll be back in a minute when I figure out what's wrong, haha.

anthonymcgrath
11-03-2005, 07:49 AM
for the thread ppl theres a heap of info on advanced final gather stuff over at www.lamrug.org (http://www.lamrug.org/) titled triks r4 kidz or something - good info but lets not flood Josvexs thread with queries on what they're doing - theres a forum at that url for all that :)

Jozvex
11-05-2005, 02:05 AM
Ok, I think I got everything worked out now! Here's version 2 of the post I had:

Please help me to light this scene corectly.

Thnks in advance.

Hey!! It looks like YourDaftPunk has done a pretty great job! The only thing (apart from the harshness he mentioned) I would change, is that in the Keytoon images their metal appears to be very glossy. To make glossy metal there are quite a lot of options these days, DGS, standard Maya phong or blinn, reflection utilty, and what's Francesca's good one?? I think now it's just part of ctrl_shading but before it was a smaller shader. Ctrl_shading (if it uses the same thing I remember) has an optimization to speed up glossy rendering (not the FG one even).

I know its off the subject of your training wheels image but can you elaborate for me (and others) the hdri using lightmaps and IMPORTANCE sampling. this last one you say is particularly good but its the first time I've heard it used. Can you demonstrate this?

Ok sure!! It's good timing because a new version of the 'system' came out just recently and I haven't tried it yet. So let's try it!!

Firstly, you need to go the website of Jeremy Pronk, a dutch-australian TD who created what we'll use: http://www.thereisnoluck.com/plugins_iblTools.php

He has quite a few cool shaders and utilities!

1. So, download his IBL Tools beta4 package for your platform, and also the new "Maya GUI for lightMapGen.exe" by Seth Hall. Download them to somewhere easy to access.

2. Leave the lightMapGen.mel script for now, we need to edit part of it soon.

3. Unzip the IBL Tools package (maintaining the paths) to where ever you want it to stay permenantly. I highly recommend placing it somewhere where there'll be no spaces in the path (ie not C:\My Stuff\) because it can cause issues. Mine is just on the C:\ drive, and I renamed the folder to LightGen just to shorten it.

4. Inside the new folder are 3 sub-folders, which have sub-folders of their own. For now you can ignore the 'mayaExample' folder because.....I'm doing an example now!!

5. Starting with the 'lightMapGen' folder, open it up and copy/move the MEL script from the 'mel' folder into your user script folder.

6. Go back to the top folder, then into the 'sphericalLight' folder. Copy/move the files from the 'mel' folder the same way you just did for the previous one.

7. Back up one level, and go into the 'mentalray' folder. This part is installing a Mental Ray shader like any other, copy the files into place (we already did the MEL part) and add the required lines to your rayrc file. If you don't know how to install Mental Ray shaders, follow the first page of my SSS tutorial on Highend3D:

http://www.highend3d.com/maya/tutorials/rendering_lighting/shaders/135.html

OK! Just one last bit of installation. You need to open up the lightMapGen.mel file (that we left alone) in a text editor and changes some lines. The first three lines need to be setup to where you installed the referenced files. (it tells you which 3 lines to change). I changed mine to:

source "lightMapGen_loader.mel";

global string $lightMapGenPath = "C:/LightGen/bin/lightMapGen.exe ";

global string $HDRShopPath = "D:/Jared/Programs/HDRShop.exe";

I think it's important to have the slashes going in the right direction, so if you pasted the paths from Explorer like I did, you'll need to reverse the slashes.

8. Save the script and move it into your user scripts folder.

What have we just done?? Why are we even bothering with this package of tools?? I suppose I probably could have told you before all these steps.....oops!

Well, you know how when you use HDRI with Final Gather or the Emit Light feature of the IBL node, it sends out light from the big IBL sphere? Well this does the same thing, only better. Better because it uses 'importance sampling'. I'm not an expert on this at all, but the idea is that instead of sending out an equal amount of light/FG samples from the whole sphere, it calculates (beforehand, into a lightmap) which areas of the HDR image will actually have the greatest impact on the scene lighting, and so it concentrates most of the samples to come from those areas, and then hardly any (or none maybe) from totally dark areas. This means that way less samples are used (so it's faster), and the quality is much better because the samples are concentrated on the right areas.

The sphericalLight Mental Ray shader is like a new IBL node for this type of lighting. The scripts are creating all the interface parts inside Maya. Also, there is a second mode available (I haven't tried it yet) that creates a dome of real Maya lights instead, if you don't like the Mental Ray IBL thingy.

Now to actually use it! First I'll need a HDR image in the right format. I'm sure most people have used HDRI around here but, for those that haven't, download the Angular Map of the Eucalyptus Grove scenery from this page of Paul Debevec's (creator of HDR imaging) website: http://www.debevec.org/Probes/

An Angular Map is round, which won't work for us in Maya, so you also need to download the free (for non commercial use) and very good program HDRShop from another of Paul's pages: http://gl.ict.usc.edu/HDRShop/

I actually never realised it was non-commercial before today.......eek! Luckily though I've never used it for any work related projects, phew! For a commercial copy of version 2.0 (has quite a few more features) it costs $600 US for a two year license! Woah. Anyway, back to the subject.

Unzip HDRShop.exe and run it (doesn't install, it just runs itself). Drag your Angular Map into the HDRShop window to open it. HDR images are so cool because they store MUCH more information than your average LDR jpeg or bmp image. Huh? It doesn't look so fancy to you in HDRShop you say?? That's because our monitors currently don't display anywhere near enough range. All we see is one exposure of the image. To prove it, have the image open and press the + and - buttons on your keyboard.......the image exposure changes, either revealing more information about the bright areas or the dark areas. This Eucaluptas image I've chosen is already pretty darn bright initially, so you can really only 'stop' down effectively. So anyway! We need to convert this round image into a rectangular (longitude/latitude it's called) image.

9. To do that, in HDRShop go to:

Image > Panorama > Panoramic Transformations

On the left hand side of the dialogue options, change the Format from Mirrored Ball... (you would use that if the HDR image had been created by taking photos of a chrome ball etc, basically the way us mortals have to do it. Most of Paul's were taken with a proper light probe device, which is better and creates an Angular Map) ...to "Light Probe (Angular Map)". On the right hand side, change the Format to "Latitude/Longitude". Leave everything else alone and hit OK.

10. Use:

File > Save As

To save the image as a new HDR *Floating Point TIF/TIFF* image. It's important that the image is saved as a tif because it's the only format that Jeremy's utility can use. Now, if you were going to just use Maya's IBL node for HDRI, you've got the only image you need (in either tiff or HDR format), ready to go. We however are setting out to use importance sampling of a lightmap, so we'll generate that map now. Close HDRShop.

There are two ways to do this, the original way is via the command line, which is how I've done it in the past. Now however it can be done through Maya, so I'll opt to go that route this time because, frankly, no-one likes using command lines do they?? Hehe.

10b. (I added this step in after writing all the rest, hehe). Move your HDR .tif image into the Sourceimages folder of your currently set Maya 'project'. If you're not using a 'project' it doesn't really matter, it just means 1 extra step later which I'll mention.

11. Restart (to refresh the scripts and MR shaders) or open Maya.

12. Type lightMapGen into the Maya command line (eek! a command line after all!) and press enter. If you setup the paths (in that script we edited) correctly, you should get an interface window. I hope you did!!

13. Click the 'Browse for .TIF File' button and navigate to your image to load it.

14. Ok, the settings:

Sampling Type: Median Cut

Through the GUI this is the only one you can choose, but through the Windows command line there are other options. My limited understanding is that this is currently the best method. Paul Devebec seems to be talking about it in his current projects so I think it's safe to assume it's the way to go. 'Median Cut' is the method of importance sampling (which I talked about earlier). I won't go into details because I don't really know them!! Hehe.

Number of Samples and Interleaved Samples: Ok...the 'Number of Samples' is how many pieces/regions the HDR image will be divided into by the Median Cut importance sampling. I say divided but they aren't equal divisions. It looks at the image and goes "hmm, that thing that looks like a Sun will probably be *important* to the lighting", and turns than Sun area into an important region of the image. An importance sample. Every part of the image will end up being in one of the 32 (by default, as you can see in the GUI) sample areas, just the dark parts will be way less important. Was that way too complicated?? Just hold out a bit longer.

The Interleaved Samples will be like sub-'Importance Samples'. It'll split all the main areas into this many sub areas, specifically for generating good quality shadows without needing a high amount of main importance samples. This option wasn't here in the last version I used I don't think, so if your shadows looked artifacty but the overall lighting was nice...too bad, you had to increase the number of main samples to remove the artifacts. So now instead of 128 main samples I probably only need 32 main samples and then perhaps 8 interleaved samples for the shadows. Sounds much better to me!!

*ADDED NOTE*: After I wrote all this I discovered that the lightmap creation utility would crash on me, every time, if I told it to use more than 8 Interleaved Samples. This could be a bug with the current beta, or a bug somehow specific to my computer because I'm pretty sure that you should be able to use way higher values than 8.

To help visualize all that crazy-talk, look at this page: http://www.thereisnoluck.com/downloads/iblTools/docs/lightMapGen_Example.html

15. Ok so lets go with my random guess, 32 samples and 8 interleaved samples. Leave the Normalize setting alone and only turn on "Write Diag Images" if you want to see how your HDR was divided up.

16. Hit the 'Calculate' button!!

Wait a few seconds and hey presto the lightmap has been generated! In a new replacement window we have some new buttons. Ticking either the Spotlights or Directional Lights buttons' is only needed if you don't want to use the Mental Ray shader method, which I do! So leave them off.

17. Hit the button to load the lightmap as a Spherical Light!

The window will vanish and now you'll have 2 things. A Point Light with a custom area light shader (sphericalLight1) applied to it, and a big fat sphere surrounding the scene (no offence to the fat spheres reading this).

The sphere is useful because it has kindly been setup with a Surface Shader and a File Texture node already attached to it. I forgot to mention (oops) earlier that Maya cannot display floating point TIFs in the viewport. So, if you use HDRShop to save yourself a copy of the Longitude/Latitude-ified TIF in .HDR format, you can load it into the supplied File Texture node and have a nice visual reference of the environmemt. The same as if you used a Maya IBL node really. At first the loaded HDR texture will be displayed with really bad quality (at least in Maya 7 it does), so on the Surface Shader node under the Hardware Texturing section, set the Texture Channel to Out Colour (it may not actually show the texture at all until you do that) and the Texture Resolution to Highest. That will increase the resolution to 256x256 pixels, which is better, but still not great, To increase the resolution even more (most people don't know this!), go back to the File Texture node again, and now under the Extra Attributes section a new attribute has been created! It lets you turn up the texture resolution to whatever you like! I've set mine to 512x512.

Phew...it's hot here today in Canberra, Australia!! Ahem.

Onto the light shader!

18. Either navigate yourself to the light shader through the Attribute Editor or Hypershade if you know how (or the Hypergraph, Multilister or Outliner, haha), or type the command:

select -r sphericalLight1;

Into Maya's command line and hit enter. Let's go over the options in the Attribute Editor.

Light Map Data File: The place to load the generated lightmap, which, if you moved the HDR image into the Sourceimages folder of your project, has already been done for us. If you didn't do that (it'll still look like it's found it), you need to click on the file-browsing-button and find the lightmap yourself. You should find it in the same folder as the HDR .tif image it used.

Mode: This is how the light will be sent out from each sample of the lightmap I think. It doesn't mean it'll use actual Spotlights or Directional Lights, you're just choosing whether you want parallel (directional) or non-parallel (spotlight) rays. I think Directional is slightly more realistic, but apparantly there can be strange shadow problems sometimes when using that mode, in which case you should use the Spotlights mode. To be safe I just use the Spotlight mode.

Intensity: The brightness of the image based lighting. I often need to increase this number to something like 5 or more.

Radius: The 'size' of the environment. The radius is there because the environment in this case isn't infinitely big. You'll need a bigger environment for a bigger scene. The radius is initially the same size as that of the Big Fat SphereTM, but if you change the size of one or the other, they don't affect each other. That is important to remember...because, right now if you rendered your scene with reflective objects in it, you would notice that the HDR image doesn't appear in the reflections. Why? Because the Big Fat SphereTM has been set to "No Trace" on it's transform node under the MR section, and to "Visible in Reflections = off" on it's shape node under Render Stats. Why!? Because, anything that is raytraced will cast shadows, and if the Big Fat SphereTM is raytraceble AND is either the same size or smaller than the radius of the sphericalLight, it wil cast shadows onto everything making the scene totally black. SO, if you want the HDRI to show up in reflections (most people do) then you need to turn back on all the raytracing related settings of the Big Fat SphereTM and also make sure it is larger (doesn't have to be by much) than the radius of the sphericalLight. *takes deep breath in....and out...*

Calculate Shadows: You see, when an object is blocked from light by another ob... :p

Occlusion Shadows: This is turned on by default but I often turn it off. This shadow mode is like a hybrid between your average ambient occlusion, and 'proper' IBL shadows. It's occlusion that changes the fuzziness of the shadows depending on what the lightmap says to do. While this is on, you'll also still get some 'proper' shadowing from the IBL. This option is good if you don't want to use any (or many) 'interleaved samples' taken from the lightmap, which I guess is slower for scenes of great complexity and with a detailed HDR image. Turning it off let's you use only Interleaved Shadows.

Occlusion Shadow Samples: Just like on the Dirtmap or Mib_amb_occlusion shaders, the quality of the occlusion.

Occlusion Min Softness: Basically this is the sharpest an occlusion shadow can be. If you use the occlusion method and you think some shadows are too sharp, turn this up! It's maximum is 1.

Under the Interleaved Sampling section (for 'proper' HDR generated shadows) we have:

Interleaved Shadow Samples: This is the maximum number of ISS you want to use. If you remember I said I'd use 8 on my image, so clearly with the default setting of 64 all 8 will be used. If we set this ISS number to 4, only 4 of my available 8 would be used. You can tweak this down (especially if you used way more IS to generate your lightmap) until you get a nice trade-off between speed and quality. Bad quality Interleaved Shadows are grainy, like low quality area light shadows.

Interleaved Shadow Sampling: The method used during rendertime to put the IS to work. Leave it on Mental Ray I say. I don't know what Mental Ray does but I'd say that chances are it would try to keep better "temporal coherence" (same-ness between frames) if you rendered out an animation than the 'Random' mode would. Less flicker during animation is good.

Diagnostics: No idea! Probably tells you some technical stuff in the Output Window when you render.

AND THAT'S IT!! (almost)

Go forth and create a nice outdoor scene and try it out!! *BUT* you need to use Mental Ray shaders on your objects because sadly Maya default shaders go strange. Also, objects must be visible to raytracing (they are by default) in order for them to cast HDRI generated shadows.

If your shadows, or even just the lighting is too low quality in your scene, just follow the first part on generating the lightmap again (using the lightMapGen command) and use higher settings. If you generate a lightmap with the same name as the original you shouldn't have to change the path on the already-created light shader. Just render again.

Interleaved Shadow Samples need to be increased if the shadows are grainy (or occlusion samples too if you use that mode). The main number of samples need to be increased if you think your shadows look too..."banded". They'll look like may seperate shadows overlapping each other rather than one smooth shadow.

Two other things to note are that, a render using 32 main samples can look quite different (lighting wise) from a rendering using 128. I guess this is because with 128 samples, a lot more of the HDR image is being included in the lighting. The other thing is that you can change the overall sharpness of your lighting/shadows by changing the radius of the sphericalLight. Unlike FG (pretty much anyway), you can get quite sharp shadows using this system from the main light sources.

Here's a render I prepared earlier (previous beta version though):

128 main samples. Both the dragon and floor are 3D, and any noise is from the ground procedurals or the jpeg compression because it came out perfect!

http://www.jozvex.com/temp/Dragon.jpg

I hope all of that made sense and works! I have rendered animations using this as the sole method of lighting, and there was NO flicker even on quite low settings!

cpan
11-05-2005, 07:54 AM
hmmm, interesting shader you found... thanks a lot for taking your time to explain this beauty, Joz :thumbsup:
btw, it would be nice to see a comparision between this one and the default IBL hehe :D


Thanx a lot!

AndreasMartin
11-05-2005, 02:17 PM
The way the original HDRI is treated to create the lightsources is totaly different between mayas ibl node and the lightmapgen toolset. LightMapGen offers different sampling methods. A very fast one developed by Debevec [Deb05] and the other developed by Kollig [Koll03].

See the images below to take a look at the differences between the thre approaches to generate light sources from an HDRI.MAYA IBL NODE
http://img105.imageshack.us/img105/7471/mayaibl5pk.jpg
Figure 1: light generation through Maya IBL Node [Bert03]

The U and V samples for the emit light options just define how many light sources will be generated evenly distributed over the complete HDRI. Its like resampling the HDRI down to a resolution that is defined by width = U and height = V. The problem is that very bright lightsources have the same weighting as shadow arreas while genrating lightsources.

Median Cut Algorithm for Light Probe Sampling

http://img105.imageshack.us/img105/5229/debevec053nu.jpg
Figure2: Light generation through Median Cut [Debe05]

Fast HDRI sampling and light generation. Bright light sources and areas in the HDRI have a higher weighting then shadow arreas. So more lightsources will be generated in bright HDRI areas.


Efficient Illumination by High Dynamic Range Images
http://img382.imageshack.us/img382/6667/kolligefficientilluminationbyh.jpg
Figure 3: light generation form HDRI using Voronoi Tesselation [Koll03]

Not as fast as Debevecs solution but more accurate in lightsource generation. The voronoi tesselation runs as an iterative process and needs more time for generating the light sources. The area where sun is positioned in the HDRI is much higher weighted with light sources as the trees and the grassfield.


All images belong to their originator and where taken from free available papers and webpages. For more information see the quoted proceedings.


Sources:

[Bert03] Maya IBL Node (http://www.jupiter-jazz.com/wordpress/wp-content/data/tr4kv2/html/chapter1-FG.html)
[Deb05] DEBEVEC , A Median Cut Algorithm for Light Probe Sampling (implemented in LightMapGen), 2005 (http://gl.ict.usc.edu/research/MedianCut/)
[Koll03] KOLLIG, Efficient Illumination by High Dynamic Range Images (implemented in LightMapGen), 2003 (http://www.uni-kl.de/AG-Heinrich/EIbHDRI.pdf)

thematt
11-05-2005, 04:30 PM
did I heard awsome thread?..oh yeaahh :deal:

thanks for all that Jozvex, always a pleasure reading all you resources.

cheers

Ps:
me too like your SMG avatar..so you in fact. :) :buttrock:

doms
11-06-2005, 01:20 PM
Sorry if its going off the IBL topic but does anyone know how to stop Final Gather recomputing after the rebuild FG map option is turned off? it happens when i change the render resolution/ sampling for final render.
My basic workflow if set BSP- set GI map (rebuild off) -set FG map (rebuild off) -render final textures/high res/ higher samples (e.g -1,1). My last render took 20 mins to compute FG (for 800x600 render). I've had loads of problems with renders looking different with res changes (trying to final render 8000x5000, in 4 -reg regions from eg 640x480 tests). So i could do with any basic tips for high res workflow (can't find much specific info). Thanx...

doms
11-06-2005, 02:07 PM
just to add that i'm stopping GI rebuild after i use a suitable IBL ambient texture then changing the texture to the image i want visible in reflections (for artistic reasons) for the final render. Clear? hmm... well everyone uses Maya differently.

bgawboy
11-06-2005, 03:39 PM
Try rebuild freeze. Rebuild off is more like rebuild append.

Then, afterward, check your FG diagnostics. Is it adding red points?

If you want the FG to not add too many points, but you are changing resolution, I would suggest not using FG view for the radii settings. Keep the radii in world units. This might only occur in Maya 7, because FG view doesn't work in 6.5.

creaminds
11-07-2005, 06:01 AM
Ok, I think I got everything worked out now! Here's version 2 of the post I had:

Hey!! It looks like YourDaftPunk has done a pretty great job! The only thing (apart from the harshness he mentioned) I would change, is that in the Keytoon images their metal appears to be very glossy. To make glossy metal there are quite a lot of options these days, DGS, standard Maya phong or blinn, reflection utilty, and what's Francesca's good one?? I think now it's just part of ctrl_shading but before it was a smaller shader. Ctrl_shading (if it uses the same thing I remember) has an optimization to speed up glossy rendering (not the FG one even).



Jozvex thanks so much for your reply.

What is Ctrl_shading and is there a tutorial on how to use it ?




PS: this is an awsome thread and everybody should thanks you.

edit:
I have added my photo:
http://www.magicpixelid.com/renders/my_logo.jpg

Copying yourDaftPunk's scene I got this result. I'm interested to find out how can I setup the shadow to be more darker and softer, and how can I setup the ctrl_shading tp render the surface?

Taking it in small steps at a time

HowardB
11-07-2005, 09:16 AM
Creaminds, I set up something similar for you to play with. The materials are wrong and the light is a bit harsh (maybe move it away some) but it is close.

http://www.lickmypixel.com/images/keytoon_mr_01.jpg

Hey YourDaftPunk, did you use higher FG or GI settings? Because when I rendered your scene out I got this:

http://bryan-howard.com/Temp/keytoon_chairs.jpg

EDIT:

now if i render out the same file and only turn off FG i'll get this!
http://bryan-howard.com/Temp/keytoon_chairs_no_FG.jpg
How can this be? I thought final gathering was suppose to be used for helping to smooth the global illumination spots, not making them worse! Anyone else getting the same results that Im having?

Matadŏr
11-07-2005, 03:56 PM
Hi there

Jozvex youre doing a great job here, many thanks for this helpful thread and all the work you put into it.
I have a doubt and i couldn't find an answer for it in this forums, how do i use the ctrl_rays plugin by franscesca? I hope you don't mind posting this in here...
And great info on those sampling methods on HDRI maps!! Creative those images and aditional text on that subject were very informative also.
This thread is already great, keep it coming please! :thumbsup:

greets

doms
11-08-2005, 01:35 PM
Thanx bgawboy, that Freeze FG info sorted out a lot of problems.

Jozvex
11-09-2005, 02:44 AM
Arg! I typed up a reply to some questions but then Firefox crashed before I could finish posting!

im lighting the scene with FG only, no lights, just a selfilluminated white cube( it has reasons for not being a sphere ) around the scene and some "lightcards"(selfiluminated planes, boxes, tubes,...) around the place, now that i have no lights in there, i cant really adjust brightness very well, id like to though, without adding lights in there, without any big hit in rendertimes( its an animation ), any ideas?

Well, why are you use FG only, with no lights? Is it because you need 'objects' to create the light? Maybe you should use Francesca's ctrl_geolights shader pack instead:

http://forums.cgsociety.org/showthread.php?t=213012

It lets you use any object as a real area light. It has lots of controls for light falloff, texturing the intensity etc. Or if you still want to do it with FG only, you could use Francesca's ctrl_irradiance shader:

http://forums.cgsociety.org/showthread.php?t=171173

It let's you do lots of tweaking to the irradiance of your shaders.

Anyway, I don't have 7. Can you do that 6.5 thing? I didn't see if anyone else had asked earlier in the thread, but I at least would be interested.

Sure. Here you go:

http://www.jozvex.com/temp/FGTuning65.mb

;)

what does the FG Presample Density option do? what is the effect of changing that?

Well, Final Gather works in two phases. First it does the FG Presample pass, which is what you can see if you turn on the 'Preview Final Gather Tiles' option in the Render Settings. Then when MR renders the scene properly, it will cast any extra FG rays that it needs, as it goes.

In the FG Prepass, Mental Ray creates a grid of dots/points over the whole image, that it uses to determine where FG rays will be shot from in the scene. (example, whatever surface point is directly 'behind' one of the FG grid dots will shoot out FG rays). The grid of dots is set out like triangles (or some say hexagons but it's the same thing), rather than squares like a normal 'grid'. Like this:

http://www.jozvex.com/temp/FGTuningGrid.jpg

That image isn't really correct, I just quickly made it in Photoshop. There should usually be many more dots and in 'real life' they're really tiny.

Now, as a side note here, everyone has probably read that in Mental Ray 3.4 (Maya 6.5+) the Final Gather is better/different. Well, it's because of the grid of dots (and some other little things). In Mental Ray 3.3 and lower, the grid of dots would look close to my image above. If you think about it, see how the side or the top of the brown box would get less FG sample points because they aren't facing towards the camera? The dots get spread out really far in the Z axis. That means the quality of their FG would be much less than say, the front of the box or the back wall.

In Mental Ray 3.4 there would be less or more dots depending on which way objects are facing compared to the camera, because MR tries to get even coverage and if something is facing sideways like the side of the box, it will get more dots so that they are evenly spaced along it's depth...if you get what I mean, hehe. The grid is adaptive. It's much better because then you don't need to turn up the FG accuracy of the whole image just to fix those surfaces that got less grid dots.

Haha, it all sounds confusing but it's not really. I can re-explain parts differently if people want. :scream:

So anyway, the density of the 'grid of dots' is controlled by the Min and Max radius settings, and also somewhat by the Final Gather Rays setting. So if Mental Ray thinks "hmm, they are using quite small radii settings" it will make the 'grid of dots' have a higher density (more rows and columns of dots). More density in the grid means many more areas of the scene will receive FG information, to then be interpolated between the other points.

*Somewhere* I remember reading that there are specific radii settings that the density will change at. Like "if the Max radius is under 1, the density will be doubled", or something like that, but I can't find it anywhere!

The 'Final Gather Presample Density' is a multiplier to the density of the grid of dots. So the default value of 1 says "use whatever MR thinks based on the radii". Or you can increase/decrease the density yourself using higher/lower numbers.

DO NOT type in 0!! Hehe, I tried that and MR just rendered forever.

You can use the FGPD (FG Presample Density) to help strike a good balance between speed and quality (like everything else in rendering!). You could use less density but higher Final Gather Rays, to get fewer-but-more-accurate samples, or more density with less Final Gather Rays to get more-but-less-accurate samples.

For example, (I won't show images because they look the same) I can get the same quality image of the 'simple scene' by using a FGPD of 0.3 with 750 rays, or FGPD 10 and only 30 rays. The second option is slower, but it might have less flicker in animation because there are *WAY* more areas of the image that contain FG info.

You can see the 'real' grid of dots, plus all the extra FG samples by turning on 'Diagnose Final Gather' under the Diagnostics section of the Render Settings. If you see red FG dots (instead of green), they were the samples that were created while rendering the scene, after the main FG Prepass. Those red dotted areas are the most likely place to flicker first.

See the images below to take a look at the differences between the thre approaches to generate light sources from an HDRI.

Thanks for that!! :thumbsup:

What is Ctrl_shading and is there a tutorial on how to use it ?

Ctrl_shading is yet another fantastic shader by Francesca and her co-workers. You can get it here:

http://forums.cgsociety.org/showthread.php?t=209991&page=11&pp=15
(in her big post on that page)

I haven't used it a whole lot yet (bad me!!) but it's a shader with a few different shading models on it, and it also does the fastest glossy reflections of any shader (I think?). You use it by connecting it's 'Compound' attribute to a colour slot on a shader (like to a Surface Shader for example). Because it's a complex shader you can't just attach it directly to your object, it has to pass through another shader (Maya limitation I think).

I'm interested to find out how can I setup the shadow to be more darker and softer

Well, to make it darker I think you could attach an Mib_shadow_transparency shader to the Shadow Shader slot of the object's SG node, then set the colour of that to a slightly negative black (below 0 in value).

To make it softer you could use an area light, or if you already are, make the light bigger.

I have a doubt and i couldn't find an answer for it in this forums, how do i use the ctrl_rays plugin by franscesca? I hope you don't mind posting this in here...

:) You use it like a pass-through node. That means... (if we look at this example image I made):

http://www.jozvex.com/temp/Ctrl_RaysTest.jpg

...that if, like in this example you want an object to have a different shader or texture in reflections, you plug the Ctrl_Rays node into the Color slot, then two different textures into the Ctrl_Rays. The textures pass through this node. The checker texture went into the Eye Ray slot (eye rays are what see the scene first), and a 3D crater texture went into the Reflection rays slot. You need to also tick the box above the slot you wish to use.

Ctrl_rays gives you a lot of flexibility!!

sacslacker
11-09-2005, 03:04 AM
Man, thanks for this thread! I really love this forum and the fact that there are many Mental Ray power users/guru's willing to help, makes it that much better!

Thanks to Jozvex and all the other guys (Fran,Pixero,Floze, etc..).

slipknot66
11-09-2005, 03:23 AM
Guess this was said before.. but you can use the ctrl_rays to exclude the Blurry reflection from the FG calculation.. making things faster

Matadŏr
11-09-2005, 12:14 PM
Jozvex and slipknot66
many thanks for helping :thumbsup:

greets

elvis75k
11-09-2005, 12:26 PM
Then what's better? ctrl_rays or ctrl_shading?
crtl_rays have some unexplained parameters (eye, fg) -
I'm working on a project right now and..
i have to thanks lord for this thread!! Keep it cool!

Komarcic
11-09-2005, 12:30 PM
oh maaan i cant believe i havent seen this thread before!!
i've sent a PM to Jozvex quite recently about making a tutorial similar to this one, but man this is awesome.

yo Jozvex i love you man!! :)

Matadŏr
11-09-2005, 12:52 PM
Man, thanks for this thread! I really love this forum and the fact that there are many Mental Ray power users/guru's willing to help, makes it that much better!

Thanks to Jozvex and all the other guys (Fran,Pixero,Floze, etc..).

Yes indeed, its active groups of users such this one thats pushing the MR in Maya in the right direction.
Take the first implementations of it, when the life of the users was difficulted by the lack of proper manuals and various limitations on the "bridge" itself. If it wasnt this helpful group of people talking and working together our rendering lives would be on a medieval dark age... thinking about VRay all the time!!! :rolleyes:
And we all see the result, better and better works by everyone. Without too much crying about the software faults and all that type of things. Bravo :thumbsup:

in appreciation of this great group of users

Komarcic
11-09-2005, 02:23 PM
i also got a question for you Jozvex:

i was wondering, are there PROPER and UNPROPER ways of building geometry that might affect the rendering?
so, how to build geometries to achieve better rendering results?

for instance, does it make a difference if you build a wall with a single poly or more polys? because when using shadow maps it's a good idea to build walls as real ones...with thickness.

also, perhaps if u might now, its not connected with GI or FG, its about beveling edges to get good responses to lighting. so? any tricks or tips?

thanx

slipknot66
11-09-2005, 03:40 PM
About using the ctrl_rays with blurry reflection, a simple example.. create a phong material, lets say that it will be the floor material, connect the phong material with blurry reflection to the eye slot of the ctrl_rays shader, make a copy of the phong material(the same you connected to the eye) and connect to the fgprecomp slot of the ctrl_rays shader, but this one without the blurry reflection effect.Dont forget to check the "enable", under the global illumination tab of the ctrl_rays shader. Thats it, now when you render your scene, the blurry reflection will be excluded from the FG calculation, and will be calculated during the render (raytraced) time only.

anopheles
11-09-2005, 08:26 PM
I'm just looking at the lightMapGen; stuff!

And I ran into a problem! My .exe does not create a *.lm file!
I check the path a billion times! But it doesn't seem to work!

This is what the script editor gives me:

lightMapGen;
Output Calculation Parameters:
Input : K:\Maya\projects\horn\sourceimages\grace_probe.tif
Samples : 32
Interleaved : 8
Sample Type : Median Cut
Normalize : 1
Write Diag : 0

LIGHTMAP LOCATION: K:\maya\projects\horn\sourceimages\


But no lm file in the lightgenfolder! Maybe I'm using the wrong hdr file!

Will check that!


Okay, ckecked out the HDRI Map, seems there was a problem in converting it to
a angular map! Mhhh to bad the SE didn't tell me something!

Tried the command line way and got this:

K:\Apps\LightGen\bin>lightMapGen.exe -in gayhawk.tif -s 32 8
lightMapGen v1.0b4 by Jeremy Pronk
see www.thereisnoluck.com

Loading image as latlong map...
Calculating median cut tree...
mediumCutTreeElement::subDivide() failed! Try increasing the size of the input i
mage
An error occured while attempting to build the median cut binary tree...
Median cut failed... try using -resize to increase the image size.


Can you guys give me a HDRI which worked for you?

cpan
11-10-2005, 06:14 AM
it seems the lightMapGen app likes only big HDR's. Try resizing your HDR in HDRShop (Image>Size>Double Size) and then run the lightMapGen again, it might work.

hope it works

one
11-10-2005, 08:42 AM
I am loving this thread! keep it up! don't stop people!!:thumbsup:

anthonymcgrath
11-10-2005, 10:07 AM
Hi Josvex
sorry I never got back to posting back up after that extensive info on the lightmapgen tutorial you wrote up for everyone. Dont know how many people actually tried it (I'm guessing not many judging by the lack of test pics from bods!) but I've had a play and dont know if I'm getting what I shoud be...

installation went smoothly and all works fine - even creates a breakdown image of the lightpoints it creates from the hdr so thats cool :)

however - the actual 'what its doing' with my renders is really quite painful - I feel like I'm back working with the first version of mental ray that was chucked in with maya a while back (how painful was all that?!)

heres some pics - sorry about the low quality and image size - I only get a few minutes to test this stuff :(

this first pic is the straight LM generation - set the intensity to 4, normal lamberts are on the yellow & red balls, chrome middle (fully reflective blinn). the white is an mib_illum_lambert (dont know what that is but it was the closest I could find to a lambert in the mr panel that I could plug into the sg material node - I did it to test what you mentioned about normal maya shaders going awry but they seem better than this one!). final gather is switched on with 200fg points, 3+6 min/max
http://img.photobucket.com/albums/v90/anthonymcgrath/LightMapGen01.jpg

in this second image I plugged the copy of the .hdr into the file node of the surface shader which I found in the hypershade. With the .hdr files intensity and the spherical light intensity it came out pretty bleached as the .hdr seemed to be multiplying the light :(
http://img.photobucket.com/albums/v90/anthonymcgrath/LightMapGen02.jpg

in this third version I tweaked the colour balance of the .hdr to get a less bleached reflection.
http://img.photobucket.com/albums/v90/anthonymcgrath/LightMapGen03.jpg

I dont know if I'm approaching this the right way. Just thinking on my feet for a minute would the solution be to use the spherical light to 'light' the environment and an IBL node to cast reflections? I know I could use the reflected colour slot in the blinn but I'm trying to think about a global scene rather than making shader specific effects - hope that makes sense. In all honesty Josvex I'd probably prefer to just do a dirtmap pass, a reflection pass and composite hehe! francescas object light plugin works great too and is fast - thats the prob with rendering ..speeeeeeeed :(

on a final note - ITS DARNED SLOW! I had to drop settings in fg, aa and refs/rafs just to get this to segment to render under two minutes a frame! not very production friendly :(

ant

Jozvex
11-11-2005, 12:47 AM
Then what's better? ctrl_rays or ctrl_shading?
crtl_rays have some unexplained parameters (eye, fg) -
I'm working on a project right now and..
i have to thanks lord for this thread!! Keep it cool!

Neither one is better than the other, they do different things! Ctrl_shading is a material shader, like a Blinn/Lambert/etc, just it has some nice abilities like adjustable glossy reflections and the ability to setup passes/buffers easier because the diffuse, specular and reflectivity are seperate from each other.

Ctrl_rays is more like a utilty. You can attach it to a shader's attribute (like colour) if you want control over how the attribute will appear to the different types of sampling/tracing that MR can do. You can also attach it straight to the SG node of a shader if you want totally different shaders to appear in the different sample/ray types. An example of using each attribute could be:

I've made another example image in which a Ctrl_rays is connected straight to a sphere's SG:

http://www.jozvex.com/temp/Ctrl_RaysTest2.jpg

As you can see I've labelled which slots I've put different coloured DGS shaders in (could be any shader including Ctrl_shading), so you can see the effects. In order to use the Shadow slot though, I had to use an Mib_shadow_transparency instead of a DGS, and I also had to connect the Ctrl_rays node into the Shadow Shader slot of the SG. You would do the same equivalent connections if you wanted to use the Photon slot I think.

So both are good nodes and can be used together!

yo Jozvex i love you man!! :)

Really? Are you looking to start a long term relationship?

:p

Hehe, I have to go now I'll write more replies later.

=====
Edit: I should have said that, for the shadow shader I used a fractal texture for the transparency, so the shadow is patterned from that, it's not the pink FG being blotchy.
=====

rwijaya
11-11-2005, 07:54 AM
finally, a thread that shows the tricks in MR setup, not as those others that just showing off stuff with no helpful explanation.

cool thread jozvex

KUDOS

floze
11-11-2005, 04:09 PM
Can you guys give me a HDRI which worked for you?
I tried the lightmapgen with all the angular lightprobes I got from debevec.org, and they all worked. Here's a step by step:

1) Open the hdr image in hdrshop (http://www.hdrshop.com)

2) In hdrshop, goto 'Image> Panorama> Panoramic Transformations'

3) As source image format select 'Light Probe (Angular Map)', provided that your source is an angular map

4) As destination image format select 'Latitude/Longitude'

5) Be sure 'Use Suggested Aspect Ratio (2:1)' is set to ON

6) Choose a resolution for your new hdr image - 1024*512 is usually a good choice

7) Press OK

8) With the newly created image in front of you, goto 'File> Save As'

9) In the popup menu, press 'Floating Point Tiff (*.TIF, *.TIFF)'

10) Save your file - youre ready to proceed with lightMapGen.exe now

11) Copy this file: lightmapgen.bat (http://individual.floze.de/fileadmin/files/cgtalk/lightMapGen.bat) into the folder where lightmapgen.exe is located at

If you cant download the file, here's the simple code:
@echo off
set /P samples=Number of Samples:
set /P interleave=Interleave Levels:
set /P custom=Other flags:
:iterate
@if %1 == "" goto stop
lightmapgen -in %1 -s %samples% %interleave% %custom%
@shift
@goto iterate
:stop
Simply copy and paste it into a blank text file and resave it with .bat instead of .txt extension.

12) Now drag and drop your newly created hdr image over this .bat file's icon

13) A command prompt pops up, asking you to input number of samples

14) Put in an appropriate number - the value depends on whether you decide to use interleave samples or not. I guess there's no reason not to use interleave sampling though. Allthough I dont have the technical know-how on what interleave sampling actually does, I can tell that it let's you use lower sampling rates if needed (or sufficient) to speed up rendering, or increase them to raise quality - you dont have this option with a fixed, non-interleaved lightmap. More on this later. :deal:

To cut a long story short: Use a lower value like 32 for an interleaved lightmap, but higher value like 64, 128, 256 etc. for standard lightmap

15) Press ENTER

16) At the next promt, if you decide not to use interleaved lightmaps, press ENTER - else, fill in an appropriate number for the amount of interleave levels. Again, I dont have technical details on what they actually do, but by comparing lightmap filesizes I assume that the interleave levels value acts like a multiplier to the actual samples in the lightmap - so an interleaved lightmap with 32 samples and 4 interleave levels has theoretically the same maximum quality as a 4*32 (=128) samples lightmap.

So, if you put in high values for the interleave levels, it would not only take very long to calculate, it probably would also spit out an error like 'mediumCutTreeElement::subDivide() failed! Try increasing the size of the input image'. More on this later. :deal:

And again, to cut it short: If you used 32 samples for the lightmap, try a value like 4 for the interleave levels and press ENTER

17) Fill in custom flags. This can be, for example, -normalize or -normalize2, -writeDiagImages and/or writeDensity, whereas the latter two are for diagnostic purpose only. Normalize normalizes the total light intensity to 1, normalize2 even crunches the intensity to 0->1 range - this both is helpful if you have quite bright hdr images and dont want to use very (sometimes extremely) low values for the intensity, like 0.00001 or alike.

And then, there's another important flag: '-resize'. If you used lightMapGen before, you probably ran into this problem:
mediumCutTreeElement::subDivide() failed! Try increasing the size of the input image
An error occured while attempting to build the median cut binary tree...
Median cut failed... try using -resize to increase the image size.
This apparently happens because the input image has too low resolution for the program to go on. This can be solved by temporarly increasing the image in memory only before it's being processed by the '-resize' flag, whereas the given value acts like a multiplier to the current resolution - let's put you have a 1024*512 hdr image. A resize value of 5 would resize it to a resolution of 5120*2560! Thats damn huge! So you need to be careful with this too. If lightMapGen fails with the error above, a resize amount of 3 or 4 is usually sufficient. If it still fails, try decreasing the samples and/or interleave levels.

18) Press ENTER

It should look like this:
http://individual.floze.de/fileadmin/files/cgtalk/lightmapgen.jpg
This equals to a command line that would look like:
C:\lightMapGen>lightMapGen.exe -in C:\Images\debevec\stpeters_probe.tif -s 32 4 -normalize -resize 3

19) Enjoy your fresh and newly created lightmap! It's located in the folder the original hdr image came from, with the same name but .lm extension.

20) Load your .lm lightmap file into maya, preferrably by using the sphericalLight shader. But that's another story, and very well guided by the quick start tutorial at http://www.thereisnoluck.com/plugins_iblTools.php


This has been written by assuming that you are using the latest lightMapGen.exe (v1.0b4) from Jeremy Pronk at http://www.thereisnoluck.com/ and by assuming that you are a windows user.

anthonymcgrath
11-11-2005, 04:18 PM
along with Floze and josvex I'm probably one of a handful of ppl who are actually trying this spherelight lightmapgen creation. I posted up some pics before but I'm lost as to what I'm doing - I just found the whole process reaaaaallllly slow - not with the lightmapgen creation but more in terms of rendering - is it really as efficient as you claim josvex?

floze
11-11-2005, 06:14 PM
along with Floze and josvex I'm probably one of a handful of ppl who are actually trying this spherelight lightmapgen creation. I posted up some pics before but I'm lost as to what I'm doing - I just found the whole process reaaaaallllly slow - not with the lightmapgen creation but more in terms of rendering - is it really as efficient as you claim josvex?
This test took about ~5min for the actual rendering; finalgathering with 2 diffuse bounces has been frozen and precomputed at lower lightmap sampling rate without noticeable quality-loss:

http://individual.floze.de/fileadmin/files/cgtalk/lightmapgenRNL.jpg

It's a bit tricky to hide the environment from finalgathering. I took the original rnl_probe in angular map format and set it as source for an IBL node (also angular projection), which I had to rotate in Y by 90 to get the same setup as the lightmap.

Komarcic
11-13-2005, 03:41 PM
this thread is slowly fading away, it would be a shame to let it go off the first page. guess we're all just waiting for Jozvex to give us answers to some of our questions. ;)

SirRender
11-14-2005, 07:25 AM
Fantastic thread guys! Thank you very much Jozvex for getting it started and sharing your knowledge.

Cameo
11-14-2005, 01:34 PM
Hi Jozvex

I'm just started playing around with MR and here's something that I'm trying to
do but failing miserably. Hopefully you might be able to shed some light on the
problem for me. I'm using Maya 6.

Basically I'm trying to get a sphere reflected on a black background but the
sphere is illuminated by FG/HDRI.

Here's what I have so far (see attached image);

1. Sphere using standard raytracing. Ground plane made reflective and transparent.
2. Sphere lit using HDRI. HDRI is reflected in ground plane but I dont want this.
3. Sphere lit as I would like (but no reflection as I hid ground plane)
4. How to get a sphere lit with HDRI but also have it's reflection lit in the same manner
without reflecting the HDRI itself in the ground plane?

Primary visibility is off for the ibl sphere, also tried turning off visible in reflections but that
appeared to have no effect.


Any ideas how i can achieve this?

Thanks

anthonymcgrath
11-15-2005, 06:25 PM
if your using the hdri to light the scene by switching final gather on make sure default light is turned off in the render globals and add a point light in the scene with a low intensity.

do as you did normally and turn off the primary visibility, vis in reflections & vis in refractions in your ibl node - then add a use background shader to the floor - this should reflect the ball and light the scene with hdri but not include reflections. I've just give it a quick shot and it worked fine - think this is what your after :)

an alternative (and I'm just thinking on my feet here) is to create a fully transparent blinn add that to the floor, duplicate the floor plane, shift it a tiny amount beneath the first one and assign a texture to that that aint flat if your wanting the floor to have a texture as well.

Cameo
11-16-2005, 12:31 PM
Anthony,

Thanks for your reply. I tried the first method you suggested but that didnt work as you described (hopefully Im just doing something simple wrong). I didnt try the second method because I dont want any texture for the plane whatsover, just the black background, the object and it's reflection.

The image on the left is with IBL added, primary vis off, vis reflec/refrac off and using a ground plane which is a fully reflective blinn (transparent).

The image on the right is my attempt at your suggestion. All the visibility flags for the IBL are off, I just made a default use background and applied it to the ground plane. Also tried playing with the specular colour/reflectivity of the use background but as I suspected they didnt change the fact that the HDRI itself was being reflected.

Any ideas where I'm going wrong?

anthonymcgrath
11-16-2005, 12:59 PM
aha - sorry mate I completely forgot to mention..

select your IBL node (should show mentalrayiblShape1 in the attr editor) to the LEFT of this is the mentalrayibl1 node... if you cant see it click on that little button to the left of where it says "presets" you should now be able to see the "mentalrayibl" tab - select this...

underneath the mentalray drop down menu you want to turn OFF 'derive from maya' then turn the TRACE value to NO ...this should now work :D


..actually that didn't work strangely - what version of maya are you running? I'm on v6 so I could email you my scene if you pm me?

anthonymcgrath
11-16-2005, 05:48 PM
hey Cameo - thanks for emailing me yer scene man - just to recap what I put down in the email you wanna turn off the 'visible in environment' for your scene, boost the usebg spec colour to full white and turn up its reflectivity :)

a cool shader thats worth reading up on (along with half a dozen others online!!) is the raytype shader - that lets you override pretty much any ray being emitted from an objects material - its fantastic when used in conjunction with the ibl as you can use a lower res hdr to light your scene with fg rays/light emission then plug a higher res one in which is cast in the reflections only - makes for much finer control and of course you can plug anything in not just hdrs

ant

Cameo
11-17-2005, 09:46 AM
Yea thanks for all your help Ant. I should have thought of unchecking a few more of the visibility flags but I guess I just assumed that at least a couple needed to be on for it to work!

LehaS
11-19-2005, 11:27 AM
i also got a question for you Jozvex:

i was wondering, are there PROPER and UNPROPER ways of building geometry that might affect the rendering?
so, how to build geometries to achieve better rendering results?

for instance, does it make a difference if you build a wall with a single poly or more polys? because when using shadow maps it's a good idea to build walls as real ones...with thickness.

also, perhaps if u might now, its not connected with GI or FG, its about beveling edges to get good responses to lighting. so? any tricks or tips?

thanx

The way Fg and GI work demand from us (users) accurate and clean modeling habits especially if we try to reduce rendering time as much as we can....

I`ll probably speak rather teoretically because i still dont have clear understanding of how MR works on some stages of calculations....

GI
For example imagine MR calculates a room which is just a cube with no thickness....so if the GI radius setting is high then there is a chance that first-bounce photon from outside will be able to affect with its color the one which is inside....by ensuring that you have some thickness you will get you photons interpolated along the corner of this wall in more realistic manner....(if i m not wrong this is the common artifact which people get in the places where ceiling/walls/floor intersect)....

FG
Considering FG as i know (not theoretically though ;)) FG points send thier FG rays from the hemisphere which is determined by normal of this particular face....this means the way you orient your normals and how you make fillets affects FG accuracy and credibility dramatically....it means if your face is oriented in the opposite direction then FG will sample not room irradiance but environment color!

I hope this makes sence

jezza
11-23-2005, 11:34 AM
Hi there,

Regarding render speed and sampling counts when using IBL Tools (lightMapGen and sphericalLight). I notice 32 samples with 8 interleave levels being used as a default starting point. 32x8 is quite a heavy sampling pattern, we are talking 256 raytrace probes per shading sample! These sorts of numbers are generally too high for production rendering, especially when you throw final gather into the equation. The advantage of importance sampling is its ability to converge on the required result quickly, effectively allowing one to use less samples for a similar result (as say the grid style sampling in Maya's IBL). So to give an example of how we use this in (tvc) production, we use 8 samples for SSS, 16 for heavy scenes and 32 for more accurate specular highlights. We use no interleave levels but do use the occlusion for shadows technique to soften the shadows. These numbers would be upped a bit for film.

A tip, if you get the "mediumCutTreeElement::subDivide() failed! Try increasing the size of the input image" error, you can use the -resize command line option to resize the input image on the fly, no need to open it in CS2. Either way I would start with an image of 1024x512, median cut is a fast algorithm so no need ta skimp.

Hope that clears up a few things. If anyone has suggestions make sure you make them known, the product won't improve without constructive criticism from the user :)


J
(IBL Tools creator)

--
www.thereisnoluck.com (http://www.thereisnoluck.com)

floze
11-23-2005, 05:16 PM
Hope that clears up a few things. If anyone has suggestions make sure you make them known, the product won't improve without constructive criticism from the user :)


J
(IBL Tools creator)

--
www.thereisnoluck.com (http://www.thereisnoluck.com)
Hi Jeremy, thanks for joining us!

One thing I'm curious about is this: can the samples for finalgathering be somehow separated from the actual eye ray samples, via the sphericalLight shader? That would get a huge performance improvement at similar quality when using finalgathering.

Backlund
11-23-2005, 10:50 PM
Hi guys,

This is a cool thread indeed and thanks to everyone who's contributing.
I'm having some trouble with the LightMapGen stuff, as has already been mentioned, it doesn't create any .lm file for me. I've tried different HDRI's, rezising them and I've tried floze's bat with no luck. Does anyone have a clue?

Thanks

jezza
11-23-2005, 11:08 PM
One thing I'm curious about is this: can the samples for finalgathering be somehow separated from the actual eye ray samples, via the sphericalLight shader? That would get a huge performance improvement at similar quality when using finalgathering.

Hi Floze,
Sorry mate not exactly sure what you mean there. SphericalLight is a light shader and has no real knowledge of what is occuring (calculation wise) in the surface shader? You'll need to elaborate.
J

jezza
11-23-2005, 11:15 PM
I'm having some trouble with the LightMapGen stuff, as has already been mentioned, it doesn't create any .lm file for me.
Thanks

Hi there,
You will need to provide the output from lightMapGen, it is pretty hard to help otherwise. Are you running lightMapGen directly on the command line or via Seth's MEL GUI?
J

Backlund
11-24-2005, 01:08 AM
Hi there,
You will need to provide the output from lightMapGen, it is pretty hard to help otherwise. Are you running lightMapGen directly on the command line or via Seth's MEL GUI?
J

I'm not sure I understand. When using the GUI I get the following:

lightMapGen;
Output Calculation Parameters:
Input : f:\Maya\projects\test\sourceimages\roadside.tif
Samples : 32
Sample Type : Median Cut
Normalize : 1
Write Diag : 1

LIGHTMAP LOCATION: f:\maya\projects\test\sourceimages\
defaultNavigation -connectToExisting -destination pointLightShape1.miLightShader -source sphericalLight1;
connectAttr -f sphericalLight1.message pointLightShape1.miLightShader;
// Result: Connected sphericalLight1.message to pointLightShape1.mentalRayControls.miLightShader //
select -cl ;

...no error message or anything.

When running through the command prompt I enter the samples and flags and then when I press enter the window is closed and nothing is created. If I did something wrong while installing I should get an error message, right?

Thanks for taking your time to help me :)

jezza
11-24-2005, 01:21 AM
When running through the command prompt I enter the samples and flags and then when I press enter the window is closed and nothing is created.

Well something is definitely wrong there, the command window shouldn't be closed. I assume it is completely crashing out and killing the command prompt? If you like you can send me the image directly and I'll see what is going on... webmaster@thereisnoluck.com

J

Jozvex
11-24-2005, 04:20 AM
Oooh it's Jeremy!

I'm not dead guys by the way, one of my hard drive's kinda EXPLODED with lots of my Maya stuff on it. Luckily everything was recoverable but it's just slowed me down getting it all fixed.

Backlund
11-24-2005, 10:47 AM
OK, don't ask me how but I finally got it working.
For some reason I can't use the GUI or floze's bat, but I managed to get the command line working now. I don't know what I did different this time but it's working so I'm happy.
Thanks for your help Jeremy, and thanks Jozvex for your "step by step". I'm off to play with this stuff now... :)

floze
11-24-2005, 01:21 PM
Hi Floze,
Sorry mate not exactly sure what you mean there. SphericalLight is a light shader and has no real knowledge of what is occuring (calculation wise) in the surface shader? You'll need to elaborate.
J
Thanks for taking the time Jeremy.

What I mean is something like high level/low level sampling with regular mr area lights. Low level sampling is the sampling that occurs beyond an arbitrary tracedepth defined by the amount of 'Low Level'. High level sampling occurs before that 'Low Level' depth.
This way a different sampling rate can be applied for reflections, refractions and finalgathering if you set the low level amount to 1. I hope it's a bit clearer now..?

floze
11-24-2005, 01:26 PM
OK, don't ask me how but I finally got it working.
For some reason I can't use the GUI or floze's bat, but I managed to get the command line working now. I don't know what I did different this time but it's working so I'm happy.
Thanks for your help Jeremy, and thanks Jozvex for your "step by step". I'm off to play with this stuff now... :)
I guess copying the lightMapGen.exe into the maya\bin folder is not a bad idea. Since this folder is usually set as PATH in the system environment, you can access the executable from any location.

jezza
11-24-2005, 10:54 PM
Thanks for taking the time Jeremy.

What I mean is something like high level/low level sampling with regular mr area lights. Low level sampling is the sampling that occurs beyond an arbitrary tracedepth defined by the amount of 'Low Level'. High level sampling occurs before that 'Low Level' depth.
This way a different sampling rate can be applied for reflections, refractions and finalgathering if you set the low level amount to 1. I hope it's a bit clearer now..?

Yep that makes sense. One option would be to switch between two different lightmaps depending on the level setting. I'll check it out.

J

jezza
11-28-2005, 06:11 AM
Oooh it's Jeremy!

Yes it's me. You interested in writing up a tutorial for IBL-Tools, by any chance?

J

smoluck
12-02-2005, 10:47 AM
Look at that new Thread about LightMapGen, Terragen, and HDRShop if you want's to create your own HDRI file with Terragen environement, or if you encounter problems like me in LightMapGen workflow !

http://forums.cgsociety.org/showthread.php?t=298483


Special Thanks to Jovex for is "Step By Step" tutorial and Floze for is little .bat who help to save some time, and is tips about "short name file" problem with LightMapGen command line !

----------------------------------------:wavey:

EDIT :

Lol .. there is already a tool plugin for render HDRI files in Terragen .. sorry for that, I move faster to do that thread :rolleyes:

jezza
12-06-2005, 07:15 AM
This way a different sampling rate can be applied for reflections, refractions and finalgathering if you set the low level amount to 1.

I have modified sphericalLight to accept 2 lightmaps, a normal lightmap (or high) and a low lightmap. Switching to the low lightmap when encountering final gather rays looks promising. A quick test using 64 samples for the lightmap and 8 samples for the low lightmap decreased the render time by more than half when using final gather....

I can set it up so there is a level number which works just like the area light level number in mental ray and also a switch which will use the low level when final gather rays are encountered. Does that sound like something?
We could also have different shadow settings for the low level but that is more work ;)

J

floze
12-06-2005, 12:12 PM
I have modified sphericalLight to accept 2 lightmaps, a normal lightmap (or high) and a low lightmap. Switching to the low lightmap when encountering final gather rays looks promising. A quick test using 64 samples for the lightmap and 8 samples for the low lightmap decreased the render time by more than half when using final gather....

I can set it up so there is a level number which works just like the area light level number in mental ray and also a switch which will use the low level when final gather rays are encountered. Does that sound like something?
We could also have different shadow settings for the low level but that is more work ;)

J
Sweeet, cant wait for the next release! :drool:

I dont want to sound rude, but maybe we should open up a thread called Image Based Lighting Tools or alike, instead of hijacking Jozvex' beautiful thread for beginners..? Me and definitely many others appreciate the discussion, but it's obviously leading us far away from Jozvex' 'taking it slow' intention.. heh. ;)

katisss
12-08-2005, 09:54 AM
To render flickerfree scence with animated objects without a map for every frame i've come up with this idea for FG-Maps and wanted you to check if missed something.

1. I exclude animated objects from receiving FG with the object override
2. I create a prerendered FG map (rebuild off) for the scene on a single machine (as the animated objects are excluded they are not included in the map) for every 5th frame
3. To render: I switch on receive FG on animated objects again
I use 2 FG maps at the same time: "animatedobjectsOnly" "prerendered FG map"
with the map set to "on" so maya can write to the first one but not the 2. for the static objects

My problem is:
the syntax for 2 FG maps doesnt work in the maya globals.
For the mental ray standalone it s like:
ray -v 4 -finalgather freeze -finalgather_file ["fgmap100" "fgmap200" "fgmap300" "fgmap400"] -- myframe.0250.mi
but i can't make it work in the maya globals.
Neither separating the filnames with ", [],' or blank work for me.
http://forum.lamrug.org/viewtopic.php?t=182&sid=5ea566888e0d8afe4f7f6e54c88b28d2
doesn't tell me either. Any suggestions please for using multiple maps for Maya Globals (or Muster)?

Another idea is to merge separate maps for the scene (every n-th frame)
and the animated object (every frame). Is this possible?

wierdteaparty
12-23-2005, 07:46 PM
I hope this thread isnt dead well I'm a total noob at this stuff but im trying to figure this stuff out. I downloaded your scene and went straight to render but the whole time it told me that no photons were stored after emitting 10000-1000 photons. I was wondering why if I strictly used your scene without changing anything I should be getting an error message like this.

Metoc
12-24-2005, 11:43 PM
I've noticed something veery weird. If you use a Maya Lambert, Final Gathering won't have a effect on this shader, if you use a light to illuminate the scene.
e.g. the light is only shining at the ground of a box. With a Maya labert the walls will stay deep black. The mr lambert is effected by final gathering.

good to know :eek:


2.
i read in a pdf (http://www.lamrug.org/) that the raytracing is done at the end of the rendering process. i think that's not right. maybe i misunderstood something.

3. and last:
are there hidden final gathering nodes in maya 6.0, 7.0 ?


tahnkyoooou

and merry chrismas :applause:

vravro
12-26-2005, 01:42 AM
Ok, this is embarrassing. Jozvex, when the LightMapGen tries to generate an lm file, it doesn't do anything for me. The calculation takes no time and no files are generated. The sphere and the point light is created, but when I try to point to the lm file, there's nothing there. Do you know what can cause this?

lazzhar
12-26-2005, 08:48 AM
I've noticed something veery weird. If you use a Maya Lambert, Final Gathering won't have a effect on this shader, if you use a light to illuminate the scene.
e.g. the light is only shining at the ground of a box. With a Maya labert the walls will stay deep black. The mr lambert is effected by final gathering.
....

and merry chrismas :applause:

How this could be true? We alll are using Lambert with FG and it just renders out fine.

katisss
01-07-2006, 05:26 PM
What would be the advantage of using Spherical Light with Final Gather?
I am bit confused because i was thinking it is used to replace FG in scences
where FG doesnt work well in animation/very detailed scenes?
Surprised to see it is used in combination.

floze
01-07-2006, 07:12 PM
What would be the advantage of using Spherical Light with Final Gather?
I am bit confused because i was thinking it is used to replace FG in scences
where FG doesnt work well in animation/very detailed scenes?
Surprised to see it is used in combination.
It'll give you the secondary illumination, i.e. light bounces that the spericalLight isnt capable to produce. It's working very nice and smooth, because the finalgather does not have to worry about high frequency noise anymore (at least it is lowered).

katisss
01-07-2006, 07:55 PM
I see. So it would only make sense when using multiple FG bounces?
I mainly thought of using it for animation where multiple Fg bounces would be unlikely anyways.

floze
01-07-2006, 08:48 PM
I see. So it would only make sense when using multiple FG bounces?
Well, if you want actual color bleed you need the secondary diffuse bounces, yes.

DivineRAiN
01-08-2006, 06:34 AM
hiyas.. I recently started to try learning, experimenting with caustics, gi, & fg... basically I still don't know what I'm doing, but trying n test rendering on a simple scene.

http://hometown.aol.com/divinerain/images/aroomtest4a1.jpg

had used caustics n fg for this 1.. l_glass shader on the sphere. I thought it looked ok, but it took forever to render at 640x480. Over 40mins it was still rendering. The lights on the sphere is a bit much.

http://hometown.aol.com/divinerain/images/aroomtest71.jpg

made some changes for this.. deleted a spotlight n moved the point light away from the window. There's a spotlight throwing out photons that isn't visible n doesn't cast shadows. I tried to render with caustics, gi, and fg together but it rendered most of the scene black. Not sure what's going on under the sphere, but it gets worse.

http://hometown.aol.com/divinerain/images/aroomtest6a1.jpg

I upped the intensity to brighten up the room a bit... the brightness reflected off the sphere is a bit much isn't it? Is this something that typically happens sometimes?
Using mental ray for maya v3.3

DivineRAiN
01-08-2006, 06:41 AM
did another test, I added a spotlight with raytrace shadows and two more spheres to see if there was something goofy about the shading setup

http://hometown.aol.com/divinerain/images/aroomtest8a1.jpg

caustics + gi. The red sphere is the 1 I started off with, the pink is new.. both with l_glass shader, the other has dielectric. As far as I can tell the spheres and cylinder aren't casting any shadows. I tried using mental ray's shadow shader but the result is the same.

hominid
02-14-2006, 11:44 PM
The lightMapGen mel file wasn't creating the .lm map file so I looked into the code:

between lines 99 and 115
you will find all the lines that look like
system ($formatLightMapGenPath + "-in \"" + $formatInput + "\" -s " + $samples + " " + $iSamples + " -st 4" + " -normalize -writeDiagImages");
in all of them, add a space before the '-in \' so it looks like ' -in\'
system ($formatLightMapGenPath + " -in \"" + $formatInput + "\" -s " + $samples + " " + $iSamples + " -st 4" + " -normalize -writeDiagImages");
I've also added the print line to this block...
// move the .lm lightmap file to the lightmap folder if it exists
if (`filetest -f ($siPath + $inputName + ".lm")` == 1) {
sysFile -mov ($projectRoot + $lmPath + $inputName + ".lm") ($siPath + $inputName + ".lm");
}
else
print("lightmap file not found");
...so it will tell you if it hasn't made the file

Hopefully this helps,

Cheers,
Pete

YourDaftPunk
02-15-2006, 03:41 AM
DivineRain- upload your scene so we can take a look at it. Thanks.

-shawn

yenvalmar
02-15-2006, 10:53 PM
if only somehow the people who know what they are doing and will do this for FREE could be HIRED to write the mental ray documents. maybe they used an auto translator from the french and didnt edit it, for those of us who only speak english.. :( seriously the most confusing docs ever, unless you already have a PHD and were a member of the dev team maybe.. and i've used all sorts of different programs over the years. just the first post in this thread with the high level explanation of what all this stuff does already has me so much better informed than i've got by trying to use the doc, and i havent even looked at the sample scene yet. i will definitely be trying to put these techniques to use in the near future (why i was looking for this sort of info in the first place) and threads like this are why i log onto here so frequently.. great :)

MrPositive
03-23-2006, 08:44 AM
This is a great thread! I will be following closely.

Jozvex
03-23-2006, 09:22 PM
I'm sorry I disappeared out of my own thread! I got really busy and then changed computers and haven't really got it all setup the way it was yet.

I'll read over the whole thread when I have a minute and see what else I can add.

anim8or_7
03-25-2006, 04:47 PM
Wow. Very informative thread. Keep it coming guys. I think you are doing a great job.

dcarus
08-12-2006, 01:28 PM
Can anyone advise me on setting up ctrl_shading for use with GI? I'm aware that you can use the mib_basic_photon in the photon shader slot, but I was curious as to whether there is a way to set the ctrl_shading shader up to handle photons.

cpan
08-12-2006, 02:11 PM
the mib_photon_basic has a diffuse (GI) slot and an specular (caustics) slot. Just connect the corresponding output colors into those (out diffuse -> diffuse, out specular -> specular), it should work ok :)

dcarus
08-12-2006, 02:55 PM
That looks to be working - thanks!

ScallyFox
10-15-2006, 08:04 PM
Jozvex, first of all - thank you for this wonderful thread. A lot of useful information. Please, don't disapear:)
I have a few questions - while I'm rendering your scene, I'm getting this kind of message all the time:

RCGI 0.9 warn 362004: no photons stored after emitting 10000 photons
RCGI 0.2 warn 362004: no photons stored after emitting 10000 photons
RCGI 0.9 error 361053: no photons stored after emitting 1000000 photons (canceling emission job)

does it mean that something is going wrong? Anyway, after all I'm getting the image like yours. But when I'm trying to do the same geometry with the same kind of light and links in new scene - I got this message with errors and no visible caustics. It's working with GI, photons are emitted. But when I'm turning on caustic, nothing is emitted.

Other trouble is the physical light shader. If I substitute your node for another one, identical (just create a new one) with the same links - it doesn't work! Where is the clue?

waiting patienly for the answer

Jozvex
10-16-2006, 03:29 AM
Jozvex, first of all - thank you for this wonderful thread. A lot of useful information. Please, don't disapear:)

Well I did disappear, but not completely! I'm always here every day, even if it's just a quick scan of the threads. I don't have as much time as I used to unfortunately, hehe.

does it mean that something is going wrong? Anyway, after all I'm getting the image like yours. But when I'm trying to do the same geometry with the same kind of light and links in new scene - I got this message with errors and no visible caustics. It's working with GI, photons are emitted. But when I'm turning on caustic, nothing is emitted.

Hmm ok. Well the first things to check are:

1. If you're using Mental Ray shaders like DGS and not just Maya Lambert etc, you need to have connected a photon shader to the shader's Shading Group (SG) node. Photon Shaders are used for interacting with GI and caustic photons, and Maya shaders already have them built in. For MR shaders you need to connect them yourself to the Photon Shader slot on the SG.

2. If you've already done No.1 and like you say, your GI photons are working but not your caustics, maybe you don't have Refraction turned on for your caustic-casting object? And if Refraction *is* turned on, make sure the Refractive Index is set to something higher than 1.0 like perhaps 1.33 for water or 1.51 for glass.

3. Maybe the majority of your photons are missing the caustic-casting object? Don't use Point lights for casting GI and caustics unless it's a fully interior scene otherwise lots of the photons will just fly out into space, and it will take much longer for MR to get the right amount of photons actually stuck onto the objects.

Other trouble is the physical light shader. If I substitute your node for another one, identical (just create a new one) with the same links - it doesn't work! Where is the clue?

Hmm I'm not 100% sure what you mean. When I create a physical light, I just create a regular Point Light and then attach the mib_physical_light (or whatever it is) shader to the Light Shader slot.

:shrug:

ScallyFox
10-16-2006, 06:47 PM
Thank you very much for your help!

2. If you've already done No.1 and like you say, your GI photons are working but not your caustics, maybe you don't have Refraction turned on for your caustic-casting object? And if Refraction *is* turned on, make sure the Refractive Index is set to something higher than 1.0 like perhaps 1.33 for water or 1.51 for glass.

I'm using dsg material and refraction is turned on by default. And I can't find refractive index for this shader...

3. Maybe the majority of your photons are missing the caustic-casting object?
I think that is the point. I have to check it.

Hmm I'm not 100% sure what you mean. When I create a physical light, I just create a regular Point Light and then attach the mib_physical_light (or whatever it is) shader to the Light Shader slot.

I create a new physical light node and link it instead of your physical light, preserving the same links (out value A-->color A from cie_D node), and then - connect it to the point light in your scene. And the main question is - Why the new physical light doesn't work?
It's rendering everything black. And it's working ok with the first physical light.
I'm talking about your scene, attached on the first page.

ScallyFox
10-16-2006, 08:36 PM
Ok, I figured it out. Now it's working fine.

But, please, Jozvex, could you share more info how to work with cie_d node and physical light shader?

yenvalmar
03-01-2007, 11:37 PM
like if i attatch the cie_d light shader (informative name too) to a new spotlight i create, it seems to completely ignore where the light is pointed, and it shows up in reflections even if its pointed away.. in other words it just acts like a point light no matter what type of maya light it is attatched to.. is there some other step to make it behave as the maya spot?

the physical light seems to obey the maya spot cone and such but gives totally different control for the light brightness and such.. ok fine but i got it working.. but now also seems to have no controll for the shadows, the shadows always render too dark and with unrealistic raytraced hard edge (as opposed to say normal raytraced area light shadow effect which i want in this case) necessitating adding other nodes to controll the shadows now.. or use the control shaders for the shadows?

i guess i am lazy but i miss the convenience of normal maya spot light where these parameters are built in and easy to understand, just turn up the light radius a bit to feather the shadow edge, change the shadow to be less dark with the shadow color parameter built right into the light....i guess i am curious what the ultimare advantage of the more complex workflow is?

RMutt
03-16-2007, 01:04 PM
Hi Jozvex, thanks for making this thread. On a more personal note, I'd like to say that the tutorials on FG and GI on your website have helped me in understanding MR. I am no pro by any means, but I keep a quiet eye on this forum and the numerous other guides on the net to get to the level you and others are at. Anyway...

I was able to render the scene with no errors and understand almost everything posted thus far. I have a few questions that could use your (or anyone elses for that matter) assistance:

1) Why are you utilizing two lights in the scene?

I'm seeing two lights: 1 point light and 1 spot light. Am I correct in saying that you're using the point light to illuminate the scene, while the spot light emits photons? If so, why not just use one to do both?

I'm wondering if your answer will go back to what you mentioned on pg1:

"it's good to have a realistic match between direct and indirect light."
-------------------------------------------------------------------------

2) Every time I click on a light in the scene, I get the following error in the script editor:

KeyLight ;
// Error: The mentalrayLightexponentCtrl control cannot be used with the attribute "KeyLightShape.exponent". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightcausticPhotonsCtrl control cannot be used with the attribute "KeyLightShape.causticPhotons". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightglobIllPhotonsCtrl control cannot be used with the attribute "KeyLightShape.globIllPhotons". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightsmapResolutionCtrl control cannot be used with the attribute "KeyLightShape.smapResolution". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightsmapSamplesCtrl control cannot be used with the attribute "KeyLightShape.smapSamples". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightsmapSoftnessCtrl control cannot be used with the attribute "KeyLightShape.smapSoftness". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightsmapBiasCtrl control cannot be used with the attribute "KeyLightShape.smapBias". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightsmapDetailSamplesCtrl control cannot be used with the attribute "KeyLightShape.smapDetailSamples". The attribute type is not compatible with the control type. //
// Error: The mentalrayLightsmapDetailAccuracyCtrl control cannot be used with the attribute "KeyLightShape.smapDetailAccuracy". The attribute type is not compatible with the control type. //"

It only happens when I select lights...be it directly or via the outliner. Moreover, its been happening in other scene as well. I recently installed Maya 8 and it never happened in 7. It's annoying and confusing to say the least. Any idea what it means/how to solve it?

----------------------------------------------------------------------------

3) Why bother to change the photon color attribute? From my experiments I haven't noticed any difference in the color of objects in the scene. What impact does this have ont he scene?

When I try to read up the most I find is this tid bit:

"color of each emitted photon. Default is white, regardless of the color that is set for the light. If you want the photons to be the same as the light color, you must set the color here as well."

CGTalk Moderation
03-16-2007, 01:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.