|
|
@@ -1,4 +1,4 @@
|
|
|
-import { Fn } from '../tsl/TSLBase.js';
|
|
|
+import { Fn, vec4 } from '../tsl/TSLBase.js';
|
|
|
import { mix, min, step } from '../math/MathNode.js';
|
|
|
|
|
|
export const burn = /*@__PURE__*/ Fn( ( [ base, blend ] ) => {
|
|
|
@@ -52,3 +52,16 @@ export const overlay = /*@__PURE__*/ Fn( ( [ base, blend ] ) => {
|
|
|
{ name: 'blend', type: 'vec3' }
|
|
|
]
|
|
|
} );
|
|
|
+
|
|
|
+export const blendNormal = /*@__PURE__*/ Fn( ( [ base, blend ] ) => {
|
|
|
+
|
|
|
+ return vec4( base.rgb.mul( blend.a.oneMinus() ).add( blend.rgb.mul( blend.a ) ), base.a );
|
|
|
+
|
|
|
+} ).setLayout( {
|
|
|
+ name: 'blendNormal',
|
|
|
+ type: 'vec4',
|
|
|
+ inputs: [
|
|
|
+ { name: 'base', type: 'vec4' },
|
|
|
+ { name: 'blend', type: 'vec4' }
|
|
|
+ ]
|
|
|
+} );
|