Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: Ondra on 2012-09-28, 15:13:53

Title: Your input needed: Background overrides
Post by: Ondra on 2012-09-28, 15:13:53
Hi,

I am currently struggling with the issue of how to implement background overrides properly. Obviously there will be overrides in the global Corona settings. Currently these are:

- Reflection override
- Refraction override
- Direct visibility override (also used for opacity and double-sided glass rays)

The "main" background (for diffuse lighting and all other components that are not overriden) is taken from the "Environment and effect" 3dsmax dialogue.

First problem: Should the "Main" background settings be also in Corona dialogue, to keep all needed settings in single place? The options are:

Then we need per-material overrides. The question is, how to do it. Most renderers have just reflection override, but there is no reason why other two couldn't be added. So:
Second problem: What should be overridable on per-material basis? Only reflections? Reflections&refractions? Direct rays (what is seen through transparent materials)? What is seen on diffuse surfaces?

And the last problem is how to implement the per-material overrides in GUI. One possibility is to add map slots for all of them. Other possibility is to create a special Corona map that will have the different slots for different overrides. This was proposed by somebody (I dont remember who) as easy way to intechange prepared "presets" of backgrounds.

Third problem: Implement individual overrides or "override shader" texmap? Which is more user-friendly? Do the override shader also for global overrides?

Discuss...
Title: Re: Your input needed: Background overrides
Post by: racoonart on 2012-09-28, 15:53:30
First problem:
Remove the "main" override from rendersettings; keep direct, reflect, refract in the Rendersettings and use the standard 3dsmax global environment settings for the "main" setting. I hate it when different renderengines try to bypass the max functionality. That's horrible for scripting and is always causing unnecessary trouble.

Second problem:
I'd love to have all possibilities :) direct, reflect, refract,... If it's possible, why not?

Third problem:
Override map for a environment slot wouldn't be a bad idea. So we can instance this map on serveral other materials, which is way easier to change than having each slot seperately in each material.
I like having the individual colors and slots in the rendering options but it would be ok to make a slot for a "environment override map", too.
Title: Re: Your input needed: Background overrides
Post by: Ludvik Koutny on 2012-09-28, 16:54:38
But seriously, ask yourself a question. Have you ever personally in your professional career needed to override environment per material? Like if you have 2 spheres in same scene, and each reflects different environment, or they both reflect same enviro but one of them refracts something different. Does that even make sense? Why would you want to do such a thing?

We are talking about per material !Environment! override, not per material ray switcher, like MR or Vray have, where you can make material return for example different diffuse color for GI than what is directly visible. ;)

Just think about it.... I am not against this feature, but not matter how hard i think, i can't come up with single scenario where this functionality would make any significant benefit. That's why i am asking, so maybe someone can come up with something.
Title: Re: Your input needed: Background overrides
Post by: loocas on 2012-09-28, 17:26:40
But seriously, ask yourself a question. Have you ever personally in your professional career needed to override environment per material? Like if you have 2 spheres in same scene, and each reflects different environment, or they both reflect same enviro but one of them refracts something different.

Yes, many times.

As explained via skype. When I setup my shot and everything looks cool, for examply my chrome reflects perfectly fine my HDRis, but my glass looks a bit flat, so, what I can do with a per-material override, is to copy the same HDRi, offset it, or even crop it a bit and apply it only to my glass materials.

Arguing against this option is pointless. It's an option to those who need and use it. Period.
Title: Re: Your input needed: Background overrides
Post by: racoonart on 2012-09-28, 17:28:40
Oh, there are definitely reasons for that. I could have needed that just 1 week ago. It's not about needing it every day... but when you have to change such a thing you're happy when you have it. There are clients who want to change some very specific things and that's sometimes very difficult to do without a lot of override options. I'd be happy to have it...
Title: Re: Your input needed: Background overrides
Post by: loocas on 2012-09-28, 17:36:48
Remove all main background settings from Corona dialogue, use 3dsmax's entirely

