-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Light Semantics #93
Comments
We have the 4 kind of lights that COLLADA provides. In the context of glTF these are are level objects that are mostly useful for the ones not relying the provided shaders. Someone using provided shaders could just get all the parameters and have the lighting working. Here is an example of lights (one of each kind):
Note: we'll add projection to omni, spot and directional. It is useful for the ones doing shadows. Just like meshes, lights are referred within the node hierarchy: This is a node:
Lights in first iteration are all considered global - as in COLLADA. Here is for instance how looks the technique for the light in the famous COLLADA duck:
It's important to note that lights need to have a mechanism in place to refer not only the node being rendered, for instance for a directional light we need to get the transform of the node that hold the light. To solve this I added a
This needs refinement as this is assuming WORLDMATRIX (or MODELMATRIX whatever we will call it eventually). Another thing to consider will be to support senantic that are not necessarily matrices, for some lights types it could be convenient to have just positions. |
The basic proposal is fine for SIGGRAPH. We'll get basic lights working Regarding the light matrices, positions, etc. couldn't we simply add a On Mon, Jul 15, 2013 at 1:38 PM, Fabrice Robinet
Tony Parisi tparisi@gmail.com Read my book! WebGL, Up and Running |
Yes @tparisi I think so. |
To finish this, we need the semantic and thus blocked by: #83 |
I am lost in the details and how it relates to issue #83 . I think a face to face with Fabrice and he and I could settle the remaining details. @fabrobinet late next week? |
It relates to #83 because we just discussed about the semantic property of the source parameter:
|
Shouldn't the "EnvironmentAmbientLight": {
"ambient": {
"color": [
1,
1,
1
]
},
"id": "EnvironmentAmbientLight",
"type": "ambient"
}, |
I do not repro this issue with dev-5 (in flux) and probably not with dev-4. Yes it should be just that way.:
|
@fabrobinet with or without |
name is not mandatory, but it could be there yes. |
Agreed. Thanks. |
flagged for coming-next to add semantic. |
Actually, lights in the context of glTF could be just represented as parameters for shaders, and we can provide a descriptive object within the details property for the ones willing to regenerate shaders. |
Agreed 👍 |
I have added |
I'm not following... are we saying we would get rid of the light-specific parameters? I don't want to lose that info, it's useful for higher-level engines like Three.js where we can optionally use common techniques like Phong. |
We will keep all the parameters within techniques, but will remove lights objects in the node hierarchy because they are not really useful here as have to declared anyway also in the techniques to set the parameters and uniforms. |
If they're not in the node hierarchy, how can they be transformed and animated? |
Oops, sorry I didn't meant that :) The intention here is actually to remove the |
Ah ok, well that makes me feel better. However I don't quite understand what the resulting file would look like. Do you have a quick example? I don't need to see all the technique info, just where the light would be defined in the file, and how it would be referenced as a node. So, pseudo-glTF would suffice... |
Based the proposed changes in #361 we extend here the discussion to lights.
As an example for 2 with the converter available on this repo, then we'd have an extension defined within "allExtensions" : ["COLLADA-1.4.1/commonProfile"],
"extensions": {
"COLLADA-1.4.1/commonProfile": {
"extras": {
"doubleSided": false
},
"lightingModel": "Blinn",
"parameters": {
"ambient" : "ambient",
"diffuse" : "diffuse",
"emission" : "emission",
"reflective" : "reflective",
"shininess" : "shininess",
"specular" : "specular",
"transparency" : "opacity",
"lights" : {
"light1" : {
"color" : "light1Color",
"constantAttenuation": "light1ConstantAttenuation",
"linearAttenuation": "light1LinearAttenuation",
"quadraticAttenuation" : "light1QuadraticAttenuation"
}
}
}
},
"texcoordBindings": {
"ambient": "TEXCOORD_0",
"diffuse": "TEXCOORD_0",
"reflective": "TEXCOORD_0"
}
},
|
@tparisi @pjcozzi @RemiArnaud what do you think ? |
All sounds good to me. I am happy to update the schema when we determine the exact details for this extension. |
I�m not sure what the question is. If this is an extension to the �pass� object, then I would call this �extra� and then underneath have �profile� sections for each extensions Regards |
I'm sorry I object to this whole change. I personally thought the lights stuff was fine the way it is and now this is getting more COLLADA-like as the design evolves. Why do we need extensions to handle something as basic as lights? In practice, a runtime wants to know about the lights, cameras and animations in a scene. Having them in a list at the top level is extremely helpful. For implementations that don't need that, they can just ignore the property. What I have liked about glTF so far is that we have kept the design practical. Design choices like this move away from practical. |
This is actually quite the opposite - LightingModel specification in
If you use the provided shaders (as Cesium) developers can write based on glTF a completely data-driven engine and do not need to know about high level concepts such as lights to actually perform a rendering that contains lighting. For the ones who want to re-create shaders (as you do), I find it risky to commit on specifying in lights - as depending on tools... lighting models may vary and we could be very soon limited with only the traditional 4 types of lights (ambient, omni, directional, spot). One could write a glTF exporter right in a tool (3DSMAX...) and export other types of lights that we aren't aware of, and the place to describe such light should be in a specific extension.
I got your point but addressing this could be easy.
Again I get your argument, but it's the exact same debate as if you were going to OpenGL WG and were asking to put back the fixed pipeline because it was practical... |
@fabrobinet @pjcozzi Guys I am coming around to this way of thinking. HOWEVER can we consider changing the naming from "extensions"? This doesn't feel like an extension to me-- extensions are for significant added capability-- and I think the naming will confuse people. It sounds a lot more like a technique or profile or something. In fact, "profiles" seems like a pretty good name for this one. Let's leave "extensions" for true extensions. What do you think? Secondary naming thing: I think we should not have COLLADA in this name but rather call it something like "Materials-FixedFunction" because this is a generally useful set of information whether or not it is implemented in COLLADA. For my applications I don't care about COLLADA, I just want to make sure I can get the fixed function material and lighting information for simple applications such as viewers or previewing tools. |
@tparisi profile is already taken by asset/profile (https://github.com/KhronosGroup/glTF/blob/master/specification/asset.schema.json) but I get your concern about Then yes, we can revise how we will actually name the extension. We can discuss that in #362 |
It's a plan. FWIW I think "profiles" is still OK, it's in a different context. "extras?" I will meditate on it, maybe I can think of something? |
All sounds good to me. |
We can close this when we finish materials in #84. |
Closing, moved to common materials extension. Duplicate of #424 |
We need to have a general semantic scheme for lighting, similar to how we deal with matrices and other parameters that get passed to the shader.
The text was updated successfully, but these errors were encountered: