Page 2 of 2

Re: EXR issue

Posted: Sat Jun 26, 2021 3:36 pm
by TAO
Dade wrote: Sat Jun 26, 2021 3:03 pm
TAO wrote: Fri Jun 25, 2021 11:33 pm Note: 3dsmax code not converting the exr in any way and just pass the path of exr in luxcore directly, no change at all.
What gamma value are using to define the infinite light source in LuxCore API ?

LuxCore have to reverse gamma correct any image for the rendering.
This is the code of creating environment infinite light.

Code: Select all

	renderOptions::lightStatics Options;
	luxrays::Properties props;
	std::string objString;

	std::string texture = luxMaps->getTexturePath(envMap);
	if (texture == "")
		return false;

	objString.append(Options.sceneLight + "infinit_world.type = infinite\n"); // creating infinite light type for envirenment
	objString.append(Options.sceneLight + "infinit_world.file = \"" + texture + "\"\n"); 
	objString.append(Options.sceneLight + "infinit_world.transformation = -7.54979013e-08 1 0 0 -1 -7.54979013e-08 0 0 0 0 1 0 0 0 0 1\n"); // fix 3dsmax map offset
	objString.append(Options.sceneLight + "infinit_world.storage = auto\n");

	props.SetFromString(objString);
	scene.Parse(props);
	return true;
As you can see i tried to pass the Map directly in luxCore with no adding gamma so it should be 1 as the default value but i can see somehow 3dsmax change the Gamma parameters as it is in the Gamma panel.
Screenshot 2021-06-26 172814.jpeg
i notice if disable the gamma in the Gamma correction panel the problem will fix. Gamma value enables by default in 3dsmax.

maybe

Code: Select all

infinit_world.gamma = 1.0\n
can help to avoide changing gamma by default or at least reverse it.

Re: EXR issue

Posted: Sat Jun 26, 2021 11:03 pm
by Dade
TAO wrote: Sat Jun 26, 2021 3:36 pm As you can see i tried to pass the Map directly in luxCore with no adding gamma so it should be 1 as the default value
Nope, the default LuxCore image map gamma value is 2.2 (more details here: viewtopic.php?f=5&t=3446) and your HDR image will be reversed gamma corrected to 1.0.

I think you are confusing gamma values of inputs (infinite light source HDR image) and outputs (the screenshot of 3DsMax gamma setting).

The inputs are reverse gamma corrected to be transformed in rendering color space.

The outputs are gamma corrected to be transformed in display color space (if you are using old gamma correction plugin or the full new OpenColorIO color space support).

Re: EXR issue

Posted: Mon Jun 28, 2021 1:21 pm
by TAO
Dade wrote: Sat Jun 26, 2021 11:03 pm
TAO wrote: Sat Jun 26, 2021 3:36 pm As you can see i tried to pass the Map directly in luxCore with no adding gamma so it should be 1 as the default value
Nope, the default LuxCore image map gamma value is 2.2 (more details here: viewtopic.php?f=5&t=3446) and your HDR image will be reversed gamma corrected to 1.0.

I think you are confusing gamma values of inputs (infinite light source HDR image) and outputs (the screenshot of 3DsMax gamma setting).

The inputs are reverse gamma corrected to be transformed in rendering color space.

The outputs are gamma corrected to be transformed in display color space (if you are using old gamma correction plugin or the full new OpenColorIO color space support).
Thanks for the heads up.
Base on the point you mention, I forced input gamma to 1.0 and the output gamma to 2.2 and it works now. the main problem was the input Gamma that somehow changes from the default value.

Note: 3dsmax still adds another gamma value to output and should be manually off but no crash or instability anymore.

Re: EXR issue

Posted: Mon Jun 28, 2021 1:57 pm
by Dade
Note: the original HDR image may have negative values and they were transformed into NaN by reverse gamma correction (done when declared gamma is not 1.0).