Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Feature Requests => [Max] Resolved Feature Requests => Topic started by: Siahpoosh on 2014-04-16, 01:51:43

Title: Cutoff for light rays
Post by: Siahpoosh on 2014-04-16, 01:51:43
Hi
first i want to say thank u for your great render engine its very fast and stable for me. i have a exterior scene with more than 30000 lights , i created a sample scene with 30000 lights and a plane as ground , after hit render button i got too much noise also if i zoom on a area for example frame 10 lights render is noisy again and long render time .
if i have an option to cutoff light rays at a distance radius , my render will be much faster. (something like cutoff in vrayLight)
Title: Re: Cutoff for light rays
Post by: Ludvik Koutny on 2014-04-16, 14:46:47
No...  it just does not work this way. Renderers are not the same, so what may work for vray may not work for corona, or may not even be possible in corona. Also, UI should not be cluttered with stuff like this.

It's simple, just do not make scenes with 30 000 lights...

There's 250 light limit... (it's quite dumb the limit is so low... could be at least twice as much till light sampling stops being effective, but nothing we can do about that...) more lights than this limit will slow down the scene dramatically. BUT you can use geometry with CoronaLightMTL instead of lights, and attach geometry lights together to create light groups. Then group them together until total light object amount is under 250. That should work.

But unless you have a specific reason or request, then do not create difficult scenes on purpose. If you have a huge city, with 30 000 lights, then lights in background can be easily swapped for self-illumination materials (NOT CoronaLightMTL!!!) and no one will ever notice.

