Page 1 of 1

Load HDR + Sun environment from sIBL file

PostPosted: Thu Jun 19, 2014 5:05 am
by roeland
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 361 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).

Re: Load HDR + Sun environment from sIBL file

PostPosted: Thu Oct 09, 2014 4:39 am
by roeland
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

Re: Load HDR + Sun environment from sIBL file

PostPosted: Mon Oct 13, 2014 4:02 am
by Tugpsx
Thanks roeland, there are a few more tip in here for getting processes working on other scripts too. :)