Specular issue for Rectangular Area Light

Hey community,

@srzerbetto @sebavan @Deltakosh

Been trying the new rectangular area light lately, and I found some potential issue:

The specular of RectAreaLight seems not picking up the correct color values

See test renders:

The test contact sheets are organized as follows:

  • Top row: Displays the new RectAreaLight, showing its beauty pass, followed by its specular-only and diffuse-only passes.
  • Middle row: Shows a comparable area light type from Blender. The expectation is that the RectAreaLight in Babylon.js should exhibit similar behavior to this Blender area light.
  • Bottom row: Features a Babylon.js directional light for reference. (Additionally, an issue was observed with the Directional Light where its specular pass is unexpectedly empty; this will be addressed separately. Specular pass issue for Directional Light)

The specular pass color issue occurs regardless of whether the material is metallic or non-metallic.


Here is my PG:

Also my blender file:
(Using Blender v4.4.3)
babylon_areaLight_issue2.blend.zip (3.5 MB)


Could anyone please look into this?
Many thanks!!
Tawibox

4 Likes

Thanks for your findings @tawibox ! I will investigate this during the day.

2 Likes

@srzerbetto Of course! Really appreciate it!!

1 Like

Once again thanks for the finding @tawibox . I have a PR open with a solution, hopefully it will make area lights work the same way as other lights:

Fixed area light specular calculation by SergioRZMasson · Pull Request #16723 · BabylonJS/Babylon.js

5 Likes

@srzerbetto
Of course!! I really appreciate you solving this so quickly. This is fantastic news, thank you! :grinning_face_with_smiling_eyes: