shader compilation failed
Asked Answered
W

13

0

Godot Engine v4.1.3.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
:33 - Unknown identifier in expression: 'shearMatrix'.
Shader compilation failed.
:25 - Unknown identifier in expression: 'shearMatrix'.
Shader compilation failed.
:19 - Unknown identifier in expression: 'shearMatrix'.
Shader compilation failed.
:31 - Unknown identifier in expression: 'shearMatrix'.
Shader compilation failed.
(4) ./servers/rendering/renderer_rd/shader_rd.h:140 - Condition "!version" is true. Returning: RID()
--Main Shader--
1 | shader_type canvas_item;
2 |
3 | uniform vec4 sgreen : source_color = vec4(0.000000, 1.000000, 0.000000, 1.000000);
4 | uniform vec4 syellow : source_color = vec4(1.000000, 1.000000, 0.000000, 1.000000);
5 | uniform vec4 sblue : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
6 | uniform vec4 sred : source_color = vec4(1.000000, 0.000000, 0.000000, 1.000000);
7 | uniform float FloatParameter2 = 1.04999995231628;
8 | uniform float FloatParameter3 = 1.20000004768372;
9 | uniform float FloatParameter4 = 1.35000002384186;
10 | uniform vec4 swhite : source_color = vec4(1.000000, 1.000000, 1.000000, 1.000000);
11 | uniform float fillrate = 0.89999997615814;
12 |
13 |
14 |
15 | void fragment() {
16 |
17 | vec4 n_out60p0 = sgreen;
18 |
19 |
20 |
21 | vec4 n_out57p0 = syellow;
22 |
23 |
24 |
25 | vec4 n_out58p0 = sblue;
26 |
27 |
28 |
29 | vec4 n_out59p0 = sred;
30 |
31 |
32 |
E 33-> mat4 n_out44p0 = shearMatrix;
34 |
35 |
36 |
37 | vec2 n_out17p0 = UV;
38 |
39 |
40 |
41 | vec3 n_out47p0 = (n_out44p0 * vec4(vec3(n_out17p0, 0.0), 1.0)).xyz;
42 |
43 |
44 |
45 | float n_out10p0 = vec4(n_out47p0, 0.0).x;
46 | float n_out10p1 = vec4(n_out47p0, 0.0).y;
47 | float n_out10p2 = vec4(n_out47p0, 0.0).z;
48 | float n_out10p3 = vec4(n_out47p0, 0.0).w;
49 |
50 |
51 |
52 | float n_out62p0 = FloatParameter2;
53 |
54 |
55 |
56 | vec4 n_out22p0 = step(vec4(n_out10p1), vec4(n_out62p0));
57 |
58 |
59 |
60 | vec4 n_out37p0 = mix(n_out58p0, n_out59p0, n_out22p0);
61 |
62 |
63 |
64 | float n_out63p0 = FloatParameter3;
65 |
66 |
67 |
68 | vec4 n_out18p0 = step(vec4(n_out10p1), vec4(n_out63p0));
69 |
70 |
71 |
72 | vec4 n_out29p0 = mix(n_out57p0, n_out37p0, n_out18p0);
73 |
74 |
75 |
76 | float n_out64p0 = FloatParameter4;
77 |
78 |
79 |
80 | vec4 n_out52p0 = step(vec4(n_out10p1), vec4(n_out64p0));
81 |
82 |
83 |
84 | vec4 n_out50p0 = mix(n_out60p0, n_out29p0, n_out52p0);
85 |
86 |
87 |
88 | vec4 n_out56p0 = swhite;
89 |
90 |
91 |
92 | float n_out65p0 = fillrate;
93 |
94 |
95 |
96 | vec4 n_out30p0 = step(vec4(n_out10p1), vec4(n_out65p0));
97 |
98 |
99 |
100 | vec4 n_out27p0 = mix(n_out50p0, n_out56p0, n_out30p0);
101 |
102 |
103 | COLOR.rgb = n_out27p0.xyz;
104 | }
105 |
--Main Shader--
1 | shader_type canvas_item;
2 |
3 | uniform vec4 syellow : source_color = vec4(1.000000, 1.000000, 0.000000, 1.000000);
4 | uniform vec4 sblue : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
5 | uniform vec4 sred : source_color = vec4(1.000000, 0.000000, 0.000000, 1.000000);
6 | uniform float FloatParameter2 = 1.04999995231628;
7 | uniform float FloatParameter3 = 1.20000004768372;
8 |
9 |
10 |
11 | void fragment() {
12 |
13 | vec4 n_out57p0 = syellow;
14 |
15 |
16 |
17 | vec4 n_out58p0 = sblue;
18 |
19 |
20 |
21 | vec4 n_out59p0 = sred;
22 |
23 |
24 |
E 25-> mat4 n_out44p0 = shearMatrix;
26 |
27 |
28 |
29 | vec2 n_out17p0 = UV;
30 |
31 |
32 |
33 | vec3 n_out47p0 = (n_out44p0 * vec4(vec3(n_out17p0, 0.0), 1.0)).xyz;
34 |
35 |
36 |
37 | float n_out10p0 = vec4(n_out47p0, 0.0).x;
38 | float n_out10p1 = vec4(n_out47p0, 0.0).y;
39 | float n_out10p2 = vec4(n_out47p0, 0.0).z;
40 | float n_out10p3 = vec4(n_out47p0, 0.0).w;
41 |
42 |
43 |
44 | float n_out62p0 = FloatParameter2;
45 |
46 |
47 |
48 | vec4 n_out22p0 = step(vec4(n_out10p1), vec4(n_out62p0));
49 |
50 |
51 |
52 | vec4 n_out37p0 = mix(n_out58p0, n_out59p0, n_out22p0);
53 |
54 |
55 |
56 | float n_out63p0 = FloatParameter3;
57 |
58 |
59 |
60 | vec4 n_out18p0 = step(vec4(n_out10p1), vec4(n_out63p0));
61 |
62 |
63 |
64 | vec4 n_out29p0 = mix(n_out57p0, n_out37p0, n_out18p0);
65 |
66 |
67 | COLOR.rgb = n_out29p0.xyz;
68 | }
69 |
--Main Shader--
1 | shader_type canvas_item;
2 |
3 | uniform vec4 sblue : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
4 | uniform vec4 sred : source_color = vec4(1.000000, 0.000000, 0.000000, 1.000000);
5 | uniform float FloatParameter2 = 1.04999995231628;
6 |
7 |
8 |
9 | void fragment() {
10 |
11 | vec4 n_out58p0 = sblue;
12 |
13 |
14 |
15 | vec4 n_out59p0 = sred;
16 |
17 |
18 |
E 19-> mat4 n_out44p0 = shearMatrix;
20 |
21 |
22 |
23 | vec2 n_out17p0 = UV;
24 |
25 |
26 |
27 | vec3 n_out47p0 = (n_out44p0 * vec4(vec3(n_out17p0, 0.0), 1.0)).xyz;
28 |
29 |
30 |
31 | float n_out10p0 = vec4(n_out47p0, 0.0).x;
32 | float n_out10p1 = vec4(n_out47p0, 0.0).y;
33 | float n_out10p2 = vec4(n_out47p0, 0.0).z;
34 | float n_out10p3 = vec4(n_out47p0, 0.0).w;
35 |
36 |
37 |
38 | float n_out62p0 = FloatParameter2;
39 |
40 |
41 |
42 | vec4 n_out22p0 = step(vec4(n_out10p1), vec4(n_out62p0));
43 |
44 |
45 |
46 | vec4 n_out37p0 = mix(n_out58p0, n_out59p0, n_out22p0);
47 |
48 |
49 | COLOR.rgb = n_out37p0.xyz;
50 | }
51 |
--Main Shader--
1 | shader_type canvas_item;
2 |
3 | uniform vec4 sgreen : source_color = vec4(0.000000, 1.000000, 0.000000, 1.000000);
4 | uniform vec4 syellow : source_color = vec4(1.000000, 1.000000, 0.000000, 1.000000);
5 | uniform vec4 sblue : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
6 | uniform vec4 sred : source_color = vec4(1.000000, 0.000000, 0.000000, 1.000000);
7 | uniform float FloatParameter2 = 1.04999995231628;
8 | uniform float FloatParameter3 = 1.20000004768372;
9 | uniform float FloatParameter4 = 1.35000002384186;
10 |
11 |
12 |
13 | void fragment() {
14 |
15 | vec4 n_out60p0 = sgreen;
16 |
17 |
18 |
19 | vec4 n_out57p0 = syellow;
20 |
21 |
22 |
23 | vec4 n_out58p0 = sblue;
24 |
25 |
26 |
27 | vec4 n_out59p0 = sred;
28 |
29 |
30 |
E 31-> mat4 n_out44p0 = shearMatrix;
32 |
33 |
34 |
35 | vec2 n_out17p0 = UV;
36 |
37 |
38 |
39 | vec3 n_out47p0 = (n_out44p0 * vec4(vec3(n_out17p0, 0.0), 1.0)).xyz;
40 |
41 |
42 |
43 | float n_out10p0 = vec4(n_out47p0, 0.0).x;
44 | float n_out10p1 = vec4(n_out47p0, 0.0).y;
45 | float n_out10p2 = vec4(n_out47p0, 0.0).z;
46 | float n_out10p3 = vec4(n_out47p0, 0.0).w;
47 |
48 |
49 |
50 | float n_out62p0 = FloatParameter2;
51 |
52 |
53 |
54 | vec4 n_out22p0 = step(vec4(n_out10p1), vec4(n_out62p0));
55 |
56 |
57 |
58 | vec4 n_out37p0 = mix(n_out58p0, n_out59p0, n_out22p0);
59 |
60 |
61 |
62 | float n_out63p0 = FloatParameter3;
63 |
64 |
65 |
66 | vec4 n_out18p0 = step(vec4(n_out10p1), vec4(n_out63p0));
67 |
68 |
69 |
70 | vec4 n_out29p0 = mix(n_out57p0, n_out37p0, n_out18p0);
71 |
72 |
73 |
74 | float n_out64p0 = FloatParameter4;
75 |
76 |
77 |
78 | vec4 n_out52p0 = step(vec4(n_out10p1), vec4(n_out64p0));
79 |
80 |
81 |
82 | vec4 n_out50p0 = mix(n_out60p0, n_out29p0, n_out52p0);
83 |
84 |
85 | COLOR.rgb = n_out50p0.xyz;
86 | }
87 |