I do not understand why people tend to just create difficult scenes and throw it at the renderer. That will never get the job done...  with any renderer.
Title: Re: Cutoff for light rays
Post by: Ondra on 2014-04-16, 14:59:07
As I've said many times, I will not implement this feature. I will instead try to improve sampling algorithms.
Title: Re: Cutoff for light rays
Post by: zzubnik on 2014-04-16, 15:01:36
There is no point in wasting development time to implement 30,000 lights. As said above, that is just ridiculous!
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-16, 15:21:55
thank u guys for answers . in vray i wrote an script for merging light objects 100 by 100 to vraylightmesh and its helped me so much for speed up render to 20x , but the problem is i need more speed , corona by default is much faster than vray in my situation . i tried to merge lights together like before but its not help. i got much better result when using Coronalight (for every 30000 lights)
Title: Re: Cutoff for light rays
Post by: Ludvik Koutny on 2014-04-16, 16:02:42
Can you post the practical example of a scene where so many lights are required?
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-16, 17:02:08
Can you post the practical example of a scene where so many lights are required?
for example something like this :
(http://images.boomsbeat.com/data/images/full/23159/city_6-jpg.jpg)

i have a very large city in night with 4000 cars and each car have 4 lights (2 front and 2 back) and i have long shots , medium shots and closeup shots from my city.
Title: Re: Cutoff for light rays
Post by: zzubnik on 2014-04-16, 17:12:51
I'm not sure this is the type of render that this type of render engine is made for.
Title: Re: Cutoff for light rays
Post by: Ludvik Koutny on 2014-04-16, 19:53:37
Can you post the practical example of a scene where so many lights are required?
for example something like this :
(http://images.boomsbeat.com/data/images/full/23159/city_6-jpg.jpg)

i have a very large city in night with 4000 cars and each car have 4 lights (2 front and 2 back) and i have long shots , medium shots and closeup shots from my city.

Exactly as i said above. Everything in background, that's not center of attention, can easily be solved by self-illumination feature of CoronaMTL. It is not sampled as explicit light, so it does not matter how many of them you have. Yet it will illuminate it's surroundings. Just do not use self-illum as a key light in your scene. As a sun, or main lamp, or something... But if you use it to light up windows in distant buildings, lights on cars, street lamps, etc... it will work.

I can not even imagine it would be efficient to create this scene by manually placing light sources. It would make a lot more sense to create about 10 different buildings, then create self illumination maps for windows, for example one map for entire building, and then scatter those buildings around in the background. I can not really imagine you would have manually placed lights in such a huge scene...  i am not sure 3ds Max viewport could even handle it at workable framerate.
Title: Re: Cutoff for light rays
Post by: Ondra on 2014-04-16, 19:58:39
I wouldnt mind if somebody actually had similar scene and sent it to me for research ;)
Title: Re: Cutoff for light rays
Post by: zzubnik on 2014-04-16, 20:12:02
Unless this was for a giant flythrough, much of that would be matte painted, if we're talking movies.
Title: Re: Cutoff for light rays
Post by: maru on 2014-04-16, 20:20:21
I would approach this with as much fakes and procedural generation as possible. :)
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-17, 00:13:23
RE: Rawalanche
i have flythrough camera on the city and also i have animated lights based on distance from a point . something like this :
(http://s23.postimg.org/4fr96fhkr/test.jpg)
i cant fake that with mate painting or ...

RE: Keymaster
i can make a sample scene if u want.

RE: zzubnik
yes i have a giant flythrough , as i said in top of this post i cant fake that with matte painting or other solutions.

RE: maru
actually i wrote a lot of tools for doing this procedurally , my scene is fully optimized the only problem is count of lights , and there is no solution for that.

here is an comparison of my main road lights in city between coronalightmtl and coronalights after 20min :
(http://oi62.tinypic.com/2cznrr.jpg)
(http://oi61.tinypic.com/5os8xk.jpg)

Title: Re: Cutoff for light rays
Post by: Polymax on 2014-04-17, 00:33:25
As I've said many times, I will not implement this feature. I will instead try to improve sampling algorithms.
+1000000

please don't make a vray

cutoff - very bad idea!
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-17, 00:51:52
here is another example , Bidir/VCM as render enigine :
(http://oi60.tinypic.com/5lcgb6.jpg)

result is much better than others , can anyone tell me the limitation of using Bidir/VCM ? i read somewhere its not support all features .
Title: Re: Cutoff for light rays
Post by: Ludvik Koutny on 2014-04-17, 13:34:43
1, do not use Bidir, it is not production ready, and will not give you any benefit in this kind of scene

2, Use CoronaMTL with self illumination for those things, like that light surface animated by distance, CoronaMTL, not CoronaLightMTL, and NOT CoronaLights

3, The example with Bidir/VCM you posted shows clearly, that there is absolutely no reason to have so many lights... You can super easily just paint this as a self illumination map.

4, This is not Corona related problem. This is workflow related problem. If you will keep making difficult scenes without thinking how to optimize them, every single renderer will fail at some point.
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-17, 14:51:11
1, do not use Bidir, it is not production ready, and will not give you any benefit in this kind of scene

2, Use CoronaMTL with self illumination for those things, like that light surface animated by distance, CoronaMTL, not CoronaLightMTL, and NOT CoronaLights

3, The example with Bidir/VCM you posted shows clearly, that there is absolutely no reason to have so many lights... You can super easily just paint this as a self illumination map.

4, This is not Corona related problem. This is workflow related problem. If you will keep making difficult scenes without thinking how to optimize them, every single renderer will fail at some point.
thanks a lot Rawalanche , also i posted 2 other images on my post check them.
each of this light have animated color ( its an motionGraphic project) ,  i made an scripted plugin for change multiplier of coronalightMtl based on their distance to camera , now render is much faster than before but i cant blend materials in corona like other render engine , for example i want to add a mask for forground and background , forground will be coronallightMTL and background will be selfillumination objects . but its doesnt work for me !
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-17, 15:33:38
and another question why i cant increase selfillumination multiplier higher than a value ? for example i got same result between 100 and 1000 multiplier !
Title: Re: Cutoff for light rays
Post by: Ludvik Koutny on 2014-04-17, 15:39:36
and another question why i cant increase selfillumination multiplier higher than a value ? for example i got same result between 100 and 1000 multiplier !

It's due to the max sample intensity clamping...  It's not sampled as a light, but just as a material. Increasing MSI value will make your rendertime a bit longer though. As i said, do not use self-illum as a key light source in your scene.
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-17, 15:45:44
and another question why i cant increase selfillumination multiplier higher than a value ? for example i got same result between 100 and 1000 multiplier !

It's due to the max sample intensity clamping...  It's not sampled as a light, but just as a material. Increasing MSI value will make your rendertime a bit longer though. As i said, do not use self-illum as a key light source in your scene.

thanks a lot , is there any solution for blending coronalightMtl and coronalMtl via map?
Title: Re: Cutoff for light rays
Post by: Ludvik Koutny on 2014-04-17, 19:53:24
and another question why i cant increase selfillumination multiplier higher than a value ? for example i got same result between 100 and 1000 multiplier !

It's due to the max sample intensity clamping...  It's not sampled as a light, but just as a material. Increasing MSI value will make your rendertime a bit longer though. As i said, do not use self-illum as a key light source in your scene.

thanks a lot , is there any solution for blending coronalightMtl and coronalMtl via map?

Why would you do that? It would be very unstable and also slow...
Title: Re: Cutoff for light rays
Post by: Siahpoosh on 2014-04-17, 21:03:54
i made an scripted plugin based on vertexColor , it make a mask based on distance from each object light to camera , with that mask i can separate coronalightMTL(for keylights) and self illuminated object in background for visible directly , i found coronalightmtl sample is base on multiplier , if u set multiplier to 0 your light will be turn off , so with distance mask created i can turn on or off coronalightMTL objects and also control light sample . my rendertime is faster to 10x with this solution.
the only problem is there is no multilayer shader for corona .