Load HDR + Sun environment from sIBL file

Forums: Load HDR + Sun environment from sIBL file
Forum for OctaneRender Lua scripting examples, discussion and support.

Load HDR + Sun environment from sIBL file

Postby roeland » Thu Jun 19, 2014 5:05 am

roeland Thu Jun 19, 2014 5:05 am
Hi,

Octane doesn't support loading sIBL environments directly, but via a script you can set up a common use case: setting up a HDR environment and sun light.

This script will set up the sun position and environment texture, but it has limitations:
  • Only files containing a Sun Light are loaded.
  • Only environments using lon-lat mapping are loaded, since the other types can't be rendered correctly in Octane.
  • The sun power in Octane can't be set easily to a given number, as required to load sIBL files. This means you have to tweak the power of the environment texture after loading to balance the sun and environment powers.
  • There is currently no easy way to rotate such an environment. The script will set up the environment taking the north offset into account.

Download here:
load sun + sky from sIBL.lua
(4.46 KiB) Downloaded 745 times

To use, select the render target to render or the environment node. The environment must be set to a daylight environment (replacing a node is at the moment not exposed in the Lua API).
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Re: Load HDR + Sun environment from sIBL file

Postby roeland » Thu Oct 09, 2014 4:39 am

roeland Thu Oct 09, 2014 4:39 am
With the scripted graph introduced with Octane 2.10, we can convert this script to one of these scripted graphs.

This allows some improvements over the previous version:

  • The interface you get after loading / running the script is a bit better: the controls for loading a new file are in the node inspector as expected, and with a bit of extra scripting we can provide independent inputs for the sun and environment power;
  • there is now an easy way of rotating the environment: the script has a matrix input. If you change this input the lua script inside will automatically update the texture transform and sun position. (the translations are not handled properly, but usually you only need rotation).

The downside is we have two buttons to load a file: one for the script, one for the sIBL file. And there is no real way to implement a reload button. But due to how the scripted graphs work, you can reload the script to reload the environment.

--
Roeland
Attachments
sIBL.lua
(8.36 KiB) Downloaded 690 times
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Re: Load HDR + Sun environment from sIBL file

Postby Tugpsx » Mon Oct 13, 2014 4:02 am

Tugpsx Mon Oct 13, 2014 4:02 am
Thanks roeland, there are a few more tip in here for getting processes working on other scripts too. :)
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 18 guests

Thu Mar 28, 2024 12:15 pm [ UTC ]