Skip to content
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

KHR_lights_area #1948

Closed
wants to merge 4 commits into from
Closed

Conversation

bhouston
Copy link
Contributor

@bhouston bhouston commented Mar 1, 2021

here is a quick proposal for a rect area light (expanded to include sphere and circle per requests below.) This specification does not determine its implementation, just its specification and intended behavior.

Real-time rect area lights are though generally implementing using the 2016 SIGGRAPH LTC method described here: https://eheitzresearch.wordpress.com/415-2/

Three.js area light:

One extra thought: Maybe this should have been build upon the existing KHR_lights_punctual extension and just add another light type to it called "rect"?

@bhouston bhouston changed the title Proposal: Rect Area Light KHR_lights_rectAreaLight Mar 1, 2021
| `width` | The centered width of the light along the X-axis. | :white_check_mark: Yes |
| `height` | The centered height of the light along the Y-axis. | :white_check_mark: Yes |

QUESTION: If an area light is scaled down by parent transforms, does it emit less light because it has less world space area? Currently this would be the behavior given the current definition. This seems intuitively like it makes sense.
Copy link
Member

@lexaknyazev lexaknyazev Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about simplifying the object a bit, specifically:

  • define an area light source as 1x1 square, set intensity relative to 1m2;
  • remove width and height properties;
  • derive real-world size from node transforms?

Copy link
Contributor Author

@bhouston bhouston Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see. My concern here is that this design makes it possible to represent the same light in infinite amount of ways by combining light's own dimensions with node transforms. Such flexibility should be thoroughly evaluated for a portable runtime transmission format.

On the other hand, if we can precisely specify how all these properties interact with each other, it might be better to keep them.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented it using a naming convention and I went for 1x1 + node transform.

@mvaligursky
Copy link

In Playcanvas we decided to go with shape property, which can be specified for current Directional, Spot or Omni lights, and these are the shapes we support:

 * @description Infinitesimally small point light source shape.
export const LIGHTSHAPE_PUNCTUAL = 0;

 * @description Rectangle shape of light source.
export const LIGHTSHAPE_RECT = 1;

 * @description Disk shape of light source.
export const LIGHTSHAPE_DISK = 2;

 * @description Sphere shape of light source.
export const LIGHTSHAPE_SPHERE = 3;

So it'd be great to make this extension more generic than only supporting rect area lights?

example of some types:
http://playcanvas.github.io/#graphics/area-lights.html

@bhouston
Copy link
Contributor Author

bhouston commented Mar 1, 2021

In Playcanvas we decided to go with shape property, which can be specified for current Directional, Spot or Omni lights, and these are the shapes we support:

It increases the complexity a fair bit but disk and sphere are useful light types. Capsule is the other light area type that I know UE4 supports.

@bhouston bhouston changed the title KHR_lights_rectAreaLight KHR_lights_area Mar 3, 2021
@bhouston
Copy link
Contributor Author

bhouston commented Mar 3, 2021

@mvaligursky based on your feedback I have converted this from just a "rect" light extension to one that covers "sphere", "disk" and "rects."

While this generalization makes sense, I do worry that it increases the implementation burden on 3D engines for supporting this extension, and thus may make it harder to get buy-in.

But I think it is important to be responsive to feedback and to go with the decision-making flow of this group.

@kowsheek
Copy link

kowsheek commented Mar 3, 2021

We have a similar custom extension that we use in BRIO for functionalities in ray tracing. This spec would be really good to have a standardized approach.

Only change I'd recommend here is to change the type field to shape.

@bhouston
Copy link
Contributor Author

bhouston commented Mar 3, 2021

@kowsheek thanks for the support -- I've made that change! It is a good one.

@bhouston
Copy link
Contributor Author

bhouston commented Mar 8, 2021

Started a survey here on whether to expand to sphere and disk based on @mvaligursky's suggestion: https://twitter.com/BenHouston3D/status/1368966602205630464

@hypnosnhendricks
Copy link

@siliconvoodoo
Copy link

I don't think a sphere is an area light. It's a sphere light. Or a gaussian sphere light or whatever. Area must be flat. Or you're in for capsule too. I'd limit this to a few basic flat shapes. Polygonal or spheres and capsules and whatnot, could be obtained using a different extension lights_mesh and use a node that points to a mesh so the shape is free.

@fawadtariq
Copy link

Are there any updates on this ? @bhouston @donmccurdy

@bhouston
Copy link
Contributor Author

bhouston commented Sep 1, 2022

I would love to push it forward! I think getting rect area lights in would be incredibly valuable to many different applications.

@KiaArmani
Copy link

Are there any news on this feature? Is there anything that prevents this from being pushed further? I'd love to help!

@brandon-lb
Copy link

Yes this would be really nice to have!

@bhouston
Copy link
Contributor Author

Closing this for lack of interest for now.

@bhouston bhouston closed this Oct 17, 2023
@BruceCherniak
Copy link

What is the community's "2024" thoughts on an area light extension?

With @julienduroure fantastic glTF Blender exporter additions, glTF is a first-class citizen.
Emissive geometries can somewhat fulfill the need for area lights, yet there are many reasons not to rely solely on these in a pathtracer, as well as the orthogonality in handling "materials as lights". True area light definitions would be a real benefit to the glTF spec.

@KiaArmani
Copy link

What is the community's "2024" thoughts on an area light extension?

With @julienduroure fantastic glTF Blender exporter additions, glTF is a first-class citizen. Emissive geometries can somewhat fulfill the need for area lights, yet there are many reasons not to rely solely on these in a pathtracer, as well as the orthogonality in handling "materials as lights". True area light definitions would be a real benefit to the glTF spec.

Would be great to have when exporting from Blender to Unreal (or vice-versa), keeping those lights intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KHR_lights_area: Proposal Area lights or sphere lights
10 participants