PDA

View Full Version : UNDERSTANDING HOW MR WORKS (from the start)


conchalavand
10-10-2010, 03:24 PM
I have seen a great number of decent explanations on how raytracing works, how sampling works and how the BSP work. And I can understand all of that...
...But so many BASIC things are un-answered, even the most simple things; like for example, how does it knows where to put the highlight and how to construct the coreshadows of an object without raytracing to the light source. Does it just applies a gradient depending the position in wich the object is depending to the light source? Does it do something like that before throwing the first rays?

--Please post here everything regarding the understanding of the workings of the renderer, in a way in wich everything that the machine is doing may become clearer--
(I'm not talking about codes, but rather the theory of the process)

ndeboar
10-10-2010, 11:46 PM
If by hilight you mean delta specular hilights (fake reflections from delta lights), there are tons differnt ways this is calculated, eg:
- Phong
- Blinn
- Cook Torrance
- Ward

So, maybe google some of these.

The only way to create shadows in mental ray with out raytracing i know of is shadow maps, so again do some googling and read up.

edit: I think you are asking how diffuse works. It's really simple, it's the dot product of the light direction to the surface normal.

Edit edit: Check out the science of cg thread, answer a ton of your questions.

conchalavand
10-11-2010, 11:36 AM
Thanks a lot for your answer, but no, that's not what I was looking for, sorry for not making myself more clear. I've googled it a lot, that's what I usually do before asking something, but I couldn't find any actual guide from start to finish with good topic listing and stuff like that, just some microscopics clues in this and that book that were helpfull.
If you know all of this stuff, try instead to tell me the names of the books you've read and recommend, videotutorials, etc. or if you know some good page explaining the subject that you have read and that you know is well explained, then post the link please. Could be helpfull for others too perhaps.
It's also difficult to find something that you don't know what it is (as it's my case), that's why I would need a real guide with all the important topics of how a render works from the beggining.
About the "science of CG" thread, I looked trhough all the pages and found nothing realated with my queery. It's not the foundamentals of light in real life what I'm looking for, but rather just how the render works, nothing more.

playmesumch00ns
10-11-2010, 01:06 PM
"How a renderer works" is a pretty expansive topic to be honest. If I were you I'd read this:
http://www.amazon.com/Physically-Based-Rendering-Second-Implementation/dp/0123750792/ref=sr_1_1?ie=UTF8&s=books&qid=1286799054&sr=8-1

patrickrowan
10-14-2010, 11:40 PM
http://www.amazon.com/mental-ray-Maya-3ds-Max/dp/0470008547/ref=sr_1_3?s=books&ie=UTF8&qid=1287096290&sr=1-3

great book

conchalavand
10-14-2010, 11:50 PM
playmesumch00ns: Well, that looks interesting, closer to what I was looking for. Thanks a lot (my own search also took me to books like this one). Still I can't resist to notice that it's a bit too technical and above my level of understanding to be honest. I'm no programmer and I don't have the matemathical knowloedge to understand the formulas of the algorithms. I'll try to learn more about it, but I'm really amazed to see that there's no actual plain explanation.
I'm looking something more like this:
http://www.lamrug.org/resources/samplestips.html
or even like this:
http://www.bernardlebel.com/wiki/index.php?title=3D:XSI_tutorials:BSP_Explained_To_Artists
Those stuff have been helpfull, they would be perfect as to what I'm looking for if they weren't so limited in the topics they explain. I'm looking for understanding what the program does to calculate, not that much how to build my own render nor to change the matrix of the program. Just knowing what MR does when I hit render and how does it so that I can affect the values with more idea of what's gonna result out of it.

EDIT: patrickrowan: I hadn't seen your post, that book looks as it may be the thing that I've been looking for. Thanks, I'll check that. Hopefully is not a guide on the steps that one must take to render, or at least one that gives you the correct insight about what's actually happenning in every process?(??).

conchalavand
10-15-2010, 12:00 AM
Cheers! I'll try to check it out as soon as I can then...

patrickrowan
10-15-2010, 12:00 AM
yo conchalavand

the book i posted is exactily what your after. buy it its gold! :beer:

ndeboar
10-15-2010, 12:56 AM
Still I can't resist to notice that it's a bit too technical and above my level of understanding to be honest.

At the end of the day, 3d rendering is a technical field, so you are going to have to dive into the murky world of vectors, dot products and trigonometry if you really want to understand what's happening under the hood.

For people who say rendering/lighting isnt technical, imagine a camera man that didnt know what a fstop was, or a lighting technician that didnt understand color temps. It all goes hand in hand in the artistry, but (imho) you have to understand the technical aspects of rendering to fully exploit the artistry.

MikeBracken
10-15-2010, 01:28 AM
but (imho) you have to understand the technical aspects of rendering to fully exploit the artistry.



Very nicely said. Pretty much sums up my opinion as well.

Regards,
Mike

Redsand1080
10-15-2010, 02:36 AM
It all goes hand in hand in the artistry, but (imho) you have to understand the technical aspects of rendering to fully exploit the artistry.

Totally agree as well! As a high school student I hated math, but once I decided that lighting was what I wanted to do I devoted a large amount of time to learning the math behind the art. I ended up (much to my surprise) really enjoying all the math behind it and went from hating it to finding it fascinating! Two or three years ago I would have laughed if anyone had told me I will enjoy math later in life. :)

ndeboar
10-15-2010, 02:44 AM
Two or three years ago I would have laughed if anyone had told me I will enjoy math later in life.

Totally. If they told the kids of today that they could make video games and 3d movies with maths, they would probably listen.

Samo
10-15-2010, 11:53 PM
Hi there. I have put together a document with some basics about raytracing:
http://www.yafaray.org/community/forum/viewtopic.php?f=14&t=2837

xeltestic
10-27-2010, 10:11 PM
Hi there. I have put together a document with some basics about raytracing:
http://www.yafaray.org/community/forum/viewtopic.php?f=14&t=2837

very useful package. thx for the effort

InfernalDarkness
11-15-2010, 07:56 AM
Still I can't resist to notice that it's a bit too technical and above my level of understanding to be honest. I'm no programmer and I don't have the matemathical knowloedge to understand the formulas of the algorithms.


@conchalavand: I mean no insult, but if the basic math behind raytracing and photorealism is too much for you, then mental ray is not going to be a friendly rendering situation for you. You need to learn the basics, and need to understand why Blinn, Phong, etc. are not accurate shading models and why you should be using mental ray shaders for mental ray instead. Linear lighting is such a pain in Maya to begin with....

But like I said, I mean no insult. But be aware that mental ray is the most technical and broken, ill-implemented renderer on the market you can possibly work with in Maya. It is not for the timid or easily frustrated. It will take years to learn. If those issues seem daunting, they should be. But you should know what you're getting in to: out of the box, mental ray for Maya is a nightmare.

That said, I love it and work with it daily. It's a challenge - and this challenge demolishes my creativity, but one day it won't. Look at mental ray as a study, more than a means to an artistic end. It's like analyzing alien technology. Only, the aliens were retarded so some OTHER aliens had to step in to write software to UNDERSTAND the original alien tech. And those second aliens were then attacked by the original aliens and forced to make people stick to the original alien tech, with no translation.

Enjoy the ride!

Stellios
11-24-2010, 04:49 PM
It's like analyzing alien technology. Only, the aliens were retarded so some OTHER aliens had to step in to write software to UNDERSTAND the original alien tech. And those second aliens were then attacked by the original aliens and forced to make people stick to the original alien tech, with no translation.

Enjoy the ride!


LOL QFTA


"How a renderer works" is a pretty expansive topic to be honest. If I were you I'd read this:
http://www.amazon.com/Physically-Based-Rendering-Second-Implementation/dp/0123750792/ref=sr_1_1?ie=UTF8&s=books&qid=1286799054&sr=8-1


hi sir, do u reccommend i read this if ive already read boaz livnys guide to mentalray or would it be redundant?

ndeboar
11-24-2010, 11:03 PM
Haha, gold. I'm planning on getting a divorce from mental ray, the last project was a nightmare, we where finding bug everyday.

Just quick one. There is no linear color support for lights. So we where adding in manual gamma adjustments. Turns out, if you use a maya gamma nodes, area lights don't render in buffers.

Next we tried using mental rays physical lights. Turns out this breaks shadows in the buffers.

Such fun.

playmesumch00ns
11-25-2010, 01:46 PM
hi sir, do u reccommend i read this if ive already read boaz livnys guide to mentalray or would it be redundant?

Depends... I've only just taken a cursory glance at the book you mention on google books but it seems very mental-ray-focused.

If you want to know how rendering actually works and not just how mental ray chooses to do it, and you have a basic grasp of mathematics (comfortable with trigonometry and basic linear algebra, are aware of what differentiation and integration mean) then definitely, yes. It goes into a lot of detail. To get the most out of it you really need a basic grasp of C++ too. It is, however, the most comprehensive and accessible introduction to the science behind rendering I've yet found.

playmesumch00ns
11-25-2010, 01:47 PM
Haha, gold. I'm planning on getting a divorce from mental ray, the last project was a nightmare, we where finding bug everyday.

Just quick one. There is no linear color support for lights. So we where adding in manual gamma adjustments. Turns out, if you use a maya gamma nodes, area lights don't render in buffers.

Next we tried using mental rays physical lights. Turns out this breaks shadows in the buffers.

Such fun.

Haha fun indeed :)

