Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | rat_vv |
Hi there. I wrote a shader for my game. It works great on pc, but when i export the project to Android it stops working.
Here is my code:
shader_type canvas_item;
float rand(vec2 co) {
return fract(sin(mod(dot(co, vec2(12.9898, 78.233)), 3.14)) * 43758.5453);
}
float rand_range(vec2 co, float _min, float _max){
return rand(co) * (_max - _min) + _min;
}
void fragment() {
vec2 pos = FRAGCOORD.xy / 2.;
float v = step(0.995, rand(floor(pos)));
float koef = sin((TIME + pos.x + pos.y) * rand_range(pos, 0, 5.)) / 2. + 0.5;
vec3 starcolor = vec3(v, v, v*rand_range(pos, 0.7, 0.9)) * koef;
vec3 bgcolor = vec3(vec3(0.));
vec3 color = starcolor + bgcolor;
COLOR = vec4(color, 1);
}
adb doesn’t show eny errors.
Using godot 3.4.4, opengl 2