the shader is as below
shader_type canvas_item;
render_mode blend_mix, unshaded;

uniform vec4 sgreen : source_color = vec4(0.000000, 1.000000, 0.000000, 1.000000);
uniform vec4 syellow : source_color = vec4(1.000000, 1.000000, 0.000000, 1.000000);
uniform vec4 sblue : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
uniform vec4 sred : source_color = vec4(1.000000, 0.000000, 0.000000, 1.000000);
uniform vec4 swhite : source_color = vec4(1.000000, 1.000000, 1.000000, 1.000000);
// Varyings
varying mat4 shearMatrix;
uniform float FloatParameter2 = 1.04999995231628;
uniform float FloatParameter3 = 1.20000004768372;
uniform float FloatParameter4 = 1.35000002384186;
uniform float fillrate = 0.89999997615814;

void vertex() {
// Input:13
vec2 n_out13p0 = TEXTURE_PIXEL_SIZE;

float n_out5p0;

// Expression:5
n_out5p0 = 0.0;
{
n_out5p0 = n_out13p0.y / n_out13p0.x;
}

// Input:4
mat4 n_out4p0 = MODEL_MATRIX;

float n_out6p0;

// Expression:6
n_out6p0 = 0.0;
{
n_out6p0=atan(n_out4p0[0].y * n_out5p0, n_out4p0[0].x);
}

vec4 n_out7p0;

// Expression:7
n_out7p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out7p0=vec4(1.0, sin(n_out6p0), 0.0, 0.0);
}