I'm curious why you wanted to do a gamma adjustment on your light colours? Were you texture-mapping them?

ndeboar
11-26-2010, 12:29 AM
I always put a hint of color into my lights. And if i want that color in the maya swatch to match my render, it needs to be gamma corrected.

playmesumch00ns
11-26-2010, 01:41 PM
I always put a hint of color into my lights. And if i want that color in the maya swatch to match my render, it needs to be gamma corrected.

Yeah but since you're never lighting anything white, the only way that the colour of your lights comes through is by their effect on the colours of the objects you're lighting, and the only way to check that is to do a render, at which point you tweak until you're happy. That's been my experience anyway: I never pay any attention to the colour swatch on the light since it doesn't mean anything.

ndeboar
11-29-2010, 03:55 AM
No harm in having your swatch actually represent the color you want in your render though :P

snikt
11-29-2010, 05:57 AM
Hi Nick,
correct me if I am wrong, considering that you are having buffer output would it be possible to color the lighting in compositing.Just a thought.
Cheers.

ndeboar
11-29-2010, 07:00 AM
That would require rendering each light individually. Right now, if you do contribution maps for lights, you can't separate the indirect contribution. And i'm also a big believer in doing most the work in 3d, and just leaving comp for small tweaks.

Redsand1080
11-29-2010, 02:11 PM
I always put a hint of color into my lights. And if i want that color in the maya swatch to match my render, it needs to be gamma corrected.

