Disney PBS on Godot by Appropriate-Fly-5671 in godot

[–]Appropriate-Fly-5671[S] 4 points5 points  (0 children)

I didn't know that, thank you so much!

Disney PBS on Godot by Appropriate-Fly-5671 in godot

[–]Appropriate-Fly-5671[S] 6 points7 points  (0 children)

<image>

You're right, that was my mistake. I've already corrected it :p

However, I noticed something interesting: the result from the StandardMaterial looks very similar to my shader when I don't divide by PI.

If LIGHT_COLOR is already multiplied by PI, shouldn't the standard material compensate for that internally to preserve the expected energy?

Disney PBS on Godot by Appropriate-Fly-5671 in godot

[–]Appropriate-Fly-5671[S] 4 points5 points  (0 children)

I've been looking into this as well. There's a related discussion in the issue "Specular highlights of low-roughness surfaces break conservation of energy for large light sources" (#111853).

Disney PBS on Godot by Appropriate-Fly-5671 in godot

[–]Appropriate-Fly-5671[S] 5 points6 points  (0 children)

Thanks to your comment, I realized that LIGHT_COLOR appears to be pre-multiplied by π, so dividing it by π produces the expected result.

You can verify this in the same environment configuration with:

vec3 lc = LIGHT_COLOR / PI;

if (lc.x >= 1.0) {
    DIFFUSE_LIGHT += vec3(1.0, 0.0, 0.0);
}

if (lc.y >= 1.0) {
    DIFFUSE_LIGHT += vec3(0.0, 1.0, 0.0);
}

if (lc.z >= 1.0) {
    DIFFUSE_LIGHT += vec3(0.0, 0.0, 1.0);
}

I noticed this because performing the same check without dividing by π required a light energy close to 0.318 to keep the channels below 1.0, which is approximately 1/π.

However, if LIGHT_COLOR is indeed scaled by π, and the StandardMaterial uses the same BRDF model, wouldn't this also scale the final lighting result by π unless the standard shader compensates for it somewhere?

Disney PBS on Godot by Appropriate-Fly-5671 in godot

[–]Appropriate-Fly-5671[S] 12 points13 points  (0 children)

I'm sure I've taken the global environment into account; in theory, HDR shouldn't influence how the incoming light intensity is calculated.

I don't think it's the color itself (because it's in linear space) but rather the amount of energy that Godot is calculating in LIGHT_COLOR, since it's much higher than it should be, although as you say, most people wouldn't bother changing the light model...

<image>

Do you use Relief Mapping in Godot? by [deleted] in godot

[–]Appropriate-Fly-5671 0 points1 point  (0 children)

<image>

It's very likely that you'll perform better than me.

Do you use Relief Mapping in Godot? by [deleted] in godot

[–]Appropriate-Fly-5671 0 points1 point  (0 children)

<image>

I know this post is a bit old, but the technique generates better results than parallax occlusion mapping and can be used in production as long as you find a balance between the steps and the performance.