Collada plugin for After Effects

More info here
Plugins and Scripts > trueSpace > Rendering

HDRI to Lights for trueSpace 7.61

hdri icon

This script will read an HDR image and convert it to a collection of spot lights and a preview sphere. Works with panorama(latitude/longitude) type images. This was adapted from the original python script for Houdini created by Steve Twist and found in the 3D World issue number 134. His script in turn is based off of the work of Paul Debevec and his 2005 Siggraph presentation of his Median Cut technique for getting lighting information from an image.

persistent base install required

MS Edge requires several steps to download Hugin: after download: click 3 dots and select "Keep", click Show More and Keep Anyway
Other browsers just download it

trueSpace BUG Unofficial Updates BUG: If an inside out mesh is created in a scene and is large enough to encompass the scene when you use some primitive tools their behavior can be erratic.

TODO: change the warning message, bug sb fixed in the UU soon, if not already. UU4Clinton 2.0 already removes the UU restrictions on the background spheres.

Primitive creation can become erratic when a background sphere is in the scene. Increase the "No Snap Radius" to a large value to prevent the automatic snapping behavior when creating primitives, cameras and lights.
In original tS the primitive no snap is labeled as "Drag/Snap" and the camera and light panels have it labeled as "Nosnap rad"

The other way to prevent the bad behavior is to make the bg sphere invisible.

Original tS has a bug where the camera will read the no snap radius from the lights panel instead of the camera panel. So use the light panel to control the camera no snap radius.

LMB to open the panel, RMB to open a preexisting HDRILightsGroups panel

hdri panel

Creation Controls:

  • FileName - open a dialog to choose the image file
    • X Size, YSize - show image dimensions
    • Format - HDRI is usually "A32FB32FG32FR32F" and LDR would show as "A8R8G8B8"
  • Probe - check after loading a probe style image to convert it to a lat long format.
  • Reduce - shrink the image down to a size that can be handled by trueSpace. It will always reduce down to a width below 800 pixels wide. When the reduce factor is too low a yellow indicator will show that the image was force reduced below the maximum allowed. Indicator turns red for the case of too much reduction
  • Divisions - controls the number of lights created from the image
    • 3 => 8 lights
    • 4 => 16 lights
    • 5 => 32 lights
    • 6 => 64 lights
    • 7 => 128 lights
  • Radius - initial radius of the image sphere and light rig
  • Intensity Multiplier - initial intensity value
  • Background Image Only, No Lights - create only the image sphere
  • Create Lights - generate lights and preview sphere, an HDRILightsGroup will be created in the scene.
  • Clear Input Image - clear an aborted run so the image is not permanently included in the tS context saves
  • .

hdri lights group panel

HDRILightsGroup:

  • Gamma - control the preview image brightness and contrast.
  • Radius - size of the image sphere and light rig.
  • Light Distance - light distance factor used to move the lights in and out relative to the Radius value.
  • Rotation - yaw value for the light rig
  • Cone angle - set the cone angle of the spotlights used in the rig.
  • Intensity - light brightness
  • Saturation - light saturation color
  • Shadow - lights can cast shadows
  • Depth Bias - shadow offset from geometry
  • Filtering Quality - At all settings except the maximum, it adjusts the quality of the filtering done on the shadows. When set to maximum(5), Poisson disk shadow filtering is used and the two parameters Filter Size and Samples become active.
  • Filter Size - Larger values will give a softer and broader edge to the shadow. Shows green when active.
  • Samples Cnt - Samples Count is the number of samples used to generate the soft shadows. Shows green when active.
  • Map Size - size of the shadow map texture
  • Threshold - disable shadows for dimmer lights. The graph shows the relative intensity of each light as the length of the horizontal line. Any line too short to reach the slider position will not cast shadows. You can also click inside the graph to set the threshold value.
  • Set Shadows - turn shadows off and on for the lights based on the shadow checkbox and threshold value
  • Show BG make the background preview sphere visible
  • Hide BG make the background preview sphere invisible
  • Show Lights make the lights visible
  • Hide Lights make the lights invisible
  • Remove will quickly remove the HDRILightsGroup from the scene bypassing the undo system

Usage:

  1. FileName to select an image
  2. Check Probe if it is a probe image and the Hugin program will convert it to a latitude longitude/panoramic format
  3. Set the image reduction and number of desired lights.
  4. Check background Image Only if you don't want any lights created
  5. Press Create Lights to create the light rig and preview sphere
  6. --- after creation ---
  7. Set desired Gamma, Radius and Rotation values
  8. Reduce the Cone Angle to the smallest value that will cover the scene
  9. Adjust the intensity and saturation
  10. If there are too many shadows adjust the threshold value and press Set Shadows
  11. Press "Hide BG" before adding any workspace primitives to the scene
  12. Remove the HDRILightsGroup from the scene before rendering with Lightworks or VRay using their built in environment lighting.

Notes:

  • Use the smallest Cone angle and Light Distance for the best shadow quality
  • Smaller depth bias is better until the meshes start to self shadow too much
  • The conversion only works with panoramic images with a size ratio of 2 to 1
  • Probe images can be converted via Hugin
  • Hugin creates 2 temp files, pto and exr image and will ask if you want to delete them.
  • Code has hooks into the YafaRay4tS renderer to create background previews
  • To preview for VRay use a rotation value of 180 and maybe set the gamma to 1
  • YafaRay is auto rotated 180 degrees behind the scenes
  • Lightworks no corrective rotation needed
  • Large images can take a long time to load
  • An 8k image takes a long time to load and 16k image will crash tS
  • HW settings may have an effect on the stability of tS - keep at full max values maybe best.

Some links

Sample HDR image by Steve Twist - includes an hdr format image for tS compatibility

The 3DBuzz HDRI Shader Development for Mantra - class presented by Steve Twist.

hdri_starter_collection(web archive) - link from the trueSpace Manual

https://vgl.ict.usc.edu/Research/MedianCut/ - original paper link

https://www.pauldebevec.com/Probes/ - some probe images

March 10 2024

  • panel opens in floating window
  • checks for yafaray background nodes, if found asks to continue
  • fast remove button

February 25, 2024

  • small change for improved yafaray4ts use

February 24, 2024

  • add filtering quality, filter size and sample count
  • separate light distance control
  • show/hide lights
  • fixed bugs probe and shadows and clear image from dialog
  • updates and fixes for yafaray bg
  • shadow map size control
February 17, 2024
February 17, 2024