mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 21:19:52 +01:00
feat: opaque he
This commit is contained in:
1 parent
9dc4483d70
commit
fe0fdc0964
3 files changed
+22
-14
No files matched your search
@@ -261,7 +261,7 @@ export function VersusBar() {
|
|||||||
<ModuleButton
|
<ModuleButton
|
||||||
selected={antagonist.shell.id === shell.id}
|
selected={antagonist.shell.id === shell.id}
|
||||||
type="shell"
|
type="shell"
|
||||||
shell={shell.type}
|
shell={shell.icon}
|
||||||
rowChild
|
rowChild
|
||||||
first={index === 0}
|
first={index === 0}
|
||||||
key={shell.id}
|
key={shell.id}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ uniform float ricochet;
|
|||||||
uniform float caliber;
|
uniform float caliber;
|
||||||
uniform float normalization;
|
uniform float normalization;
|
||||||
uniform bool canRichochet;
|
uniform bool canRichochet;
|
||||||
|
uniform bool canSplash;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec3 normalizedNormal = normalize(vNormal);
|
vec3 normalizedNormal = normalize(vNormal);
|
||||||
@@ -39,12 +40,23 @@ void main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float h = penetrationChance / PI;
|
if (canSplash) {
|
||||||
float s = 1.0;
|
float h = mix(20.0 / 360.0, 1.0 / PI, penetrationChance);
|
||||||
float v = 1.0;
|
float s = 1.0;
|
||||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
float v = 1.0;
|
||||||
vec3 p = abs(fract(h + K.xyz) * 6.0 - K.www);
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
vec3 rgb = v * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), s);
|
vec3 p = abs(fract(h + K.xyz) * 6.0 - K.www);
|
||||||
|
vec3 rgb = v * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), s);
|
||||||
|
|
||||||
csm_DiffuseColor = vec4(rgb, 1.0);
|
csm_DiffuseColor = vec4(rgb, 1.0);
|
||||||
|
} else {
|
||||||
|
float h = mix(0.0, 1.0 / PI, penetrationChance);
|
||||||
|
float s = 1.0;
|
||||||
|
float v = 1.0;
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(h + K.xyz) * 6.0 - K.www);
|
||||||
|
vec3 rgb = v * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), s);
|
||||||
|
|
||||||
|
csm_DiffuseColor = vec4(rgb, 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
import { Button, Text } from '@radix-ui/themes';
|
import { Button, Text } from '@radix-ui/themes';
|
||||||
import { ComponentProps } from 'react';
|
import { ComponentProps } from 'react';
|
||||||
import { asset } from '../core/blitzkrieg/asset';
|
import { asset } from '../core/blitzkrieg/asset';
|
||||||
import {
|
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitzkrieg/tankDefinitions';
|
||||||
ShellType,
|
|
||||||
TIER_ROMAN_NUMERALS,
|
|
||||||
Tier,
|
|
||||||
} from '../core/blitzkrieg/tankDefinitions';
|
|
||||||
|
|
||||||
type ModuleButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {
|
type ModuleButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
@@ -20,7 +16,7 @@ type ModuleButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {
|
|||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'shell';
|
type: 'shell';
|
||||||
shell: ShellType;
|
shell: string;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user