shader changes that don't do anything
This commit is contained in:
10
assets/materials/walls/test.tres
Normal file
10
assets/materials/walls/test.tres
Normal file
@@ -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)
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user