pmndrs / drei

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

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

Closed sean369see closed 6 days ago

sean369see commented 1 year 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 1 year 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 1 year 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 1 year ago

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

github-actions[bot] commented 1 week ago

Thank you for contributing! We’re marking this issue as stale as a gentle reminder to revisit it and give it the attention it needs to move forward.

Any activity, like adding an update or comment, will automatically remove the stale label so it stays on our radar.

Feel free to reach out on Discord if you need support or feedback from the community. This issue will close automatically soon if there’s no further activity. Thank you for understanding and for being part of the project!

github-actions[bot] commented 6 days ago

We’re closing this issue to keep our project manageable and make room for other active work, but we truly appreciate your effort and contribution.

If you’d like to continue working on this, please feel free to re-open it or reach out on Discord — our community is always ready to support you. Thanks again for helping us stay organized and for understanding our approach!