vec4 n_out8p0;

// Expression:8
n_out8p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out8p0=vec4(1.0, cos(n_out6p0), 0.0, 0.0);
}

vec4 n_out10p0;

// Expression:10
n_out10p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out10p0=vec4(0.0, 0.0, 1.0, 0.0);
}

vec4 n_out11p0;

// Expression:11
n_out11p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out11p0=vec4(0.0, 0.5, 0.0, 0.0);
}

// TransformCompose:12
mat4 n_out12p0 = mat4(vec4(vec3(n_out7p0.xyz), 0.0), vec4(vec3(n_out8p0.xyz), 0.0), vec4(vec3(n_out10p0.xyz), 0.0), vec4(vec3(n_out11p0.xyz), 1.0));

// VaryingSetter:9
shearMatrix = n_out12p0;

}

void fragment() {
// ColorParameter:60
vec4 n_out60p0 = sgreen;

// ColorParameter:57
vec4 n_out57p0 = syellow;

// ColorParameter:58
vec4 n_out58p0 = sblue;

// ColorParameter:59
vec4 n_out59p0 = sred;

// VaryingGetter:44
mat4 n_out44p0 = shearMatrix;

// Input:17
vec2 n_out17p0 = UV;

// TransformVectorMult:47
vec3 n_out47p0 = (n_out44p0 * vec4(vec3(n_out17p0, 0.0), 1.0)).xyz;

// VectorDecompose:10
float n_out10p0 = vec4(n_out47p0, 0.0).x;
float n_out10p1 = vec4(n_out47p0, 0.0).y;
float n_out10p2 = vec4(n_out47p0, 0.0).z;
float n_out10p3 = vec4(n_out47p0, 0.0).w;

// FloatParameter:62
float n_out62p0 = FloatParameter2;

// Step:22
vec4 n_out22p0 = step(vec4(n_out10p1), vec4(n_out62p0));

// Mix:37
vec4 n_out37p0 = mix(n_out58p0, n_out59p0, n_out22p0);

// FloatParameter:63
float n_out63p0 = FloatParameter3;

// Step:18
vec4 n_out18p0 = step(vec4(n_out10p1), vec4(n_out63p0));

// Mix:29
vec4 n_out29p0 = mix(n_out57p0, n_out37p0, n_out18p0);

// FloatParameter:64
float n_out64p0 = FloatParameter4;

// Step:52
vec4 n_out52p0 = step(vec4(n_out10p1), vec4(n_out64p0));

// Mix:50
vec4 n_out50p0 = mix(n_out60p0, n_out29p0, n_out52p0);

// ColorParameter:56
vec4 n_out56p0 = swhite;

// FloatParameter:65
float n_out65p0 = fillrate;

// Step:30
vec4 n_out30p0 = step(vec4(n_out10p1), vec4(n_out65p0));

// Mix:27
vec4 n_out27p0 = mix(n_out50p0, n_out56p0, n_out30p0);

// Output:0
COLOR.rgb = vec3(n_out27p0.xyz);

}

