Detail maiden interior with matching PBR metals and progressive incandescence

This commit is contained in:
JariKo
2026-10-28 23:43:56 +02:00
parent fcd67109d4
commit b9a4e40c42
13 changed files with 218 additions and 12 deletions
+36 -6
View File
@@ -1,10 +1,40 @@
shader_type spatial;
render_mode blend_add, depth_draw_never, unshaded, shadows_disabled;
render_mode cull_disabled;
uniform float heat=0.0;
uniform float base_height=0.0;
uniform vec4 base_color:source_color=vec4(1.0);
uniform sampler2D color_map:source_color,hint_default_white,filter_linear_mipmap_anisotropic;
uniform sampler2D metal_map:hint_default_white,filter_linear_mipmap_anisotropic;
uniform sampler2D rough_map:hint_default_white,filter_linear_mipmap_anisotropic;
uniform sampler2D normal_map:hint_normal,filter_linear_mipmap_anisotropic;
uniform float metal_value=1.0;
uniform float rough_value=1.0;
uniform float normal_strength=1.0;
uniform bool use_normal=false;
uniform int metal_channel=2;
uniform int rough_channel=1;
uniform vec2 uv_scale=vec2(1.0);
uniform vec2 uv_offset=vec2(0.0);
uniform bool tile_region=false;
uniform vec2 atlas_origin=vec2(0.0);
uniform vec2 atlas_size=vec2(1.0);
varying float model_height;
void vertex(){ model_height=VERTEX.y; }
void fragment(){
float warmth=heat*(.35+.65*(1.0-smoothstep(0.0,2.8,model_height)));
ALBEDO=vec3(1.0,.07,.003)*warmth*warmth*.22;
ALPHA=heat*.45;
void vertex(){ model_height=(MODEL_MATRIX*vec4(VERTEX,1.0)).y-base_height; }
float channel_value(vec4 color,int channel){
if(channel==4){return dot(color.rgb,vec3(.333333));}
return color[channel];
}
void fragment(){
vec2 uv=UV*uv_scale+uv_offset;
if(tile_region){uv=atlas_origin+fract(uv*vec2(4.0,7.0))*atlas_size;}
vec3 original=base_color.rgb*texture(color_map,uv).rgb;
float warmth=clamp(heat*1.10-smoothstep(.2,3.1,model_height)*.08,0.0,1.0)*smoothstep(.18,.35,model_height);
vec3 hot=mix(vec3(.75,.002,.001),vec3(1.0,.10,.003),smoothstep(.25,.80,warmth));
hot=mix(hot,vec3(1.0,.44,.045),smoothstep(.82,1.0,warmth)*.65);
ALBEDO=mix(original,hot*.35,smoothstep(.35,1.0,warmth)*.45);
METALLIC=metal_value*channel_value(texture(metal_map,uv),metal_channel);
ROUGHNESS=clamp(rough_value*channel_value(texture(rough_map,uv),rough_channel),.1,1.0);
if(use_normal){NORMAL_MAP=texture(normal_map,uv).rgb;NORMAL_MAP_DEPTH=normal_strength;}
float texture_relief=.45+.55*clamp(dot(original,vec3(.333333))*3.5,0.0,1.0);
EMISSION=hot*pow(warmth,1.8)*1.4*texture_relief;
}