mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-10 11:16:10 +01:00
non transparent ground
This commit is contained in:
1 file changed
+6
-4
+6
-4
@@ -47,10 +47,10 @@ export function SceneProps() {
|
|||||||
|
|
||||||
${shader.fragmentShader}
|
${shader.fragmentShader}
|
||||||
`.replace(
|
`.replace(
|
||||||
"#include <color_fragment>",
|
"#include <dithering_fragment>",
|
||||||
|
|
||||||
`
|
`
|
||||||
#include <color_fragment>
|
#include <dithering_fragment>
|
||||||
|
|
||||||
vec3 scaled = vWorldPosition / size;
|
vec3 scaled = vWorldPosition / size;
|
||||||
float radius = length(scaled.xz);
|
float radius = length(scaled.xz);
|
||||||
@@ -59,7 +59,10 @@ export function SceneProps() {
|
|||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
diffuseColor.a *= (1.0 - radius);
|
float x = 1.0 - radius;
|
||||||
|
float y = x * x;
|
||||||
|
|
||||||
|
gl_FragColor.rgb *= y;
|
||||||
`,
|
`,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -78,7 +81,6 @@ export function SceneProps() {
|
|||||||
<meshStandardMaterial
|
<meshStandardMaterial
|
||||||
color={mauveDark.mauve6}
|
color={mauveDark.mauve6}
|
||||||
roughness={1}
|
roughness={1}
|
||||||
transparent
|
|
||||||
onBeforeCompile={handleBeforeCompile}
|
onBeforeCompile={handleBeforeCompile}
|
||||||
/>
|
/>
|
||||||
</mesh>
|
</mesh>
|
||||||
|
|||||||
Reference in new issue
Block a user