-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N8AO produces THREE.WebGLProgram: Shader Error 0 #32
Comments
Make sure you are using three.js r167 or earlier - as that is what is currently supported. 1.9 will bring support for r168. |
What version of N8AO are you using? The modern version doesn't use that legacy function. |
I have tried using r167 and as well implementing the new way how the Git docs says, but still I face the same issue. Tho I tried this approach and it runs `import { Canvas, useFrame, useThree } from "@react-three/fiber"; const Box = () => { useFrame(() => { return ( const Effects = () => { useEffect(() => {
}, [gl, scene, camera, size]); useFrame(() => composer.current?.render(), 1); return null; function App() { export default App; |
But I also have the question and concern, why in some devices when I ship a previous configurator I was using N8AO and I had to replace them, as during the testing part specifically on iOS devices it models appeared black, but on android and windows they were working fine. (At least the ones I tested on) |
Okay - but that line of code isn't even part of N8AO anymore. You must be using an older version. |
But I also have the question and concern, why in some devices when I ship a previous configurator I was using N8AO and I had to replace them, as during the testing part specifically on iOS devices it models appeared black, but on android and windows they were working fine. (At least the ones I tested on).... I need more info here. Any errors on those devices? |
@N8python Three.js 0.167.0 and n8ao 1.8.4 give me the Shader Error described above in Chrome and Firefox - you can repro by cloning https://github.com/ayan4m1/leela-memorial and upgrading n8ao/three in package.json:
<EffectComposer disableNormalPass>
<N8AO aoRadius={0.25} intensity={2} />
</EffectComposer> |
I'm sorry - but that code simply doesn't exist in the codebase anymore. You can't be using the latest version. |
The only thing I can think of is that it's somehow related to my use of Gatsby. I have cleared Gatsby's cache and removed my node_modules directory. I have checked node_modules/n8ao/dist/N8AO.js and it contains |
Wow... ok, so apparently @react-three/postprocessing uses an ancient version of n8ao... From their package.json: "dependencies": {
"buffer": "^6.0.3",
"maath": "^0.6.0",
"n8ao": "^1.6.6",
"postprocessing": "^6.32.1",
"three-stdlib": "^2.23.4"
}, This seems to be causing my issue. To be clear, using N8AOPostPass manually should work, but the react-three/postprocessing N8AO convenience component for EffectComposer is currently broken with three r167 because that version has a copy-pasted version of N8AO 1.6.x in it. |
That's on the r3p people I'm afraid - maybe take it up there? |
Sure, thanks. |
As soon as I disable, it works. Even on the simplest of scenes.
`import { Canvas, useFrame } from '@react-three/fiber';
import { useRef } from 'react';
import { EffectComposer, N8AO } from '@react-three/postprocessing';
const Box = () => {
const meshRef = useRef();
useFrame(() => {
meshRef.current.rotation.x += 0.01;
meshRef.current.rotation.y += 0.01;
});
return (
);
};
function App() {
return (
<div style={{ width: '100vw', height: '100vh' }}>
);
}
export default App;`
It works with SSAO, but because SSAO doesn't work with instances, I need N8AO. I also had the issue in the past where N8AO will give black artifacts in some devices.
My GPU drivers are up-to-date (RTX 3080) and I have tried with three different drivers.
The text was updated successfully, but these errors were encountered: