added wall

This commit is contained in:
Piotrek
2021-04-24 22:24:10 +02:00
parent d194337520
commit e390b6ed9b
5 changed files with 24 additions and 31 deletions
Binary file not shown.
+1 -1
View File
@@ -34,7 +34,7 @@ HitResult castBricks(vec3 origin, vec3 start, vec3 dir, vec3 incAxis, uint addr)
// Normal vector (negate previous increment axis and mult by sign)
vec3 normal = -incAxis * raySign;
return HitResult(brick-1, hitPoint, normal);
return HitResult(brick, hitPoint, normal);
}
// Get new closest axis to increment
+1 -1
View File
@@ -13,6 +13,6 @@ vec3 applyLighting(vec3 hitPoint, vec3 view, vec3 normal, uint brick)
vec3 specular = light_color * pow(max(dot(view, reflect(-_SunDir, normal)), 0.0), 32);
// Combine colors
vec3 object_color = _Materials[brick].albedo.rgb;//vec3(0.0, 0.1, 0.5);
vec3 object_color = _Materials[brick-1].albedo.rgb;//vec3(0.0, 0.1, 0.5);
return (ambient + diffuse + specular) * object_color;
}