pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.21k stars 670 forks source link

MeshRefractionMaterial produces warning X4000: use of potentially uninitialized variable (dyn_index_vec3_int) #1663

Open sean369see opened 11 months ago

sean369see commented 11 months ago

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.

CodyJasonBennett commented 11 months ago

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.

github-actions[bot] commented 11 months ago

:tada: This issue has been resolved in version 9.85.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

sean369see commented 11 months ago

9.85.2 nor 9.86 does not remove the warning on my configuration.