From f2a39316ba6b189fbd59e7d858b62e902b6f23db Mon Sep 17 00:00:00 2001 From: Minimata Date: Wed, 7 Jan 2026 17:11:49 +0100 Subject: [PATCH] shader changes that don't do anything --- assets/materials/walls/test.tres | 10 ++++++++++ assets/materials/walls/walls.gdshader | 11 +++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 assets/materials/walls/test.tres diff --git a/assets/materials/walls/test.tres b/assets/materials/walls/test.tres new file mode 100644 index 00000000..be0e16d0 --- /dev/null +++ b/assets/materials/walls/test.tres @@ -0,0 +1,10 @@ +[gd_resource type="VisualShader" format=3 uid="uid://ce18qeqecjf4w"] + +[resource] +code = "shader_type spatial; +render_mode blend_mix, depth_draw_opaque, depth_test_default, cull_back, diffuse_lambert, specular_schlick_ggx; + + + +" +nodes/fragment/0/position = Vector2(280, 0) diff --git a/assets/materials/walls/walls.gdshader b/assets/materials/walls/walls.gdshader index c91b323b..5d85468d 100644 --- a/assets/materials/walls/walls.gdshader +++ b/assets/materials/walls/walls.gdshader @@ -28,6 +28,7 @@ uniform float heightScale = 1.0; varying vec3 worldPos; varying vec3 worldNormal; +varying vec3 diffuse; void vertex() { @@ -177,12 +178,14 @@ void fragment() { // sample and output SPECULAR = specular; ALBEDO = triplanarSample(texCoordX, texCoordY, texCoordZ, blend, yDot).rgb; + diffuse = ALBEDO; ROUGHNESS = triplanarRoughness(texCoordX, texCoordY, texCoordZ, blend, yDot).r; NORMAL = mix(worldNormal, triplanarNormal(yDot, texCoordX, texCoordY, texCoordZ, blend), normalMapStrength); NORMAL = normalize((VIEW_MATRIX * vec4(NORMAL, 0.0)).xyz); } -//void light() { -// // Called for every pixel for every light affecting the material. -// // Uncomment to replace the default light processing function with this one. -//} +void light() { + float lambert = dot(NORMAL, LIGHT); + float halfLambert = pow(lambert*0.5 + 0.5, 2); + DIFFUSE_LIGHT = halfLambert * ATTENUATION * LIGHT_COLOR / PI; +}