I didn't believe this was true for a while untill I did some tests where I photographed an 18% gray ball under controlled lighting conditions. It definitely showed that lights picked by user via a color swatch need to be gamma corrected. These tests also confirm that the color output of the mib_blackbody is already linear, so if you use that node to derive the Kelvin color temp of the light there is no need to gamma correct that light. In fact if you do gamma correct it, it looks quite wrong.

Did you ever have any problems with buffers when using the mib_blackbody?

Thanks,

Justin

playmesumch00ns
11-29-2010, 07:03 PM
I didn't believe this was true for a while untill I did some tests where I photographed an 18% gray ball under controlled lighting conditions.

...compared to what? I'm not following your logic here. How did you measure the colour that the lights were supposed to be, how did you convert that into an RGB triplet, and how did you measure the result?

Redsand1080
11-29-2010, 07:48 PM
Well to be honest I didn't actually measure anything for this test. My tests were far from scientifically accurate. Much more artistic and general than scientific and precise. But it proved the point for me.

Here is a brief rundown of what I did:

The lights in the room where I photographed the grey ball are normal tungsten house lights. It was at night so the only light was coming from those lights. I white balanced my camera to daylight in order to make the color cast very strong. I wanted the orange color cast of those lights to be as obvious as possible. I recorded the ISO, shutter speed, and aperature size. I put the gray ball on the table and took a picture. I removed the gray ball and took a picture so I had a clean backplate to put a cg gray ball into.

In Maya I created an 18% gray ball. I placed the lights in my 3D scene in roughly the same position as the lights in the room. I used the mib_blackbody to set the lights to a tungsten color temp. I used a photographic exposure control. Put the mib_blackbody in as the white balance set to a daylight color temp. Input all the settings from my camera into the exposure control. Increased cm2 factor untill I got the correct exposure. I could have just set ISO to zero but since I recorded all those camera settings I figured why not just use 'em. :)

I rendered the scene with no gamma correction on the mib_blackbody plugged into my lights. I then rendered the scene with gamma correction on the mib_blackbody. The gamma corrected mib_blackbody looked way too orange compared to my photograph. The non-gamma corrected black body looked very close to the photograph. Much, much closer than the gamma corrected version. Far from scientifically accurate, but the visual results were pretty conclusive for me.

That entire thread where I conducted those tests is either here in this forum somewhere, or in the Maya rendering forum. Quite a few pages back at this point I imagine. You can check it out if you would like.

Hope that clears things up some.

-Justin

CGTalk Moderation
11-29-2010, 07:48 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.