-
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
Additive blending #1189
Comments
I could imagine two ways of declaring this:
If we think that other blending equations may be needed, the second seems a bit more future-proof. Is this appropriate for a 2.X release, or best included via an extension? This can be implemented widely enough that, IMO, 2.X would be appropriate. /cc @AurL you have some use cases for this too, yes? |
+1 for better control over blending modes. Worth remembering that glTF 1.0 had the full set of WebGL blending options, with enums for |
Does additive blending make sense with PBR? |
I would say that having additive-blended effects in the same scene as PBR can be useful. Glowing sparks with additive blending can make a scene more exciting. |
Makes sense for particle effects, non PBR-materials (like unlit), KHR_technique_webgl, and possibly other extensions. Should we put this in the core spec if the core spec itself does not need it? |
It may be worth having its own extension, separate from the Would be good to get more feedback on how popular such an extension might be, and how it might be used. |
It would mainly be for particle effects. For example, Tilt Brush sketches on Google Poly: https://poly.google.com/view/74IwAq0ig8u The snow there is all additive. Without additive, you'd have two options:
With additive, you get good performance, no sorting artifacts, and live with less accurate blending (snow flakes over the white snow on the ground disappear). Does this make sense for PBR? It's certainly possible to light using PBR and still do additive blend, so it's not in conflict. But if by "make sense" you mean "correct and physically based", then it's definitely not. But ya know, when it comes to rendering transparency in real time, from my experience you typically choose the option that's least bad for your particular case. So offering additive, which is simple to implement (can't imagine any issues with Vulkan or D3D or anything), seems like a good idea to me. |
+1 for separating this from |
Previous discussion on this matter: #1033. |
Picking up from the last comments by @bghgary and @lexaknyazev —
Is it possible to define clear parameterized models for "effects" as we do for PBR? This seems well into application-specific territory, whereas additive blending is a basic graphics feature that can be used in many contexts... I'd expect apps like Tilt Brush to have their own effects rather than using a pre-defined IMO it feels safer to just support additive blending and other required features, and let users create application-specific effects using KHR_technique_webgl etc. |
Going to try to get this rolling in parallel with, but separate from, Feedback welcome on draft |
Let's merge this thread into #1302 – feedback welcome. I think there's some question still of how broad a set of blend states should be handled. |
Additive blending is commonly used for particle effects, and it's easy to implement. How about an alphaMode=ADD?
The text was updated successfully, but these errors were encountered: