mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: transparency checks and depth writing
This commit is contained in:
1 parent
bae7ca2720
commit
d5269e763b
3 files changed
+22
-25
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { Mesh, Object3D } from "three";
|
||||
import { Mesh, MeshStandardMaterial, Object3D } from "three";
|
||||
|
||||
export function jsxTree(
|
||||
node: Object3D,
|
||||
@@ -7,14 +7,14 @@ export function jsxTree(
|
||||
mesh?: (
|
||||
mesh: Mesh,
|
||||
props: ComponentProps<"mesh">,
|
||||
key: string
|
||||
key: string,
|
||||
) => ReactNode;
|
||||
group?: (
|
||||
object3d: Object3D,
|
||||
props: ComponentProps<"group">,
|
||||
key: string
|
||||
key: string,
|
||||
) => ReactNode;
|
||||
}
|
||||
},
|
||||
): ReactNode {
|
||||
if (node instanceof Mesh) {
|
||||
const props = {
|
||||
@@ -25,6 +25,10 @@ export function jsxTree(
|
||||
scale: node.scale,
|
||||
};
|
||||
|
||||
if (props.material instanceof MeshStandardMaterial) {
|
||||
props.material.depthWrite = true;
|
||||
}
|
||||
|
||||
return mergers?.mesh ? (
|
||||
mergers.mesh(node, props, node.uuid)
|
||||
) : (
|
||||
|
||||
Reference in new issue
Block a user