drei icon indicating copy to clipboard operation
drei copied to clipboard

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

Open sean369see opened this issue 1 year ago • 3 comments

  • 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 (or yarn) 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.

sean369see avatar Sep 26 '23 18:09 sean369see

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.

CodyJasonBennett avatar Sep 27 '23 01:09 CodyJasonBennett

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

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Sep 27 '23 06:09 github-actions[bot]

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

sean369see avatar Sep 28 '23 14:09 sean369see