Hi everyone!
I have a scene that uses HDR Lightmaps exported from Blender, which I add to the materials of an imported GLB scene with the RGBE loader.
This is what the lightmaps look like when I open them in Photoshop:
and this is what it ends up looking like in my Three scene:
As you can see the result is completely off, but I have no idea why.
Here’s my (condensed) code:
const loader = new RGBELoader();
for (let child of gltf.scene.children) {
loader.load(
lightBakeTestTex,
function ( texture ) {
texture.flipY = false;
if (child.material){
let newMat = child.material.clone();
child.material = newMat;
child.material.envMapIntensity = 0;
child.material.lightMap = texture;
child.material.lightMapIntensity = 1;
child.material.needsUpdate = true;
}
});
}
Setting the renderer’s tonemapping options doesn’t do much either… The only thing that’s made any real difference is setting the renderer’s exposure to something like 4, but that totally washes out the non-lightmapped objects I have in the scene. When I up the environment map intensity the scene brightens up, but the lightmaps become almost invisible. I tested the scene with PNGs as lightmaps instead and the range is correct, but the quality isn’t very good for obvious reasons.
Surely there must be an intended workflow or fix for this scenario? What am I missing?
Thank you so much in advance!