Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Fixed undesired white pixelled areas on mentalray renders

Fixed undesired white pixelled areas on mentalray renders

Anonymous
Not applicable
1,543 Views
3 Replies
Message 1 of 4

Fixed undesired white pixelled areas on mentalray renders

Anonymous
Not applicable

Hi there, I have seen others have the same problem with white pixelled areas appearing in renders and I have tried following some suggestions but a lot of them don't seem to apply to my situation and I couldn't isolate what was causing the problem in mine from looking at other's solutions.

 

This was originally going to be a question but it seems to be fixed in my scene now, after going to Render Settings > Quality > Trace Depth > Reflection and changing the value from 5 to 4. I thought it might be helpful to share if anyone comes across a similar issue so here are the details anyway:

 

Problem and details:

 

  • What the dots/pixelled areas look like, compared to what was expected:

 Shot01a_v1_PanScene_BatchRender_074.png

(1a: unwanted white spots)

 

Shot00_v3_titleShot_BatchRender_001.png

(2a: white pixelled areas on ocean)

 

Shot01a_v1_PanScene_BatchRender_093.png

(1b: what was expected)

 

Shot00_v3_titleShot_BatchRender_009.png

(2b: what was expected, no bright white areas on ocean)

 

  • Basic settings:
    • Version: Maya 2016 for Mac
    • Renderer: Mentalray

I have four lights in the scene -- an ambient light and three spotlights and most of the white spots seemed to appear on the ocean shader in my scene but I didn't get a chance to test and record the effect when I turned the ocean shader off.

 

I would be more than happy to share more details but they weren't really relevant to the fix and I don't know whether they contributed to the white spots or not.

 

Attempted fixes and observations:

 

  • I suspected that it might be to do with some areas being rendered too bright and then appearing white, after someone mentioned bright lights causing 'super-whites'. Initially I wasn't sure how to fix something like that and how to identify whether it was happening in my scene, but then I considered it might be related to how light was moving around in my scene and that was when I checked my Render Settings.
  • I noticed that even after redoing the same render, the position of the white spots could change but they were in the same general location -- they appeared in areas of highlight.

 RedoingRender.gif

 (GIF comparing a redone render from same angle, same frame, but white spots are in slightly different places)

 

  •  Sometimes changing the camera angle by a bit would stop the dots from appearing, sometimes they still remained in the same general location as well.

  • I noticed changing some of the parameters, such as the Lacurity on a Brownian Motion connection for a Bump Map affected how the white spots appeared, but again I didn't record how much I changed it by, and whether the white spots were just changing because I had redone a render.

To clarify, when I say other suggestions on the pages I looked up didn't seem to apply to mine, I mean they seem to be using more advanced settings or features that I haven't used in mine (such as photons, area lights etc) and they seemed more specific for each person's case.

 

Solution that worked:

FixedRenderSettings_forWhiteSpotsAnnotated.png

(I changed Reflection from 5 to 4, a much quicker fix than I expected.)

 

I am not sure why I had it at 5 but I compared to my teacher's settings which had the numbers at default, and I tested what would happen if I changed it back. It not only got rid of the white dots but seems to takes less time to render too. 

 

I can upload any additional settings or the file itself if it might be of any use. And I would be more than glad to explain anything in more detail at any time as well. Thanks, any additional information or thoughts are very welcome. 

 

Here are some other pages that helped me:

 

(Even though they are from a little while back, they gave me some really helpful things to think about.)

0 Likes
1,544 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Apologies, the GIF doesn't seem to be working so here are the separate photos in it. Both are at the same angle and same frame, just redone.

 

RedoingRenderPart1.pngRedoingRenderPart2.png

The white spots changed location slightly and where there were white spots, sometimes it did render as expected.

0 Likes
Message 3 of 4

Anonymous
Not applicable

An extra note, for some reason the change in Render Settings didn't seem to come through when I Batch Render. The Batch Renders take as long as they did before the Reflection decrease, and they still come out with a lot of white spots. There is only the occasional frame with white spots when I render a single frame.

 

I am currently using a workaround from this page http://simplymaya.com/forum/showthread.php?t=33608 to render large groups of frames without using Batch Render, to get around the problem with the white spots still appearing in Batch Render.

0 Likes
Message 4 of 4

Anonymous
Not applicable

