-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation for Area Lights #16078
Initial implementation for Area Lights #16078
Conversation
…into sergio/area-light
…of Specular power
WebGL2 visualization test reporter: |
Visualization tests for WebGPU (Experimental) |
…/Babylon.js into sergio/area-light
@SergioRZMasson I think the latest question is about testing all the other materials using BindLights/PrepareDefinesForLight as most of them are currently working like standard material and supporting them all I guess. |
Added a #defien AREALIGHT_ROUGHNESS to use 1.0 instead of vReflectionInfos.y for shaders that don't have that uniform data available. This makes all materials in the list completely ignore the Area Lights, but we have no shader crashes and they work normally with other lights. The only materials that will be affected by Area Lights are Standard and PBR. |
Next PRS will be: |
Overview
This PR provides a first implementation for rectangular area lights. The implementation is based on reference repo https://github.com/selfshadow/ltc_code/ and uses the Linearly Transformed Cosines technique described by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt`s paper in 2016 . This PR only supports single color rectangular area lights with texture support been introduced in a latter PR. This PR also does not support shadows for the RectAreaLight.
API
Besides the usual diffuse and specular colors the area light is defined by a position, a width and a height. Setting a rotation is possible by assigning a transform node as a parent for the light.
By default shaders will use LTC data stored in the Babylon.js CDN. However, users can assign their own
IAreaLightLTCProvider
toscene.areaLightLTCProvider
and use their own LTC textures.