game crashing when installed in android phone with renderer mobile+
the game works in OpenGL buts crashes in Vulkan
In Android Studio
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 31544 (VkThread), pid 31504

Wundt answered 30/11, 2023 at 13:47 Comment(0)
P
0

Wundt Is it possible to make a quick check if this also happens with 4.2 which was just released today?

Percolation answered 30/11, 2023 at 14:48 Comment(0)
S
0

Wundt E 31-> mat4 n_out44p0 = shearMatrix;

This seems to be the issue, though as Agenda said I'd try 4.2 first before trying to work around this.

Spermophyte answered 30/11, 2023 at 15:1 Comment(0)
W
0

But shearMatrix is already declared.
varying mat4 shearMatrix;

Wundt answered 30/11, 2023 at 18:4 Comment(0)
D
0

Wundt Post the *.tres file of the whole shader.

Digitigrade answered 30/11, 2023 at 18:24 Comment(0)
W
0

Digitigrade
I'm not using the .tres file, .gdshader file is used. I have attached the entire code in the first post.

game crashing when installed in android phone with renderer mobile+(vulkan)
the game works in OpenGL buts crashes in Vulkan
In Android Studio
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 31544 (VkThread), pid 31504

Wundt answered 1/12, 2023 at 4:33 Comment(0)
D
0

Wundt Then post gdshader file.

Digitigrade answered 1/12, 2023 at 4:48 Comment(0)
W
0

shader_type canvas_item;
render_mode blend_mix, unshaded;

uniform vec4 sgreen : source_color = vec4(0.000000, 1.000000, 0.000000, 1.000000);
uniform vec4 syellow : source_color = vec4(1.000000, 1.000000, 0.000000, 1.000000);
uniform vec4 sblue : source_color = vec4(0.000000, 0.000000, 1.000000, 1.000000);
uniform vec4 sred : source_color = vec4(1.000000, 0.000000, 0.000000, 1.000000);
uniform vec4 swhite : source_color = vec4(1.000000, 1.000000, 1.000000, 1.000000);
// Varyings
varying mat4 shearMatrix;
uniform float FloatParameter2 = 1.04999995231628;
uniform float FloatParameter3 = 1.20000004768372;
uniform float FloatParameter4 = 1.35000002384186;
uniform float fillrate = 0.89999997615814;

void vertex() {
// Input:13
vec2 n_out13p0 = TEXTURE_PIXEL_SIZE;

float n_out5p0;

// Expression:5
n_out5p0 = 0.0;
{
n_out5p0 = n_out13p0.y / n_out13p0.x;
}

// Input:4
mat4 n_out4p0 = MODEL_MATRIX;

float n_out6p0;

// Expression:6
n_out6p0 = 0.0;
{
n_out6p0=atan(n_out4p0[0].y * n_out5p0, n_out4p0[0].x);
}

vec4 n_out7p0;

// Expression:7
n_out7p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out7p0=vec4(1.0, sin(n_out6p0), 0.0, 0.0);
}

vec4 n_out8p0;

// Expression:8
n_out8p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out8p0=vec4(1.0, cos(n_out6p0), 0.0, 0.0);
}

vec4 n_out10p0;

// Expression:10
n_out10p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out10p0=vec4(0.0, 0.0, 1.0, 0.0);
}

vec4 n_out11p0;

// Expression:11
n_out11p0 = vec4(0.0, 0.0, 0.0, 0.0);
{
n_out11p0=vec4(0.0, 0.5, 0.0, 0.0);
}

// TransformCompose:12
mat4 n_out12p0 = mat4(vec4(vec3(n_out7p0.xyz), 0.0), vec4(vec3(n_out8p0.xyz), 0.0), vec4(vec3(n_out10p0.xyz), 0.0), vec4(vec3(n_out11p0.xyz), 1.0));

// VaryingSetter:9
shearMatrix = n_out12p0;

}

