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

Support for KHR_lights_punctual extension #3253

Merged
merged 9 commits into from
Jun 24, 2021

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jun 21, 2021

  • Added support for KHR_lights_punctual extension https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
  • Note of the limitation: Implement support for physically based light intensity units #3252 causing light intensities to be clamped to 0..1 range
  • Note that lights are supported only when creating hierarchy with render components using instantiateRenderEntity, but not when using model components using instantiateModelEntity
  • The instance of the model is no longer created when a glb file is loaded, and is created and cached on the fly only when needed
  • render component hierarchy is being created from parsed glb file directly with no dependency on the Model being created (and so if user uses Renders, the Model does not get created at all)
  • moved SkinInstanceCache to separate file to share it between render component and glb creating one.
  • moved GlbParser.CreateModel to ContainerResource.

Fixes #2061

Example on how to create lights from loaded glb container (the same as creating hierarchy with renders):
const lightsEntity = assets.lights.resource.instantiateRenderEntity();

lights can be processed this way:

const lights = lightsEntity.findComponents("light");
lights.forEach((light) => {
    light.enabled = false;
});

Thanks to @godiagonal for initial implementation here: #2385

@mvaligursky mvaligursky self-assigned this Jun 21, 2021
Co-authored-by: Will Eastcott <will@playcanvas.com>
mvaligursky and others added 2 commits June 21, 2021 08:51
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
…ue to 0..2 range to allow more flexibility using data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for glTF extension KHR_lights_punctual
3 participants