-
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
add support for pre-multiplied alpha. #19
Comments
CC #15 - related issue for spec. |
@pjcozzi @RemiArnaud @tparisi we need to specify how shaders are generated. With premultiplied alpha or not ? that's a context info on WebGL. Where should we put this in glTF ? in profile ? a root property to carry all context infos ? any suggestion ? |
Why does glTF need to support the WebGL context-level premultiplied alpha? Why not just support |
Shader are normally written/thought with or without premultiplied , this goes not only for texture but for computed colors in shaders too. We must support both and tell developers how the context should be set to be able to render correctly provided shaders. |
This really feels outside the scope of glTF. This is an asset format, not a scene format. I don't know how we expect assets to dictate how the context should be created. That implies that I'm able to create/recreate the context when I encounter the asset. ha. Not likely for real apps. |
The following comments only applies when developers want to use shaders generated by the converter. (or any other tool...). Here is how I see things:
Overall, I understand what your concern is @pjcozzi but if we provide shaders, pre-multiplied alpha is an implementation details that is one aspect driving how shaders are generated. And shaders are implementation... so we shouldn't be surprised that kind of details surface eventually. Before going further about the way to implement this, I'd like we agree on the principle. Also I mentioned, again a converter option, let's have a configuration file to manage options better #166 |
Ah, I see. This is really just asset-level metadata on how the shader was generated. OK with me. (Also good info on this topic here). Do you have JSON examples for your proposals? If this were a root-level property, what potential future properties would it include? |
Well, I have an urgent need for this, so I'll add a converter option and and extra in
Toggling premultipliedAlpha will impact the generated shaders and states (blend func). |
Also, after this change the default in the converter will change. |
just pushed the change (merged from mini branch |
@fabrobinet do you have any ideas for what the final JSON should look like? Perhaps it is as simple as "asset": {
"generator": "collada2gltf@042d7d2a3782aaf6d86961d052fc53bea8b3e424",
"premultipliedAlpha" : true
}, Or do you see |
@pjcozzi Yes, that's what I had in mind, but I have put an extras before we reached agreement. |
I'm working on the schema now (in the new schema branch). Can we move "asset": {
"generator": "collada2gltf@042d7d2a3782aaf6d86961d052fc53bea8b3e424",
"premultipliedAlpha" : true
}, |
Fixed in dev-6. |
@fabrobinet OK to close? |
yes |
…-anim-notes-and-extension-samples Added clarification regarding material animation - thx a lot.
No description provided.
The text was updated successfully, but these errors were encountered: