shader_type spatial; uniform vec4 emission_color: source_color; uniform sampler2D normal_map: hint_normal; uniform sampler2D normal_roughness: hint_normal; uniform sampler2D emission_map; float fresnel(float amount, vec3 normal, vec3 view) { return pow((1.0 - clamp(dot(normalize(normal), normalize(view)), 0.0, 1.0 )), amount); } void vertex() { // Called for every vertex the material is visible on. } void fragment() { ALBEDO = vec3(.1); ROUGHNESS = texture(normal_roughness, UV).z * 1.2; NORMAL_MAP = texture(normal_map, UV).xyz + vec3(texture(normal_roughness, UV).xy, 0.5) - 0.5; float fresnel = 1.0-fresnel(0.3, NORMAL, VIEW); EMISSION = texture(emission_map, UV).xyz * fresnel * 2.0 * emission_color.xyz; //EMISSION = vec3(fresnel); } //void light() { // // Called for every pixel for every light affecting the material. // // Uncomment to replace the default light processing function with this one. //}