-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
BlendModes: Added blend*
prefix
#29897
base: dev
Are you sure you want to change the base?
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Would it be better to rename |
Sorry for my lack of knowlegdes but you mean there is a way to blend the geometries normals without blending the color (output) ? Do you have a usecase in mind you can share to me to understand why peoples will do it ? |
A common case is mixing two normal maps. |
Yes, rename it. The question remains as to what the name should be... The formula looks similar to the Porter Duff over operator, but not exactly. @Mugen87 Is it an SSR hack of some sort, and therefore specific to that particular algorithm? // Be aware that the output of a beauty pass has alpha premultiplied by default. Be careful when using these formulas. These blend modes only make sense if you know the context. I think the file should have specific references for the formulas. |
The previous Right now, the blend function is not specific for The premultiply alpha topic might be relevant in the future. If a use case comes up, we probably need a third parameter |
The function you added to the file in #29879 does not match the three.js normal blending formula. Also, the proposed name So, currently, I would be inclined to revert #29879, and inline the function in the SSR shader. |
Do you mind elaborating the differences and why we still get the same visual result? |
I don't remember exactly all links, because I was looking for blend modes that used then validated them in the image editor and got the expected result. It looks the "same" comparing to the reference below, except that our version returns a vec4() with the base opacity and has a opacity as parameter, I don't think the order of addition should change the result here. https://github.com/jamieowen/glsl-blend/blob/master/normal.glsl |
Related issue: #29879 (comment)
Description