This!

Second problem: What should be overridable on per-material basis? Only reflections? Reflections&refractions? Direct rays (what is seen through transparent materials)? What is seen on diffuse surfaces?

finalRender can override per material all reflections, refractions and GI, but I've personally never used the GI override, to be honest. So my vote would go to only Reflect/Refract overrides per material.

And the last problem is how to implement the per-material overrides in GUI. One possibility is to add map slots for all of them. Other possibility is to create a special Corona map that will have the different slots for different overrides. This was proposed by somebody (I dont remember who) as easy way to intechange prepared "presets" of backgrounds.

See attachment.

Third problem: Implement individual overrides or "override shader" texmap? Which is more user-friendly? Do the override shader also for global overrides?

Don't mimic mental ray. :) Use direct overrides, not specific shaders. ;)
Title: Re: Your input needed: Background overrides
Post by: Ondra on 2012-09-28, 17:51:11
Hm, I like the idea of Main environment radio button switch between "Use 3dmax enviro settings" and values specified in renderer dialogue.... ;)
Title: Re: Your input needed: Background overrides
Post by: loocas on 2012-09-28, 17:52:29
Hm, I like the idea of Main environment radio button switch between "Use 3dmax enviro settings" and values specified in renderer dialogue.... ;)

Oh yeah, that's the whole point. :)
Title: Re: Your input needed: Background overrides
Post by: Ondra on 2012-09-28, 17:58:23
I guess thats the way how to eat the cake and have it too - you dont have to switch to different dialogue to setup each scene, but scripters wont get screwed over ;). So that solves #1 problem.

#2: overriding reflect, refract & opacity is fine by me. Overriding diffuse would be VERY hard ;).

#3: still remains.
Title: Re: Your input needed: Background overrides
Post by: loocas on 2012-09-28, 18:06:38
I guess thats the way how to eat the cake and have it too - you dont have to switch to different dialogue to setup each scene, but scripters wont get screwed over ;). So that solves #1 problem.

#2: overriding reflect, refract & opacity is fine by me. Overriding diffuse would be VERY hard ;).

#3: still remains.

What is a Diffuse override?

And what is a Opacity override (do you consider opacity as refraction?), if so, you should NOT treat opacity as refraction with the index of 1, because refraction with the index of 1 is refraction with the index of 1 :) Opacity does NOT exist in the real world and is very, very useful for creating cut-outs and mattes in the CGI world. It should NOT show the same bg as the refraction override dictates! EVER!
Title: Re: Your input needed: Background overrides
Post by: Ludvik Koutny on 2012-09-28, 18:25:18
Invisible part of opacity should always display same thing as direct visibility.
Title: Re: Your input needed: Background overrides
Post by: Ondra on 2012-09-28, 18:34:52
What is a Diffuse override?

And what is a Opacity override (do you consider opacity as refraction?), if so, you should NOT treat opacity as refraction with the index of 1, because refraction with the index of 1 is refraction with the index of 1 :) Opacity does NOT exist in the real world and is very, very useful for creating cut-outs and mattes in the CGI world. It should NOT show the same bg as the refraction override dictates! EVER!

Diffuse override is what you would call GI or lighting, but I can not, because corona is physically based and therefore reflections and refractions also contribute to GI ;)

opacity: override: sorry, I was missing an oxford comma there ;). Of course opacity will have different override from refraction
Title: Re: Your input needed: Background overrides
Post by: loocas on 2012-09-28, 18:45:36
Diffuse override is what you would call GI or lighting, but I can not, because corona is physically based and therefore reflections and refractions also contribute to GI ;)

Well, couldn't the overriden reflections and refractions normally contribute to the lighting model, but independant to the global diffuse (gi) setup?

So, if you had a pure green background that'd be lighting the scene, but you set a pure red refraction/reflection override, then the correct sum of them both would produce yellow light in some parts of the render (grossly simplyfied, of course).
Title: Re: Your input needed: Background overrides
Post by: Ondra on 2012-09-28, 18:59:19
Yes.

The trick is that sometimes you need to sample more the BRDF (specular materials) and sometimes the environment (diffuse materials). Then you combine both types of samples to get the optimal and correct result. MIS automatically weights both types of samples.

But overrides currently change only the BRDF sampling, as it would be really hard to implement overriding both types of sampling (there would be performance and memory penalty and the code would get ugly). This is not as big problem for specular reflection/refraction, because nearly 100% of its result is created from BRDF sampling. But for diffuse and low-gloss surfaces its about 50:50. Therefore diffuse override would work only partially.
Title: Re: Your input needed: Background overrides
Post by: loocas on 2012-09-28, 19:20:00
Yes.

The trick is that sometimes you need to sample more the BRDF (specular materials) and sometimes the environment (diffuse materials). Then you combine both types of samples to get the optimal and correct result. MIS automatically weights both types of samples.

But overrides currently change only the BRDF sampling, as it would be really hard to implement overriding both types of sampling (there would be performance and memory penalty and the code would get ugly). This is not as big problem for specular reflection/refraction, because nearly 100% of its result is created from BRDF sampling. But for diffuse and low-gloss surfaces its about 50:50. Therefore diffuse override would work only partially.

Hmm... ok then. No diffuse override. :)
Title: Re: Your input needed: Background overrides
Post by: Javadevil on 2012-09-29, 06:24:52


I suggested the shader background environment switcher, similar to mental rays.
It's handy to have a material library setup with combinations of hdri environment maps, back ground maps, (reflection and refraction if need be).
Scenes that require multiply lighting configurations are easy to setup this way, one shader for dusk, one for day light, etc..   
Simple drag and drop a prepared environment shader into the background, its easy to transfer shaders around to other people in the office without needing the a 3dsmax scene.

I'd like direct lighting over ride for Glass materials, that have attenuation, instead of physically based caustics.

Tone mapping needs a "Do Not" effect background map.

Scene material override, have an option for material Buffer ID overrides, Instead of object based, this works better for multi-sub material objects.





Title: Re: Your input needed: Background overrides
Post by: Ondra on 2012-09-29, 11:01:23
ok, look like we have consensus on the first two questions, I've added vote on the last one
Title: Re: Your input needed: Background overrides
Post by: Paul Jones on 2012-09-29, 16:08:59
Remove all main background settings from Corona dialogue, use 3dsmax's entirely

This!

Second problem: What should be overridable on per-material basis? Only reflections? Reflections&refractions? Direct rays (what is seen through transparent materials)? What is seen on diffuse surfaces?

finalRender can override per material all reflections, refractions and GI, but I've personally never used the GI override, to be honest. So my vote would go to only Reflect/Refract overrides per material.

And the last problem is how to implement the per-material overrides in GUI. One possibility is to add map slots for all of them. Other possibility is to create a special Corona map that will have the different slots for different overrides. This was proposed by somebody (I dont remember who) as easy way to intechange prepared "presets" of backgrounds.

See attachment.

Third problem: Implement individual overrides or "override shader" texmap? Which is more user-friendly? Do the override shader also for global overrides?

Don't mimic mental ray. :) Use direct overrides, not specific shaders. ;)

Pretty much nailed it there Loocas
Title: Re: Your input needed: Background overrides
Post by: superrune on 2012-10-17, 23:17:01
Choices are good I think. In Brazil you could do both environment overrides inside the material and through the renderer. I would support overrides of both reflections and refractions inside the material if I were you. I've sometimes missed the MR override texture as well, that seemed like a neat thing.

I recommend doing a comprehensive override material, such as Brazil used to have (see screenshot). For some, this might seem as overkill - but it's extremely flexible in use. Using the Slate editor, it's very easy to take a complex car material, and then make multiple variations on it by overriding just the color or the bump. You can also substitute the GI rays for that material with a simpler material (say without bump, sss or reflections) to speed up render.