forked from AsherGlick/Burrito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Route.tres
51 lines (40 loc) · 1.41 KB
/
Route.tres
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
[gd_resource type="ShaderMaterial" load_steps=3 format=2]
[ext_resource path="res://icon.png" type="Texture" id=1]
[sub_resource type="Shader" id=1]
code = "shader_type spatial;
//render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
render_mode unshaded, blend_mix, depth_draw_opaque, cull_disabled, diffuse_burley, specular_schlick_ggx;
uniform sampler2D texture_albedo : hint_albedo; // TODO: Make instance uniform sampler2D when 4.0 is released
uniform vec2 map_size;
uniform bool map_flipped;
uniform float map_bottom_offset = 36.0;
uniform float interval = 1.0;
void vertex() {}
void fragment() {
if (SCREEN_UV.x * VIEWPORT_SIZE.x > VIEWPORT_SIZE.x - map_size.x) {
if (map_flipped && SCREEN_UV.y * VIEWPORT_SIZE.y > VIEWPORT_SIZE.y - map_size.y) {
return;
}
if (!map_flipped && SCREEN_UV.y * VIEWPORT_SIZE.y < map_size.y + map_bottom_offset) {
return;
}
}
vec2 base_uv = vec2(UV.y, -UV.x * interval);
base_uv = vec2(UV.x, -UV.y);
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo_tex.rgb;
ALPHA = albedo_tex.a;
//EMISSION = albedo_tex.rgb;
//METALLIC = 0.0;
//ROUGHNESS = 1.0;
//SPECULAR = 0.0;
}
"
[resource]
resource_local_to_scene = true
shader = SubResource( 1 )
shader_param/map_size = Vector2( 0, 0 )
shader_param/map_flipped = null
shader_param/map_bottom_offset = 36.0
shader_param/interval = 1.0
shader_param/texture_albedo = ExtResource( 1 )