void fragment() {
// ColorParameter:60
vec4 n_out60p0 = sgreen;

// ColorParameter:57
vec4 n_out57p0 = syellow;

// ColorParameter:58
vec4 n_out58p0 = sblue;

// ColorParameter:59
vec4 n_out59p0 = sred;

// VaryingGetter:44
mat4 n_out44p0 = shearMatrix;

// Input:17
vec2 n_out17p0 = UV;

// TransformVectorMult:47
vec3 n_out47p0 = (n_out44p0 * vec4(vec3(n_out17p0, 0.0), 1.0)).xyz;

// VectorDecompose:10
float n_out10p0 = vec4(n_out47p0, 0.0).x;
float n_out10p1 = vec4(n_out47p0, 0.0).y;
float n_out10p2 = vec4(n_out47p0, 0.0).z;
float n_out10p3 = vec4(n_out47p0, 0.0).w;

// FloatParameter:62
float n_out62p0 = FloatParameter2;

// Step:22
vec4 n_out22p0 = step(vec4(n_out10p1), vec4(n_out62p0));

// Mix:37
vec4 n_out37p0 = mix(n_out58p0, n_out59p0, n_out22p0);

// FloatParameter:63
float n_out63p0 = FloatParameter3;

// Step:18
vec4 n_out18p0 = step(vec4(n_out10p1), vec4(n_out63p0));

// Mix:29
vec4 n_out29p0 = mix(n_out57p0, n_out37p0, n_out18p0);

// FloatParameter:64
float n_out64p0 = FloatParameter4;

// Step:52
vec4 n_out52p0 = step(vec4(n_out10p1), vec4(n_out64p0));

// Mix:50
vec4 n_out50p0 = mix(n_out60p0, n_out29p0, n_out52p0);

// ColorParameter:56
vec4 n_out56p0 = swhite;

// FloatParameter:65
float n_out65p0 = fillrate;

// Step:30
vec4 n_out30p0 = step(vec4(n_out10p1), vec4(n_out65p0));

// Mix:27
vec4 n_out27p0 = mix(n_out50p0, n_out56p0, n_out30p0);

// Output:0
COLOR.rgb = vec3(n_out27p0.xyz);

}

Wundt answered 1/12, 2023 at 8:40 Comment(0)
D
0

Wundt It's very hard to debug generated shader code. Save your visual shader resource as tres file and attach the file to a post.

Digitigrade answered 1/12, 2023 at 9:8 Comment(0)
W
0

Digitigrade
tried uploading the file there is no option to upload this extension nor I'm able to upload the file by changing the extension

Wundt answered 2/12, 2023 at 5:17 Comment(0)
D
0

Wundt zip the file

Digitigrade answered 2/12, 2023 at 5:28 Comment(0)
W
0

Digitigrade

texture-progress-bar1tres.zip
3kB
Wundt answered 2/12, 2023 at 7:9 Comment(0)
D
0

Wundt No errors in 4.1.2 or 4.2 beta4. Try to import this shader into a clean project and see what happens.

Digitigrade answered 2/12, 2023 at 14:49 Comment(0)
D
0

Wundt Btw if this is implementation of the bottle shader I suggested in your previous thread, it's not working as it should as lines are not kept horizontal. You probably missed something. Here's the proper implementation of the shader:

shader_type canvas_item;
varying mat4 shearMatrix;

void vertex(){
	float scaleRatio = length(MODEL_MATRIX[0]) / length(MODEL_MATRIX[1]);
	float imageRatio = TEXTURE_PIXEL_SIZE.y / TEXTURE_PIXEL_SIZE.x;
	float shearAngle = atan(MODEL_MATRIX[0].y * scaleRatio * imageRatio, MODEL_MATRIX[0].x );
	shearMatrix = mat4(
		vec4(1.0, sin(shearAngle), 0.0, 0.0), 
		vec4(0.0, cos(shearAngle), 0.0, 0.0), 
		vec4(0.0, 0.0, 1.0, 0.0), 
		vec4(0.0, 0.5, 0.0, 0.0)
	);
}
void fragment(){
	vec2 uv = UV - vec2(.5);
	float v = (shearMatrix * vec4(uv, 0.0, 1.0)).y;
	COLOR.rgb = mix(vec3(0.0), vec3(1.0), step(.5,v));
}

And attached below is the visual version without expressions:

bottle.zip
2kB
Digitigrade answered 2/12, 2023 at 15:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.