<p>I know that Three.js prepends the shader text you provide with some code that includes definitions etc. I am not a big fan of &quot;magic&quot; and I would like to be able to see the final text content of the shader(s) that Three.js actually uses.</p>
<p>I have seen that in earlier releases of Three.js, if there was en error in a shader file (either the vertex shader of the fragment shader), the whole text content of the shader was logged in console, including all the <strong>prepended code</strong> by Three.js.</p>
<p>I am currently using <strong>r148</strong> and in case of an error, only the line(s) containing the error(s) gets logged in console.</p>
<p>Has the functionality of logging the whole shader file in console been removed or is there any way to enable it? Or, more generally, is there any other way to access the actual text content of each of the shaders?</p>

CC BY-SA 4.0
2023-01-20T15:10:40.013Z
Hi Michael! This appears to be a fine question. But it seems to fall more on the programming side than the graphics side. If you don't get a lot of answers, you might consider reposting the question on StackOverflow.
luser droog
CC BY-SA 4.0
2023-01-20T15:19:49.230Z
Hello luser, thanks for your answer! I have already posted it on StackOverflow, but I got no answers there as well :D
Michael Kolesidis
<shader><fragment-shader><three.js>
How can I see the whole shader's text content, with all the prepended code by Three.js, when using ShaderMaterial or RawShaderMaterial (r148)?
Michael Kolesidis
# How can I see the whole shader's text content, with all the prepended code by Three.js, when using ShaderMaterial or RawShaderMaterial (r148)?

(Asked by: username_0 on 2023-01-19)

I know that Three.js prepends the shader text you provide with some code that includes definitions etc. I am not a big fan of "magic" and I would like to be able to see the final text content of the shader(s) that Three.js actually uses.

I have seen that in earlier releases of Three.js, if there was en error in a shader file (either the vertex shader of the fragment shader), the whole text content of the shader was logged in console, including all the **prepended code** by Three.js.

I am currently using **r148** and in case of an error, only the line(s) containing the error(s) gets logged in console.

Has the functionality of logging the whole shader file in console been removed or is there any way to enable it? Or, more generally, is there any other way to access the actual text content of each of the shaders?

**Tags:** shader, fragment-shader, three.js

> **Comments:**
> **username_1**: Hi username_0! This appears to be a fine question. But it seems to fall more on the programming side than the graphics side. If you don't get a lot of answers, you might consider reposting the question on StackOverflow.  
> **username_0**: Hello username_1, thanks for your answer! I have already posted it on StackOverflow, but I got no answers there as well :D  

---

## 0 answers

