Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Nate101 on 2017-01-08, 20:25:47

Title: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-08, 20:25:47
Hi,

Working on a script that utilizes the "render selected" functionality in Corona and having some issues getting a clean output.  I put together an illustration below:

(http://79.170.44.117/nateprototype.com/CoronaForum/CombinedImage1.jpg)  (http://79.170.44.117/nateprototype.com/CoronaForum/CombinedImage2.jpg)

In image A I rendered the whole scene.  The outer circle has a green material and the inner has a gray.  In image B, I changed the material of the inner circle to green and enabled "render selected" in Corona.  As you can see the output image has some artifacts where the inner and outer circles meet (looks like some of the old gray material is still showing through).

(http://79.170.44.117/nateprototype.com/CoronaForum/CombinedImage3.jpg)

In image C I rerendered the whole image (ie "render selected" turned off) with both the inner and outer circles in green and the artifacts disappear.  Am I doing something wrong or is this just a limitation of the "render selected" functionality?  I am using Corona v1.3 if that is relevant.  I thought the issue might get better with additional passes but that doesn't really help.
Title: Re: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-10, 17:44:14
I guess nobody else has had this issue?  Was going to try some different ways of selecting the inner circle (with object ID, include/exclude list, etc.) and see if that made any difference.

I've been noodling on the problem a little more, and realized all I really need is to expand the render region by a couple pixels in all directions.  It's almost like the region Corona is drawing around the inner circle is cut too tight (like in Photoshop when you need to increase the tolerance of the magic wand tool).

Even if I could just select a square region that fully encompassed the inner circle that would accomplish my goal.  Is there anyway to automate that process?  Basically create a square render region that is sized to the "extents" of a selected object in the scene.
Title: Re: Artifacts around edges of render selected region
Post by: mferster on 2017-01-10, 18:25:01
Yah I've had this issue before too. But I just ended up using render region exclusively instead. Unfortunately... I may be wrong, but I'm pretty sure there wouldn't be a way to translate an object selection to render region coordinates.
Title: Re: Artifacts around edges of render selected region
Post by: Romas Noreika on 2017-01-10, 18:31:23
mferster - do you use max region rendering or corona region rendering. And for region rendering are you using passes limitation or the noise threshold instead?
Title: Re: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-10, 18:53:23
Yah I've had this issue before too. But I just ended up using render region exclusively instead. Unfortunately... I may be wrong, but I'm pretty sure there wouldn't be a way to translate an object selection to render region coordinates.

Thanks, unfortunately I have to render thousands of images so manually selecting an appropriate region each time isn't feasible. Wish there was a way I could just add some cushion to the "render selected" region that Corona is calculating.
Title: Re: Artifacts around edges of render selected region
Post by: mferster on 2017-01-10, 21:33:25
@Nate - hmmmm can you describe what you are planning on rendering?Is it an animation? If not Is it possible for you to render a backplate without the changing objects and then follow up the backplate render with your your changing element as an isolated render w/ shadowcatcher & alpha and then just comp the variations after the fact?

@Romas - I use the corona render region and i use a pass # threshold.
Title: Re: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-11, 00:07:45
@Nate - hmmmm can you describe what you are planning on rendering?Is it an animation? If not Is it possible for you to render a backplate without the changing objects and then follow up the backplate render with your your changing element as an isolated render w/ shadowcatcher & alpha and then just comp the variations after the fact?

Not an animation, more of a configurator where I need to render every combination of materials the product could be configured with (and from multiple angles).  Was hoping to utilize render selected to make the rendering process more efficient but I need the output to be pixel perfect.
Title: Re: Artifacts around edges of render selected region
Post by: mferster on 2017-01-11, 18:09:41
In that case I think it would end up being faster for you if you isolate and render each element with the different material variations and then making the different combinations in post. Instead of rendering 1000 individual images you would only need to render like 15.

*I've attached some examples
Title: Re: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-11, 19:45:51
*I've attached some examples

Thanks for the thoughtful response and the illustrations.  I actually am employing post-processing in a similar fashion to what you are describing (to bring the render load down from millions of images to thousands ha) but maybe not as efficiently as what you're proposing.  How did you render this image, for example:

(http://79.170.44.117/nateprototype.com/CoronaForum/bacK_2.png)

Did you just turn off the visibility for all the other elements in the scene?  Do they still cast shadows, reflections, indirect illumination, etc. upon the yellow backrest?  How would that work if there was another object in front partially obscuring the yellow backrest?  For my purposes, the backrest has to render identically to how it would have if I was rendering the whole scene.

The script I wrote would have rendered the entire scene (including the rest of the chair), and used a c_mask for the backrest to "extract" it in post processing.  I was hoping to implement render selected so I could isolate the backrest during the render process and not be forced to render the rest of the chair (which gets discarded in post anyway).  Maybe what you did here accomplishes the same thing?
Title: Re: Artifacts around edges of render selected region
Post by: mferster on 2017-01-11, 21:44:02

Did you just turn off the visibility for all the other elements in the scene?  Do they still cast shadows, reflections, indirect illumination, etc. upon the yellow backrest?  How would that work if there was another object in front partially obscuring the yellow backrest?  For my purposes, the backrest has to render identically to how it would have if I was rendering the whole scene.

The script I wrote would have rendered the entire scene (including the rest of the chair), and used a c_mask for the backrest to "extract" it in post processing.  I was hoping to implement render selected so I could isolate the backrest during the render process and not be forced to render the rest of the chair (which gets discarded in post anyway).  Maybe what you did here accomplishes the same thing?

Yes i just toggled off 'visible to camera' in the object properties for all but the individual object. They still receive/cast shadow and reflections as if the entire scene is visible. If you have something in the foreground that obscures the another object in your scene you would need to render that element too and just layer it over top in your post production. I have yet to mention this, but the problem with this method is that it becomes significantly more complicated if you have prominent reflections in your scene because you have to account for those too, and may end up not being feasible...
Title: Re: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-11, 21:55:48
Yes i just toggled off 'visible to camera' in the object properties for all but the individual object. They still receive/cast shadow and reflections as if the entire scene is visible. If you have something in the foreground that obscures the another object in your scene you would need to render that element too and just layer it over top in your post production. I have yet to mention this, but the problem with this method is that it becomes significantly more complicated if you have prominent reflections in your scene because you have to account for those too, and may end up not being feasible...

Thanks that is helpful, I'll mess around with your approach and see if its more compatible with what I've been doing.  Reflections, like you said, are another hurdle I need to tackle.
Title: Re: Artifacts around edges of render selected region
Post by: maru on 2017-01-13, 15:37:50
Even if I could just select a square region that fully encompassed the inner circle that would accomplish my goal.  Is there anyway to automate that process?  Basically create a square render region that is sized to the "extents" of a selected object in the scene.
I'm a bit late here, but what about 3ds Max native "auto region selected"?
Title: Re: Artifacts around edges of render selected region
Post by: mferster on 2017-01-13, 20:10:04
Oh wow Maru, never even realized that button existed! Dang, learn something new everyday.
Title: Re: Artifacts around edges of render selected region
Post by: Nate101 on 2017-01-14, 03:50:26
I'm a bit late here, but what about 3ds Max native "auto region selected"?

Yeah that is a new one for me for too.  Thanks for the tip will try it out tonight.