I encountered a compile error message:
THREE.WebGLShader: Shader could not compile.
I attempted to use shaders from shaderfrog.com, but unfortunately they did not compile correctly.
To troubleshoot, I added my new vertex and fragment shaders to the DOM after referencing an example file.
<script id="vertexShader_new" type="x-shader/x-vertex">
. . .
</script>
material = new THREE.ShaderMaterial({
uniforms: uniforms,
vertexShader: document.getElementById('vertexShader_new').textContent,
fragmentShader: document.getElementById('fragmentShader_new').textContent
});
In order to test other functionalities, I reverted the IDs back to vertexShader
and fragmentShader
in the demo code.
https://codesandbox.io/s/practical-kepler-3pdps?fontsize=14
The question remains: what is causing the issue with the shader? Here is the link to the shader in question: Molten Noise shader