mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: opaque mode
This commit is contained in:
1 parent
01f919ddd3
commit
07cdb0788c
4 files changed
+33
-13
No files matched your search
@@ -51,6 +51,7 @@ export function CoreArmor({ node, thickness }: CoreArmorProps) {
|
||||
explosionRadius: { value: null },
|
||||
greenPenetration: { value: null },
|
||||
wireframe: { value: null },
|
||||
opaque: { value: null },
|
||||
|
||||
resolution: { value: new Vector2() },
|
||||
spacedArmorBuffer: { value: null },
|
||||
@@ -78,6 +79,7 @@ export function CoreArmor({ node, thickness }: CoreArmorProps) {
|
||||
) {
|
||||
material.uniforms.greenPenetration.value = visual.greenPenetration;
|
||||
material.uniforms.wireframe.value = visual.wireframe;
|
||||
material.uniforms.opaque.value = visual.opaque || visual.wireframe;
|
||||
material.wireframe = visual.wireframe;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ uniform float damage;
|
||||
uniform float explosionRadius;
|
||||
uniform bool greenPenetration;
|
||||
uniform bool wireframe;
|
||||
uniform bool opaque;
|
||||
|
||||
uniform highp sampler2D spacedArmorBuffer;
|
||||
uniform highp sampler2D spacedArmorDepth;
|
||||
@@ -74,7 +75,7 @@ void main() {
|
||||
}
|
||||
}
|
||||
|
||||
float alpha = wireframe ? 1.0 : 0.5;
|
||||
float alpha = opaque ? 1.0 : 0.5;
|
||||
vec3 color = vec3(1.0, splashChance * 0.392, 0.0);
|
||||
if (greenPenetration) {
|
||||
// non-trigonometric red-green mixing: https://www.desmos.com/calculator/ceo1oq7l67
|
||||
@@ -84,5 +85,4 @@ void main() {
|
||||
} else {
|
||||
gl_FragColor = vec4(color, (1.0 - penetrationChance) * alpha);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user