Distance squared fall off (LightX free plugin)

AlbertoAlberto Posts: 1,436
edited July 2017 in Carrara Discussion

Carrara normal lights do not follow distance square falloff. Neither do it the shape lights or the anything glows. As Phil Wilkes pointed out, only channel glow with indirect light and gamma correction to 2.2 (Carrara - Realism Renderig course). But the use of global illumination produces a slow rendering in native carrara render. This lack was discouraging to me.

Some time ago, Head wax told me:

welcome aboard :) applied maths eh? we can always do with another person to write plug ins for Carrara !

Well, I have experience in java programming, but not in C++ . But they are similar languages, so I resolved to create a plugin for more realistic lights. Thanks to I Samuel for its very useful videos about Carrara SDK https://www.youtube.com/channel/UC-5fwx_PDxjogPf5JewW2fg, otherwise I would be blocked. 

See the two following images (from the working files of Phil's course) 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Both of them are gamma corrected to 2.2. But the first is the rendering of two normal spot lights. The second one uses two SpotLightX (as I called), these follows the inverse squared law. I did not use indirect light

Another example:

They are bulb lights. The first one is linear falloff, the second one is distance squared falloff.

Now, a colorful example:

 

Three spot lights. Again, the first is linear falloff and the second one is squared.

The new lights are as fast and versatile as the normal Carrara lights. And they extends the inverse exponent of falloff to other values, not only 1 or 2 as in linear or distance squared. It can be selected 3 (cubic decay) or 1.42 if you want.

(The plugin can be downloaded at https://www.sharecg.com/v/88725/browse/9/Plug-in/LightX)

twospotLights.png
640 x 480 - 32K
twospotLightsLX.png
640 x 480 - 30K
bulb1_lin.png
640 x 480 - 215K
bulb1.png
640 x 480 - 123K
chroma_linear.png
1280 x 960 - 102K
chroma.png
1280 x 960 - 202K
Post edited by Alberto on
«1

Comments

  • HeadwaxHeadwax Posts: 9,987

    Looks terrific!! Very impressive work, thanks :)

  • AlbertoAlberto Posts: 1,436
    edited July 2017

    An example with three BulbLightX only. 

    The scenary is Columned Hall of AppleJack.

    This is a SpotLightX and a AreaLightX

    Now the receding spheres of the Phil's course. I animate someting by moving the light. 

    First is with glow channel and Global Illumination (1:04 minutes rendering)https://youtu.be/i-eD3pvsGFY

     

    image

    The second one is with a BulbLightX (4 seconds rendering)  https://youtu.be/1aGebPIxy9Y

    image

     

    saloninterior4_2.32min.png
    1280 x 720 - 1M
    AreaySpotX2.png
    1280 x 960 - 147K
    Post edited by Alberto on
  • AlbertoAlberto Posts: 1,436

    head wax said:

    Looks terrific!! Very impressive work, thanks :)

    Thank you for encouraging me!

  • chickenmanchickenman Posts: 1,202

    I must say that it is looking very impressive and keeping render times down wich is always good.

  • Philemo_CarraraPhilemo_Carrara Posts: 1,175
    I agree, it's a very good idea indeed. It's something I've always missed in Carrara. What would make it perfect would be presets (distance and fall off) representing real world values like a 60 Watts incandescent light bulb. It makes lighting so much easier. I don't know if you intend to go commercial with this plugin, but I would be very interested by it.
  • AlbertoAlberto Posts: 1,436

    I'm back!

    The plugin has some limitations: no shadow buffer implemented (raytraced shadow is OK) and is only for Windows (sorry!, I don't own a Mac to complile and test).

    The good news are: it will be available at Sharecg for free!

    I'm only expecting the response of DAZ to the registering of the components IDs ( I sent the email last monday).

    Philemo said:
    What would make it perfect would be presets (distance and fall off) representing real world values like a 60 Watts incandescent light bulb. It makes lighting so much easier.

    Let me think about it. It is an interesting idea.

  • AlbertoAlberto Posts: 1,436

    I must say that it is looking very impressive and keeping render times down wich is always good.

    I agree. I got lower render times with the plugin than using GI. And it's easier to take out the blotches (frequently present in GI)

  • AlbertoAlberto Posts: 1,436

    Let me show you another example:

    The first image is the "Table Lamps" in Carrara native content. It was rendered with the original settings (Lighting Quality is set to Excellent!) . The rendering took 18:28 min.

     

    The second one is a version without GI. I used two BulbLightXs with soft shadows and a normal distant light. The rendering took 1:18 min only.

    I only modifed the shader of the lamp in the foreground.

    TableLamps_GI_original_ 18.28min.png
    800 x 600 - 211K
    TableLamps_LXonlyl_ 1.18min_final.png
    800 x 600 - 155K
  • 3DAGE3DAGE Posts: 3,311

    Does it work with IES files ?

  • PhilWPhilW Posts: 5,145

    Great work on these and I am delighted that I inspired you to create these - I look forward to trying them out for myself.

  • Philemo_CarraraPhilemo_Carrara Posts: 1,175
    Alberto said:

    I'm back!

    The plugin has some limitations: no shadow buffer implemented (raytraced shadow is OK) and is only for Windows (sorry!, I don't own a Mac to complile and test).

    I can compile it for you on OSX if you send me the source.

    Alberto said:

    I'm only expecting the response of DAZ to the registering of the components IDs ( I sent the email last monday).

    I wouldn't wait too long if I were you. I sent a registration mail 1 year and a half ago and I'm still expecting the answer  (Expecting may be an overstatement -:), I've decided to do without after a while).

  • PhilWPhilW Posts: 5,145

    'Tis easier to seek forgiveness than to ask permission...

  • AlbertoAlberto Posts: 1,436
    3DAGE said:

    Does it work with IES files ?

    Yes, it does.

  • AlbertoAlberto Posts: 1,436
    PhilW said:

    Great work on these and I am delighted that I inspired you to create these - I look forward to trying them out for myself.

    Thank you, Phil !

     

    Philemo said:

    I wouldn't wait too long if I were you. I sent a registration mail 1 year and a half ago and I'm still expecting the answer  (Expecting may be an overstatement -:), I've decided to do without after a while).

    Really? OK, I uploaded here:  https://www.sharecg.com/v/88725/browse/9/Plug-in/LightX

     

    Philemo said:

    I can compile it for you on OSX if you send me the source.

    Thank you! How can I send it?

  • PhilWPhilW Posts: 5,145

    I am seeing an odd effect when using these lights together with Indirect Light (for an interior scene).  See the screen grab below - on the left is using normal bulbs plus Indirect Light, on the right is the same lights just changed to BulbLightX.  The light seems to be bouncing between the legs and getting amplified as it does so so that this ends up glowing as well.

    Any thoughts?

    Screenshot 2017-07-09 21.37.38.png
    1920 x 1080 - 534K
  • AlbertoAlberto Posts: 1,436
    edited July 2017
    PhilW said:

    I am seeing an odd effect when using these lights together with Indirect Light (for an interior scene).  See the screen grab below - on the left is using normal bulbs plus Indirect Light, on the right is the same lights just changed to BulbLightX.  The light seems to be bouncing between the legs and getting amplified as it does so so that this ends up glowing as well.

    Any thoughts?

    Is there any ligth between her feet?

    In the following image, I tried two BulbLighXs 

    And next, I put a BulbLightX between her feet

    In the second image there is a shadow of her arm in the ceiling. In your image (Doc5.bmp), there is a similar shadow too. And her arms appears as illuminated by a light from below.

    V4_2LX.png
    860 x 645 - 127K
    V4_3LX.png
    860 x 645 - 197K
    Post edited by Alberto on
  • PhilWPhilW Posts: 5,145

    No, there was no added light - in your example, just try turning on Indirect Light and you should see the effect. It seems very sensitive, just moving the figure away from zero and the effect disappears - even moving one leg to the side makes the extra light disappear!

  • Philemo_CarraraPhilemo_Carrara Posts: 1,175
    Alberto said:
     
    Philemo said:

    I can compile it for you on OSX if you send me the source.

    Thank you! How can I send it?

    Sent you a PM

  • AlbertoAlberto Posts: 1,436
    PhilW said:

    No, there was no added light - in your example, just try turning on Indirect Light and you should see the effect. It seems very sensitive, just moving the figure away from zero and the effect disappears - even moving one leg to the side makes the extra light disappear!

    In my example Indirect Light is on already. I can't replicate the strange effect in your image. I tried SSS and the behavior is normal too.

    What are the settings? I notice that in both of your images the lower body of V4 has a different tone that her upper body. Do you know why? In your "Doc4.bmp" there are only normal bulb lights, aren't they?

     

  • PhilWPhilW Posts: 5,145

    The different skin tones are due to me correcting the legs and feet but not the rest (just me being lazy!) in the shaders. Don't worry about it, it is maybe something strange about my setup and it is easily rectifiable so I don't think it is worth anyone losing any sleep over!

  • AlbertoAlberto Posts: 1,436
    PhilW said:

    The different skin tones are due to me correcting the legs and feet but not the rest (just me being lazy!) in the shaders. Don't worry about it, it is maybe something strange about my setup and it is easily rectifiable so I don't think it is worth anyone losing any sleep over!

    Well, you created the new Victoria 4 foot lamp !

  • Samuel S.Samuel S. Posts: 322

    Amazing work and thanks for Sharing!!!
    I am really glad and wish you all the Best as Carrara Plug-in developer and keep up the great work. We really need free or paid Carrara plug-ins from talented folks like you!  I was hoping to create more development related vidoes but my love for 3D Modeling hobby took me away therefore I kept focusing on creating videos for Carrara so that more and more people can start using Carrara to encourage DAZ to keep it upto date with latest trends. 

  • MarkIsSleepyMarkIsSleepy Posts: 1,496

    Wow! This is awesome. Thank you so much.

    One slight correction to the OP though: shape lights do have a drop-down that lets you change the light falloff from linear to distance squared. Whether the result is actually what you'd expect or not I couldn't say, but the option is there. I thought Anything Glows had it too, but I haven't looked at it in a long time, so maybe I'm wrong about that one.

  • AlbertoAlberto Posts: 1,436
    I Samuel said:

    Amazing work and thanks for Sharing!!!
    I am really glad and wish you all the Best as Carrara Plug-in developer and keep up the great work. We really need free or paid Carrara plug-ins from talented folks like you!  I was hoping to create more development related vidoes but my love for 3D Modeling hobby took me away therefore I kept focusing on creating videos for Carrara so that more and more people can start using Carrara to encourage DAZ to keep it upto date with latest trends. 

    Thank you for your kind words! 

    Yes, we need more plugins; we can't only wait for the arrival of a possible Carrara 9. In the meantime, much can be done.

    And, thanks again for your work! Tutorial videos for Carrara are very important product too.

  • AlbertoAlberto Posts: 1,436
    MDO2010 said:

    Wow! This is awesome. Thank you so much.

    One slight correction to the OP though: shape lights do have a drop-down that lets you change the light falloff from linear to distance squared. Whether the result is actually what you'd expect or not I couldn't say, but the option is there. I thought Anything Glows had it too, but I haven't looked at it in a long time, so maybe I'm wrong about that one.

    Thank you for your words, MDO2010 !

    Yes, you're right about the drop-down menu in shape lights and in anything glows too. But the behavior of those "distance square falloff" is identical to the linear falloff they offer. I didn't notice this anomaly until I watched the Phil's course videos. He showed clearly the failure. 

     

  • JonstarkJonstark Posts: 2,738

    This is an awesome, awesome idea!  This will revolutionize the way I render in Carrara (and may ensure that my Octane and Luxus plugins start collecting dust for going unused lol)   I haven't even downloaded the sharecg file yet, but I wanted to say a tremendous thank you (and I actually feel a little bad as I certainly would have been happy to pay for this feature).  Who needs DAZ development with awesome plugin creators more than making up for it?  This has to be one of the best plugin ideas ever!

  • AlbertoAlberto Posts: 1,436
    Jonstark said:

    This is an awesome, awesome idea!  This will revolutionize the way I render in Carrara (and may ensure that my Octane and Luxus plugins start collecting dust for going unused lol)   I haven't even downloaded the sharecg file yet, but I wanted to say a tremendous thank you (and I actually feel a little bad as I certainly would have been happy to pay for this feature).  Who needs DAZ development with awesome plugin creators more than making up for it?  This has to be one of the best plugin ideas ever!

    You're welcome!  I hope this plugin will be useful to you.  

  • HeadwaxHeadwax Posts: 9,987
    I Samuel said:

    Amazing work and thanks for Sharing!!!
    I am really glad and wish you all the Best as Carrara Plug-in developer and keep up the great work. We really need free or paid Carrara plug-ins from talented folks like you!  I was hoping to create more development related vidoes but my love for 3D Modeling hobby took me away therefore I kept focusing on creating videos for Carrara so that more and more people can start using Carrara to encourage DAZ to keep it upto date with latest trends. 

    times two!

     

  • StezzaStezza Posts: 8,050

    +1

    just downloaded .. will give it a try out thanks yes

  • AlbertoAlberto Posts: 1,436

    Head wax and Stezza, you're welcome!

Sign In or Register to comment.