SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Lighting & Rendering / MR calculations based on distance from SSS object

Lighting & Rendering General Lighting, Camera & Rendering Related Topics

Join the conversation. Reply to post
Page 1 of 2 1 2
 
Thread Tools
28-04-2013, 07:51 PM   #1
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
MR calculations based on distance from SSS object
I've got another annoying render problem. Doing some test renders, I realized that it takes some time for mental ray to do calculations before the render actually starts. After some research, it appears that the calculation time is proportional to the distance the camera is from my geometry. I'm trying to get my camera in nice and close for a shot, but this results in a verrrry long pre-render time. It was well over five minutes on a 640x360 before I killed it and it hadn't even rendered a pixel yet.

With a bit more research I've come to the conclusion that this is because I'm using a SSS material. Does anyone know how to circumvent or alleviate this problem? Thanks.
  Reply with quote
29-04-2013, 12:07 AM   #2
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
You might be able to bake the FG, which may speed it up a bit. Try running the MR diagnostics and see if anything pops up.
__________________
Imagination is more important than knowledge.
  Reply with quote
29-04-2013, 01:32 AM   #3
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I've got the FG map at freeze, is that what you meant? Or bake it to textures. I'll give the mr diagnostics a try.
  Reply with quote
29-04-2013, 01:46 PM   #4
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
If you have it set to freeze, you also have to supply a filename if I remember correctly.

You can also use an MR lightmap, which will write the SSS calculations to disk.
__________________
Imagination is more important than knowledge.
  Reply with quote
29-04-2013, 02:00 PM   #5
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Yeah, the freeze is working fine, that's not a problem. I'll look into the MR lightmap, is that something that is used across all frames? Or does it cache the lightmap for each frame before doing the rendering?
  Reply with quote
29-04-2013, 06:31 PM   #6
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
I think this might explain it: http://employeepages.scad.edu/~kwitt...Scattering.pdf
__________________
Imagination is more important than knowledge.
  Reply with quote
29-04-2013, 11:24 PM   #7
Jay
Lead Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,277
scale is always an issue as well, check your scene unit size, meters or cm?

always take it into consideration. This is something that isnt very well documented

Jay
  Reply with quote
29-04-2013, 11:33 PM   #8
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
It's in cm, properly scaled. I'm just curious that there seems to be something related how close the object is to the camera. Or perhaps because the material fills the whole render, it has to do more calculations??
  Reply with quote
30-04-2013, 12:12 AM   #9
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
I don't think it's the distance that's the problem, but how much screen space the object takes up. (Which is inherently the distance)

The more pixels an object takes up, the more pixels that need to be computed with that material. If the material is expensive to calculate, it will take longer to render. With SSS, each traced ray that hits the material scatters. This creates many more rays that it needs to calculate, so you kind of get an exponential complexity increase.
__________________
Imagination is more important than knowledge.
  Reply with quote
30-04-2013, 01:52 AM   #10
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
That makes sense ND, I guess I was assuming there was something inherent to the distance, but it has to render a full frame of SSS goodness. The problem is that it's the most necessary to have a good looking shader when it's right close to the camera.
  Reply with quote
30-04-2013, 03:10 AM   #11
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Well, if you save the lightmap of the SSS, you only need to render it once for a given light configuration.
__________________
Imagination is more important than knowledge.
  Reply with quote
30-04-2013, 02:10 PM   #12
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I'm trying to save the lightmap, but I'm really confused as to the process. If I have "writable" checked, and don't specify a file, it does the full calculation. If I put a new filename there, it jumps right to the rendering, and when that's done, it says "no such file or directory, can't write". If I don't have "writable" checked, then it doesn't even render, it just errors out.

The pdf you linked me to says "You don’t need to specify an image name. But if you do, you can render the scene once, and uncheck the “writable” button."
  Reply with quote
01-05-2013, 10:20 PM   #13
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Any ideas on how to write a lightmap to a texturefile to be read once? I feel like I'm missing something obvious.
  Reply with quote
02-05-2013, 01:30 PM   #14
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Okay, I found this thread: https://groups.google.com/forum/?fro...3d/vfzbQqUeOwQ
So I created a blank white image in PS at the specified resolution, saved it as a 32-bit tiff, since the bit-depth in the Attr Editor was 32. I tried a render and the image now looks like it has some grayscale information for my render. So that's cool. I turned off writeable and am now rendering again. I think it might be going okay, but the output window says this:
PHEN 0.10 193 MB error: misss_lightmap_write: Lightmap 1073741828 is not writable, aborting lightmapping.

Is that expected? I guess I'll just see how the render looks.
  Reply with quote
02-05-2013, 02:53 PM   #15
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
I remember this being a pain as well. You could also just make an SSS pass, and comp it together later.
__________________
Imagination is more important than knowledge.
  Reply with quote
Reply
Page 1 of 2 1 2

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble opening maya scene jooleyinboots Maya Technical Issues 2 03-02-2014 09:11 PM
intensity of the light based on its distance from mesh jovstrel Lighting & Rendering 2 08-12-2013 06:03 AM
Is there a way to make an object change colors based on light/p.o.v? SilverFeather Maya Basics & Newbie Lounge 15 29-04-2013 03:29 PM
Normal Map definitions djwaterman Lighting & Rendering 2 25-05-2012 12:50 PM
The Ultimate Maya & Mr Archviz Guide. withego Finished Work 0 10-01-2010 01:29 PM