Just an update on my experience (again I'm just sharing this for the benefit of others):

 

Switching on Indirect Diffuse (GI) Mode seems to work:

 

I found that switching on GI helped, it dramatically decreased the rate at which the white spots were appearing (I encountered no frames with the white spots while I turned it on, but I hadn't tested it thoroughly.) It is in Render Settings>Quality (this is for mentalray).

Screen Shot 2016-11-11 at 7.41.35 pm.png

I really don't know what it does though yet, I just found that it seemed to work for this. The downsides are it at least doubles the rendering time, and seems to affect the lighting across the scene. It did make my lighting look softer and more tinged but since I had already rendered some other frames, I didn't want to throw those away because of the lighting inconsistency, so I didn't end up using it. But it would be totally fine if you're okay with all your frames having it switched on.

 

Rendering region works:

When it didn't work, I found that Rendering a Region at a time was a lot faster than re-rendering the whole image. Sometimes it would take anywhere between 1 and 10 or so tries, but it's pretty much guaranteed to work at some point. This is probably the easiest option if you have only a couple of frames that are tainted.

 

More observations and ideas on what causes it:

This time I noticed that the white spots appeared wherever areas of highlight on the ocean shader met the darker areas of the land, and it was in the same consistent spot for certain frames. For example, the ocean peaks were lighter in colour and whenever they met the land, the white spots were very likely to appear. 

 

What wasn't consistent, however, was when mentalray decided to render the area correctly as expected without the white spots; it seemed pretty random when I re-rendered a region. This might suggest that the white spots appear where there is more contrast between lighter and darker areas but I couldn't be sure. I initially suspected it was some paintfx-to-polygons that were where there were white spots but it wasn't.

 

 

Batch Render workaround:

 

  • The Batch Render workaround worked when I found I could render 3 frames in a row manually without any white spots appearing. But I had at least a hundred frames that had the white spots and I did do it for all of them manually. There's no reason why no one else can't take that path too 🙂

 

  • It might seem a bit tedious, but it was pretty much the fastest option I had though -- it was quicker to re-render a section than wait for a batch render, then look at all those frames that were 'tainted' and then re-render those. So if you have the patience, I split John Mather's script into one that saves the current frame that has been rendered in the Render Window, and another one that renders the next frame. Even if it doesn't end up being used for fixing the white spots, it might be helpful for other things.

 

All of this edited from John Mather's work: https://www.creativecrash.com/users/john-mather/forums

 

Script for saving frame that has just been rendered in Render Window:

There are two things to set: the prefix of the name of the save file, and the frame padding.  These options are the same as in the Render Settings:

 

Screen Shot 2016-11-11 at 7.30.47 pm.png

 

The script defaults to the image format you have set in the Render Window. In the MEL script, I denoted where to set them with // >>> If anyone does happen to end up using this, I would be more than happy to help out with whatever I can but I don't want to dwell on it too much 🙂 A quick tip, to run these go to Windows>General Editors>Script Editor and paste them in the bottom window.

 

 

// Save frame currently in Render Window
// This has been edited by t_111111 http://forums.autodesk.com/t5/user/viewprofilepage/user-id/4194214 // Original from: // Batch rendering workaround V4 - John Mather (NextDesign) // Author page: http://www.creativecrash.com/users/john-mather // Check for updates here: http://simplymaya.com/forum/showthread.php?p=318227 // >>> Set file name here string $filename = "";

// >>> Set frame padding here
int $nFramePadLength = 4; // eg name.0000.ext (4 zeros) // Save the current time unit in a variable // string $timeFormat = `currentTime -query -time`; float $time = (`currentTime -q`); int $startFrame = $time; string $directory = (`workspace -q -rd` + "images/"); // check for render panel. Found here: http://www.creativecrash.com/forums/mel/topics/error-object-not-found-renderview string $renderPanel; string $renderPanels[] = `getPanel -scriptType "renderWindowPanel"`; if(size($renderPanels)) { $renderPanel = $renderPanels[0]; } else { $renderPanel = `scriptedPanel -type "renderWindowPanel" -unParent renderView`; scriptedPanel -e -label "Render View" $renderPanel; } // get the image format in the render globals int $format = `getAttr "defaultRenderGlobals.imageFormat"`; string $extension = ""; switch($format) { case 0: $extension = "gif"; break; case 1: $extension = "pic"; break; case 2: $extension = "rla"; break; case 3: $extension = "tif"; break; case 4: $extension = "tif"; break; case 5: $extension = "sgi"; break; case 6: $extension = "als"; break; case 7: $extension = "iff"; break; case 8: $extension = "jpg"; break; case 9: $extension = "eps"; break; case 10: $extension = "iff"; break; case 11: $extension = "cin"; break; case 12: $extension = "yuv"; break; case 13: $extension = "sgi"; break; case 19: $extension = "tga"; break; case 20: $extension = "bmp"; break; case 22: $extension = "mov"; break; case 30: $extension = "pntg"; break; case 31: $extension = "psd"; break; case 32: $extension = "png"; break; case 33: $extension = "pict"; break; case 34: $extension = "qtif"; break; case 35: $extension = "dds"; break; case 36: $extension = "psd"; break; } currentTime $startFrame; // pad the frame number string $framePadded = $startFrame; while (`size($framePadded)` < $nFramePadLength) $framePadded = ("0" + $framePadded);
// You can also change the formatting of the file name here string $concatFilename = $directory + $filename + "_" + $framePadded + "." + $extension; if (`getApplicationVersionAsFloat` >= 2011) // Thanks to nowayfra on creativecrash for his workaround catch(eval(renderWindowSaveImageCallback ($renderPanel, $concatFilename, `getAttr defaultRenderGlobals.imageFormat`))); else renderWindowSaveImageCallback ($renderPanel, $concatFilename, `getAttr defaultRenderGlobals.imageFormat`);

 

Script for rendering next frame in timeline:

 

 

// Render next frame in timeline
// This has been edited by t_111111 http://forums.autodesk.com/t5/user/viewprofilepage/user-id/4194214

// Original from:
// Batch rendering workaround V4 - John Mather (NextDesign) // Author page: http://www.creativecrash.com/users/john-mather // Check for updates here: http://simplymaya.com/forum/showthread.php?p=318227 // Thanks to http://forums.cgsociety.org/archive/index.php?t-477327.html int $startFrame = `currentTime -q`; $startFrame = $startFrame + 1; // check for render panel. Found here: http://www.creativecrash.com/forums/mel/topics/error-object-not-found-renderview string $renderPanel; string $renderPanels[] = `getPanel -scriptType "renderWindowPanel"`; if(size($renderPanels)) { $renderPanel = $renderPanels[0]; } else { $renderPanel = `scriptedPanel -type "renderWindowPanel" -unParent renderView`; scriptedPanel -e -label "Render View" $renderPanel; } // start the progress bar global string $gMainProgressBar; progressBar -edit -beginProgress -isInterruptable true -status "Rendering..." -maxValue $startFrame $gMainProgressBar; // check for user termination if(`progressBar -query -isCancelled $gMainProgressBar`) { // break; // progressBar -edit // -step 1 $gMainProgressBar } else { currentTime $startFrame; renderWindowRender redoPreviousRender renderView; } progressBar -edit -endProgress $gMainProgressBar; // clear the progress bar

 

Before I used these, I had to choose the camera I wanted to render from and do the first render through it. How I used these scripts was I saved each to my shelf. Then I'd click the Render Next Frame script, then click the Save Current Frame script when it finished rendering and I'd re-rendered any region that had white spots. It saved me from having to navigate to the file directory each time I clicked save.

 

 

I also edited the whole batch render workaround a tiny bit so that it will render a specific list of frames too. It was helpful when the frames rendered correctly again after 1 try, but some were just stubborn and that's why I decided to do them manually.

 

Script for rendering a specific list of frames:

The set file name and set frame pad length are the same for the 'save frame currently in render window' script (the first one). There is an extra one to set, and that is the frame list. You can type in the numbers of the frames you want to batch render.

 

// Render a specific list of frames
// This has been edited by t_111111 http://forums.autodesk.com/t5/user/viewprofilepage/user-id/4194214

// Original from:
// Batch rendering workaround V4 - John Mather (NextDesign) // Author page: http://www.creativecrash.com/users/john-mather // Check for updates here: http://simplymaya.com/forum/showthread.php?p=318227 // Specific // >>> Set file name here string $filename = ""; // >>> Set frame list here int $frameArray[] = {1,2,3,5,8}; // type in whatever numbers you want to batch render with commas in between e.g. {1,2,3,5,8} will batch render frames 1,2,3,5 and 8
// >>> Set frame padding here int $nFramePadLength = 3; // eg name.0000.ext (4 zeros)
int $frameArraySize = size($frameArray); // <<<specific string $directory = (`workspace -q -rd` + "images/"); // check for render panel. Found here: http://www.creativecrash.com/forums/mel/topics/error-object-not-found-renderview string $renderPanel; string $renderPanels[] = `getPanel -scriptType "renderWindowPanel"`; if(size($renderPanels)) { $renderPanel = $renderPanels[0]; } else { $renderPanel = `scriptedPanel -type "renderWindowPanel" -unParent renderView`; scriptedPanel -e -label "Render View" $renderPanel; } // get the image format in the render globals int $format = `getAttr "defaultRenderGlobals.imageFormat"`; string $extension = ""; switch($format) { case 0: $extension = "gif"; break; case 1: $extension = "pic"; break; case 2: $extension = "rla"; break; case 3: $extension = "tif"; break; case 4: $extension = "tif"; break; case 5: $extension = "sgi"; break; case 6: $extension = "als"; break; case 7: $extension = "iff"; break; case 8: $extension = "jpg"; break; case 9: $extension = "eps"; break; case 10: $extension = "iff"; break; case 11: $extension = "cin"; break; case 12: $extension = "yuv"; break; case 13: $extension = "sgi"; break; case 19: $extension = "tga"; break; case 20: $extension = "bmp"; break; case 22: $extension = "mov"; break; case 30: $extension = "pntg"; break; case 31: $extension = "psd"; break; case 32: $extension = "png"; break; case 33: $extension = "pict"; break; case 34: $extension = "qtif"; break; case 35: $extension = "dds"; break; case 36: $extension = "psd"; break; } // start the progress bar global string $gMainProgressBar; // progressBar -edit -beginProgress -isInterruptable true -status "Rendering..." -maxValue $endFrame $gMainProgressBar; for ($indexOfFrameArray = 0; $indexOfFrameArray < $frameArraySize; $indexOfFrameArray++) { // check for user termination if(`progressBar -query -isCancelled $gMainProgressBar`) { break; // progressBar -edit // -step 1 $gMainProgressBar } else { int $i = $frameArray[ $indexOfFrameArray ]; // commented out for specific currentTime $i; renderWindowRender redoPreviousRender renderView; // pad the frame number string $framePadded = $i; while (`size($framePadded)` < $nFramePadLength) $framePadded = ("0" + $framePadded); string $concatFilename = $directory + $filename + "_" + $framePadded + "." + $extension; if (`getApplicationVersionAsFloat` >= 2011) // Thanks to nowayfra on creativecrash for his workaround catch(eval(renderWindowSaveImageCallback ($renderPanel, $concatFilename, `getAttr defaultRenderGlobals.imageFormat`))); else renderWindowSaveImageCallback ($renderPanel, $concatFilename, `getAttr defaultRenderGlobals.imageFormat`); // progressBar -edit -step 1 -status ("// Rendering frame " + (($i - $startFrame) + 1) + " of " + (($endFrame - $startFrame) + 1)) $gMainProgressBar; // update the progress bar print ("// Saved " + $concatFilename + "\n"); } } progressBar -edit -endProgress $gMainProgressBar; // clear the progress bar // print ("// Completed rendering of " + ($frameArraySize) + " frames.\n");

I didn't rigorously test everything simply because of time, but hopefully they might give you some things to think about just like the other threads gave me some things to consider. The scripts are probably excessive but I just wanted to document them somewhere and I thought I might as well put them in the same place.

 

If anything, I learnt much about how lovely it is that there is so much help is out there, I learnt that programming could apply here too, and got to try out some MEL 🙂 Again feel free to ask or make suggestions at any time -- a lot of the information I got was at least a few years old and I would be happy to come back in a few years' time if it comes to that. (I'm very new to MEL but it seems awesome -- being able to automate things here is amazing.) I think my teacher said that others had come across the white spots problem too.

 

I'd just like to give a huge thanks to John Mather/NextDesign for being really lovely and conjuring this script up so quickly for the people that needed it at the start, it's helped me heaps too and also inspired me very much.

0 Likes