EXR issue

Discussion related to the LuxCore functionality, implementations and API.
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: EXR issue

Post 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.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: EXR issue

Post 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).
Support LuxCoreRender project with salts and bounties
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: EXR issue

Post 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.
Last edited by TAO on Mon Jun 28, 2021 2:52 pm, edited 1 time in total.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: EXR issue

Post 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).
Support LuxCoreRender project with salts and bounties
Post Reply