diff --git a/src/lib/model/shader/fragment.ts b/src/lib/model/shader/fragment.ts index 1b6bf0c..d7a96e7 100644 --- a/src/lib/model/shader/fragment.ts +++ b/src/lib/model/shader/fragment.ts @@ -77,6 +77,11 @@ void combineOpaqueMod2x(inout vec4 color, in vec4 tex0, in vec4 tex1) { void combineOpaqueMod2xNa(inout vec4 color, in vec4 tex0, in vec4 tex1) { color.rgb = (color.rgb * tex0.rgb) * tex1.rgb * 2.0; } + +void combineModMod(inout vec4 color, in vec4 tex0, in vec4 tex1) { + color.rgb = (color.rgb * tex0.rgb) * tex1.rgb; + color.a = (color.a * tex0.a) * tex1.a; +} `; const FRAGMENT_SHADER_MAIN_ALPHATEST = ` @@ -175,6 +180,7 @@ const FRAGMENT_SHADER = { [M2_FRAGMENT_SHADER.FRAGMENT_OPAQUE_MOD2XNA]: createFragmentShader(2, 'combineOpaqueMod2xNa'), [M2_FRAGMENT_SHADER.FRAGMENT_OPAQUE_ADDNA]: createFragmentShader(2, 'combineOpaqueAddNa'), [M2_FRAGMENT_SHADER.FRAGMENT_OPAQUE_MOD]: createFragmentShader(2, 'combineOpaqueMod'), + [M2_FRAGMENT_SHADER.FRAGMENT_MOD_MOD]: createFragmentShader(2, 'combineModMod'), [M2_FRAGMENT_SHADER.FRAGMENT_UNKNOWN]: createFragmentShader(0, ''), };