Home

Awesome

LightmapperToy

This project is a hobby lightmapper completely based on Houdini geometry nodes. Basically it grew out of a re-implementation of <a href="https://github.com/TheRealMJP/BakingLab" target="_blank">Matt's The Baking Lab</a> with some modification. It's my first personal Houdini project (still learning), so there is no magic (no GPU acceleration, no progressive, just brute force) :)

How To Use It

There are only four nodes inside the obj tab:

<img src="images/scene_nodes.png" width="400"/>

Lock the viewport with the CAM_MAIN node. Change the environment map inside the ENV_LIGHT node (all HDRI textures are from <a href="https://hdrihaven.com/hdris/" target="_blank">HDRI Haven</a>).

The SCENE_ROOM node is responsible for setting up the scene geometries (click the "Room Object" menu to change different scenes, toggle the "Enable Light" to enable or hide the area light on the top):

<img src="images/scene_room_node.png" width="800"/>

The RENDERER node is responsible for all the calculating. Change the "Shading Method" menu to switch between path tracer and lightmapper. More detail settings are under "Ground Truth" and "Lightmap Baker" tabs:

<img src="images/renderer_node.png" width="800"/>

Results

We compare the lighting results of all the methods. As usual, ground truth goes first.

Path Tracer

CornellToyShaderballPath Tracer
<img src="images/ground_truth_cornell.png" width="200"/><img src="images/ground_truth_toy.png" width="200"/><img src="images/ground_truth_shaderball.png" width="200"/>Diffuse & Specular
<img src="images/ground_truth_cornell_diffuse.png" width="200"/><img src="images/ground_truth_toy_diffuse.png" width="200"/><img src="images/ground_truth_shaderball_diffuse.png" width="200"/>Diffuse Only
<img src="images/ground_truth_cornell_specular.png" width="200"/><img src="images/ground_truth_toy_specular.png" width="200"/><img src="images/ground_truth_shaderball_specular.png" width="200"/>Specular Only

Diffuse Baker

"Diffuse" uses a single RGB value containing the result of applying a standard diffuse BRDF to the incoming lighting, with an albedo of 1.0 (3 floats per point).

CornellToyShaderballDiffuse
<img src="images/baker_diffuse_cornell.png" width="200"/><img src="images/baker_diffuse_toy.png" width="200"/><img src="images/baker_diffuse_shaderball.png" width="200"/>Diffuse & Specular
------Diffuse Only
No SpecularNo SpecularNo SpecularSpecular Only

Directional Baker

"Directional" bakes irradiance based on Enlighten's directional approach, with 3 floats for color, 3 for lighting main direction information, and 1 float to ensure that the directional term evaluates to 1 when the surface normal aligns with normal used when baking (7 floats per point)

CornellToyShaderballDirectional
<img src="images/baker_directional_cornell.png" width="200"/><img src="images/baker_directional_toy.png" width="200"/><img src="images/baker_directional_shaderball.png" width="200"/>Diffuse & Specular
<img src="images/baker_directional_cornell_diffuse.png" width="200"/><img src="images/baker_directional_toy_diffuse.png" width="200"/><img src="images/baker_directional_shaderball_diffuse.png" width="200"/>Diffuse Only
<img src="images/baker_directional_cornell_specular.png" width="200"/><img src="images/baker_directional_toy_specular.png" width="200"/><img src="images/baker_directional_shaderball_specular.png" width="200"/>Specular Only

Half-Life 2 Baker

"Half-Life 2" bakes irradiance projected onto the Half-Life 2 basis, making for a total of 3 sets of RGB coefficients (9 floats per point).

CornellToyShaderballHalf-Life 2
<img src="images/baker_hl2_cornell.png" width="200"/><img src="images/baker_hl2_toy.png" width="200"/><img src="images/baker_hl2_shaderball.png" width="200"/>Diffuse & Specular
------Diffuse Only
No SpecularNo SpecularNo SpecularSpecular Only

SH L1/L2 Baker

"SH" bakes irradiance projected onto L1 SH (12 floats per point) or L2 SH basis (27 floats per point). SH spports 3 diffuse modes and 5 specular modes to shading. There are many possible combinations of diffuse and specular modes (3 x 5), so we just use the default modes (convolution for both diffuse and specular) for the first row. Here we only show SH L2 results.

CornellToyShaderballSH L2
<img src="images/baker_shl2_cornell.png" width="200"/><img src="images/baker_shl2_toy.png" width="200"/><img src="images/baker_shl2_shaderball.png" width="200"/>Diffuse & Specular
<img src="images/baker_shl2_cornell_diffuse_convolution.png" width="200"/><img src="images/baker_shl2_toy_diffuse_convolution.png" width="200"/><img src="images/baker_shl2_shaderball_diffuse_convolution.png" width="200"/>Diffuse (Convolution)
<img src="images/baker_shl2_cornell_diffuse_geomerics.png" width="200"/><img src="images/baker_shl2_toy_diffuse_geomerics.png" width="200"/><img src="images/baker_shl2_shaderball_diffuse_geomerics.png" width="200"/>Diffuse (Geomerics)
<img src="images/baker_shl2_cornell_diffuse_ahd.png" width="200"/><img src="images/baker_shl2_toy_diffuse_ahd.png" width="200"/><img src="images/baker_shl2_shaderball_diffuse_ahd.png" width="200"/>Diffuse (AHD)
<img src="images/baker_shl2_cornell_specular_convolution.png" width="200"/><img src="images/baker_shl2_toy_specular_convolution.png" width="200"/><img src="images/baker_shl2_shaderball_specular_convolution.png" width="200"/>Specular (Convolution)
<img src="images/baker_shl2_cornell_specular_dominant.png" width="200"/><img src="images/baker_shl2_toy_specular_dominant.png" width="200"/><img src="images/baker_shl2_shaderball_specular_dominant.png" width="200"/>Specular (Dominant)
<img src="images/baker_shl2_cornell_specular_punctual.png" width="200"/><img src="images/baker_shl2_toy_specular_punctual.png" width="200"/><img src="images/baker_shl2_shaderball_specular_punctual.png" width="200"/>Specular (Punctual)
<img src="images/baker_shl2_cornell_specular_prefiltered.png" width="200"/><img src="images/baker_shl2_toy_specular_prefiltered.png" width="200"/><img src="images/baker_shl2_shaderball_specular_prefiltered.png" width="200"/>Specular (Prefiltered)
<img src="images/baker_shl2_cornell_specular_ahd.png" width="200"/><img src="images/baker_shl2_toy_specular_ahd.png" width="200"/><img src="images/baker_shl2_shaderball_specular_ahd.png" width="200"/>Specular (AHD)

TODO

References