Load HDR + Sun environment from sIBL file

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
roeland
OctaneRender Team
Posts: 1822
Joined: Wed Mar 09, 2011 10:09 pm

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 871 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
Posts: 1822
Joined: Wed Mar 09, 2011 10:09 pm

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 803 times
Tugpsx
Licensed Customer
Posts: 1150
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL
Contact:

Thanks roeland, there are a few more tip in here for getting processes working on other scripts too. :)
Win 11 64GB | NVIDIA RTX3060 12GB
Post Reply

Return to “Lua Scripting”