drei
drei copied to clipboard
MeshRefractionMaterial produces warning X4000: use of potentially uninitialized variable (dyn_index_vec3_int)
-
three
version: 0.156.1 -
@react-three/fiber
version: 8.14.3 -
@react-three/drei
version: 9.85.0 -
node
version: 18.16.1 -
npm
(oryarn
) version: 9.8.1
Problem description:
Using MeshRefractionMaterial with octahedronGeometry or dodecahedronGeometry produces the following warnings:
three.module.js:11138 THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.
toNonIndexed @ three.module.js:11138
THREE.WebGLProgram: Program Info Log: C:\fakepath(188,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec3_int)
THREE.WebGLProgram: Program Info Log: C:\fakepath(193,1-6): warning X4000: use of potentially uninitialized variable (dyn_index_vec3_int)
Relevant code:
import { MeshRefractionMaterial } from '@react-three/drei'
const texture = useLoader(RGBELoader, 'https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/1k/aerodynamics_workshop_1k.hdr')
<octahedronGeometry visible={true} args={[shapeSize, shapeDetail]} />
<MeshRefractionMaterial
visible={true}
bounces={3}
fresnel={0.5}
aberrationStrength={0.0}
ior={1.8}
color='#883300'
fastChroma={true}
envMap={texture}
/>
Suggested solution:
This warning also in the demo sandbox: https://codesandbox.io/s/zqrreo?file=/src/App.js:1569-1576 I am using the same envMap texture as the sandbox loaded from polyhaven.org.
This comes from the DirectX compiler from ANGLE on your Windows machine which implements WebGL in your browser. The warning is harmless but comes from bad codegen and can false positive depending on the use of jump statements. Is this something you've been able to isolate to a specific configuration? I'm afraid this is too much of a timesink to justify digging into due to the deep stack surrounding the issue and OS.
:tada: This issue has been resolved in version 9.85.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
9.85.2 nor 9.86 does not remove the warning on my configuration.