modifying shader with onBeforeCompile #819
Unanswered
garretteklof
asked this question in
Q&A
Replies: 1 comment
-
Here's a sandbox of the scene https://codesandbox.io/s/r3f-basic-demo-forked-ftwcm As you can see, the shader is not taking. I've logged both instances of the shader to the console (react-three-fiber and codepen), and nothing strikingly different jumps out. Please note that I downgraded three-js to version |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to recreate this scene in react-three-fiber -> https://codepen.io/prisoner849/pen/PvdEMP
However, I keep running into the error
extension directive must occur before any non-preprocessor tokens in ESSL3
when trying to remake the ground/road. This seems to have to do with the line#extension GL_OES_standard_derivatives : enable
, and removing the line removes the error but does not render the mesh.I stumbled across this -> https://spectrum.chat/react-three-fiber/general/onbeforecompile-and-updating-uniforms~fd2d6306-11bd-4e9d-b323-e17f89ea99ec - but regardless of the ways I choose to set it up (declarative / imperative) I run into the error, which means I'm probably doing something wrong outside of react-three-fiber.
I'm new to both three-js as well as react-three-fiber, but any direction in how to go about this will be much obliged (perhaps a different way to go about the road / noisy ground). Thanks.
Beta Was this translation helpful? Give feedback.
All reactions