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

Lights #21

Open
samubiquity6 opened this issue May 23, 2018 · 15 comments
Open

Lights #21

samubiquity6 opened this issue May 23, 2018 · 15 comments

Comments

@samubiquity6
Copy link

Hey guys. Thanks for your hard work! Using your fantastic plug-in for work now, I was wondering if lights could be added. I need to animate flickering lights for a scene and have to do some weird export workarounds to get lights working.

@ziriax
Copy link
Contributor

ziriax commented May 23, 2018

Thanks! We are not yet using the plugin at WonderMedia, so it's nice to see people testing it out already 👍

The GLTF 2.0 spec doesn't have lights unfortunately, and we don't directly need this at WonderMedia, we only use GLTF for exporting meshes.

That being said, a draft extension for lights does exist, KHR_Lights.

@donmccurdy Do you think the KHR_Lights extension will undergo major changes?

@donmccurdy
Copy link

The draft KHR_lights spec is unlikely to change much between now and ratification, excluding the proposed addition of a range property. There are still some missing implementation details like lighting equations, which we plan to clarify.

@ziriax
Copy link
Contributor

ziriax commented May 23, 2018

@donmccurdy Thanks for fast reply!

@samubiquity6 So the extension for supporting lights is rather stable, however looking at the conversation, animated lights are not yet ready in the spec. Also Maya2glTF is using the GLTF library from COLLADA2GLTF, so I must first check if that library supports the KHR Lights extension. Anyway, since my employer doesn't need support for lights in the short term, I will have to code this in my spare time, so don't expect this to be added very soon. I'll put in the backlog.

@samubiquity6
Copy link
Author

Thanks for looking into this! Blender has an experimental export for the KHR_lights which I think will be my work around for now. But not having to move the asset through Blender would be awesome.

@ziriax
Copy link
Contributor

ziriax commented May 23, 2018

So I guess you animate the lights in code then? So you only need static light export?

@samubiquity6
Copy link
Author

Yea we will be animating lights in code. Static would be fantastic =)

@aguaviva
Copy link

+1 for the light support :)

@ziriax
Copy link
Contributor

ziriax commented Jul 29, 2019

PR always welcome :)

@aguaviva
Copy link

aguaviva commented Jul 29, 2019

eheh indeed! I don't have Maya and I am asking for a friend, but if I can help with stuff that is in my area of expertise I'd be glad to do so. (I wrote Cauldron, a VK and DX12 GLTF 2.0 visualizer)

@ziriax
Copy link
Contributor

ziriax commented Jul 30, 2019

Wow Cauldron looks impressive!

The problem with exporting lights is that GLTF 2.0 doesn't define a standard for that yet.

So we would have to pick an extension.

The most obvious one - KHR lights - doesn't seem to support animation, which imho is important to have.

So the first thing to consider is what extensions will need to be supported.

Because writing the code for exporting the lights and animations itself is very easy to do; we already export cameras, so supporting lights is very similar...

@donmccurdy
Copy link

donmccurdy commented Jul 30, 2019

KHR_lights_punctual is the glTF standard for analytical lights, and it's fully ratified at this point.

While it doesn't support animation, that's sort of an independent issue, and would probably be fixed with an advanced animation extension (like KhronosGroup/glTF#1301 (DRAFT)), rather than a brand new lights extension.

@aguaviva
Copy link

Thanks Ziriax! The status of the KHR_lights_punctual extension is complete since November 2018. Blender for example fully supports it and in Cauldron spotlights automatically cast shadows. .

This extension does support animation of the position and the target (for spots), but the color and other attributes are fixed, so yeah it is very similar to a camera.

@ziriax
Copy link
Contributor

ziriax commented Jul 31, 2019

Thanks for all the feedback!

It seems the GLTF module from the COLLADA2GLTF project has no support for this extension yet, so the first thing needed is to add this to our customized fork at https://github.com/Ziriax/COLLADA2GLTF

As soon as that is completed, exporting lights would be a trivial task

@fire
Copy link
Contributor

fire commented Aug 11, 2020

I know how to do this, but I think we should first migrate to the official version of collada2gltf.

@aaronfranke
Copy link

Lights are able to be specified in GLTF files using the KHR_lights_punctual extension. Additionally, with the glTF Object Model and the KHR_animation_pointer extension, it is possible to animate lights too.

For example, an animation can have the target set to this to animate the color of light 0:

"target": {
    "path": "pointer",
    "extensions": {
        "KHR_animation_pointer": {
            "pointer": "/extensions/KHR_lights_punctual/lights/0/color"
        }
    }
}

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

No branches or pull requests

6 participants