-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Get parameter value of material from gltfio #7683
Comments
After looking into this more detailed, and for the specific use case of controlling the opacity I found this discussion: It seems like we'd be able to control the opacity / alpha of an material by calling e.g.
The only issue is that we would also override the rgb values. So a solution would be to get the value of a parameter as well, which seems to be missing right now in gltfio. |
Setting the base color is not enough, the material needs to be marked transparent (it changes the generated shader code). |
When you say "material needs to be marked transparent", you mean that it needs to have a blend mode of It seems like the blending mode can't be changed at runtime, which is understandable. However it would be nice if we could set the blending mode during asset / material instantiation from the public API. But I haven't found a way to make that work (given that I only import a glb file and don't control the material itself) |
I just opened a proposal draft PR for getting the parameters from a Let me know what you think! |
I've seen the PR we need more time to get to it. Please bare with us! thanks! |
Is your feature request related to a problem? Please describe.
(I am kinda new to filament, so not sure if I am missing anything.)
Right now I am rendering from glb files using filament. That means I don't control the materials.
I now want to make changes to the materials. For example a material's blend mode might be "opaque" and it has no transparency, but I want to change it to something else (e.g. to support transparency).
However, I want to make that change "at runtime" when the material instance has already been created.
I feel like with the current API thats not possible? I can only change parameters of a material that are already part of the material.
Describe the solution you'd like
My use case really is to add "transparency support for entities". Meaning I want to control the alpha value of a whole entity (for which I need to control the transparency alpha on the materials if I understand correctly).
Describe alternatives you've considered
If you control the material creation it seems possible, but if you don't it looks like you don't really have any options?
Note: I feel like it has been indirectly mentioned before in this issue: #1865
OS and backend
Not OS or backend specific.
The text was updated successfully, but these errors were encountered: