Files
puzzle-quest/assets/props/dagger/materials/MA_dagger.material
T

33 lines
1.7 KiB
Plaintext
Raw Normal View History

RSRCShaderMaterialÿÿÿÿÿÿÿÿresource_local_to_sceneresource_namecodescriptrender_priority
next_passshadershader_parameter/albedo shader_parameter/texture_albedo shader_parameter/texture_normal shader_parameter/emission_color!shader_parameter/emission_amount"shader_parameter/dissolve_textureshader_parameter/burn_size!shader_parameter/dissolve_amount
local://1V7res://assets/props/dagger/materials/MA_dagger.material!Shader¨shader_type spatial;
render_mode depth_draw_always, cull_disabled;
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color;
uniform sampler2D texture_normal : hint_normal;
uniform vec4 emission_color : source_color = vec4(1);
uniform float emission_amount;
uniform sampler2D dissolve_texture;
uniform float burn_size : hint_range(0,2);
uniform float dissolve_amount : hint_range(0,1);
void fragment() {
vec4 albedo_tex = texture(texture_albedo,UV);
ALBEDO = albedo.rgb * albedo_tex.rgb;
float sample = texture(dissolve_texture, UV).r;
float emission_value = 1.0 - smoothstep(dissolve_amount, dissolve_amount + burn_size, sample);
EMISSION = vec3(emission_value * emission_amount * emission_color.rgb);
ALPHA = smoothstep(dissolve_amount - burn_size, dissolve_amount, sample);
METALLIC = 0.0;
ROUGHNESS = 0.8;
vec4 normal_tex = texture(texture_normal, UV);
NORMAL_MAP = normal_tex.xyz;
}ShaderMaterial