Godot Version
v4.3.stable.official [77dcf97d8]
Question
At some point my project started printing this error whenever I open the project. There is no indication of what part of my project is the origin of this. I think it might have something to GPU particles, but is not related to any shaders I’ve written as I’ve not written any custom shaders.
It doesn’t seem to cause anything from rendering or running incorrectly, so there’s no obvious place to look. Is there a way to track down what’s causing this?
Godot Engine v4.3.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
:9 - Unknown identifier in expression: 'VIEW'.
Shader compilation failed.
:14 - Unknown identifier in expression: 'VIEW'.
Shader compilation failed.
:15 - Unknown identifier in expression: 'VIEW'.
Shader compilation failed.
--Main Shader--
1 | shader_type canvas_item;
2 |
3 |
4 |
5 |
6 | void fragment() {
7 |
8 | float n_in3p3 = 1.00000;
E 9-> float n_out3p0 = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), n_in3p3);
10 |
11 |
12 | COLOR.rgb = vec3(n_out3p0);
13 | }
14 |
Change the shader type to spatial. VIEW isn’t defined in canvas_item.
Maybe try deleting your .godot/imported
folder to re-import everything?
Looking at the variable names, you have a visual shader somewhere.
Did some further testing, I assumed the issue was that you used a fresnel node in visual shader (that dot pow blabla function is the fresnel node) and that there was some bug with the defaults using VIEW in a canvas shader.
After testing myself I couln’t manage to have the same behaviour: note how there is no VIEW used, only vec3(0.)
When you do find the shader, please file a bug report if it’s indeed a visual shader resource causing this. GitHub · Where software is built
1 Like
I forgot about that one. I opened a bug for it.
opened 10:03AM - 18 Jan 25 UTC
### Tested versions
v4.3.stable.official [77dcf97d8]
### System information
G… odot v4.3.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated AMD FirePro W2100 (Advanced Micro Devices, Inc.; 27.20.21026.2006) - Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz (4 Threads)
### Issue description
This visual shader is causing a compilation error to be printed to screen every time my project is restarted. It does not seem to affect rendering.
https://forum.godotengine.org/t/how-do-i-track-down-this-error/98336/4
```
Godot Engine v4.3.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
:9 - Unknown identifier in expression: 'VIEW'.
Shader compilation failed.
:14 - Unknown identifier in expression: 'VIEW'.
Shader compilation failed.
:15 - Unknown identifier in expression: 'VIEW'.
Shader compilation failed.
--Main Shader--
1 | shader_type canvas_item;
2 |
3 |
4 |
5 |
6 | void fragment() {
7 |
8 | float n_in3p3 = 1.00000;
E 9-> float n_out3p0 = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), n_in3p3);
10 |
11 |
12 | COLOR.rgb = vec3(n_out3p0);
13 | }
14 |
--Main Shader--
1 | shader_type canvas_item;
2 |
3 | uniform sampler2D tex_frg_2 : source_color;
4 |
5 |
6 |
7 | void fragment() {
8 |
9 | vec4 n_out2p0 = texture(tex_frg_2, UV);
10 |
11 |
12 |
13 | float n_in3p3 = 1.00000;
E 14-> float n_out3p0 = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), n_in3p3);
15 |
16 |
17 |
18 | float n_out5p0 = 1.0 - n_out3p0;
19 |
20 |
21 |
22 | float n_out4p0 = n_out2p0.x * n_out5p0;
23 |
24 |
25 | COLOR.rgb = vec3(n_out4p0);
26 | }
27 |
--Main Shader--
1 | shader_type canvas_item;
2 |
3 | uniform sampler2D tex_frg_2 : source_color;
4 | uniform sampler2D curve_frg_7 : repeat_disable;
5 |
6 |
7 |
8 | void fragment() {
9 |
10 | vec4 n_out2p0 = texture(tex_frg_2, UV);
11 |
12 |
13 |
14 | float n_in3p3 = 1.00000;
E 15-> float n_out3p0 = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), n_in3p3);
16 |
17 |
18 |
19 | float n_out5p0 = 1.0 - n_out3p0;
20 |
21 |
22 |
23 | float n_out4p0 = n_out2p0.x * n_out5p0;
24 |
25 |
26 |
27 | float n_out7p0 = texture(curve_frg_7, vec2(n_out4p0)).r;
28 |
29 |
30 | COLOR.rgb = vec3(n_out7p0);
31 | }
32 |
VSRerouteNode size: (32, 32)
```
### Steps to reproduce
Run the attached project. Error message should be printed when it is opened.
### Minimal reproduction project (MRP)
[fresnel_fireball.zip](https://github.com/user-attachments/files/18463925/fresnel_fireball.zip)