[gd_resource type="CanvasItemMaterial" load_steps=3 format=1]

[ext_resource path="res://faceNormal.png" type="Texture" id=1]

[sub_resource type="CanvasItemShader" id=1]

_code = { "fragment":"uniform texture normaltex;\nvec4 ntex = tex(normaltex,UV);\nntex.rgb = ntex.rgb * vec3(-2,-2,1) - vec3(-1,-1,0);\nvec2 tile_vec=vec2(47,22);\nfloat r = asin(tile_vec.y / tile_vec.x);\nmat3 rot_mat = mat3( vec3(1,0,0), vec3(0,cos(r),-sin(r)), vec3(0,sin(r),cos(r)));\nNORMAL =  rot_mat * ntex.rgb;\n\n\n\n\n", "fragment_ofs":0, "light":"LIGHT_VEC.y=40; //from light towards up, where is the torch\?\nvec3 light_normal = normalize(vec3(LIGHT_VEC,-LIGHT_HEIGHT));\nLIGHT=LIGHT_COLOR*COLOR*max(dot(-light_normal,NORMAL),0.0);\n\n", "light_ofs":0, "vertex":"", "vertex_ofs":0 }

[resource]

shader/shader = SubResource( 1 )
shader/shading_mode = 0
shader_param/normaltex = ExtResource( 1 )

