Start light ray a bit off the surface
This commit is contained in:
parent
258530bef1
commit
ecb01c7374
1 changed files with 1 additions and 1 deletions
|
@ -103,7 +103,7 @@ fun main() {
|
||||||
if (hit != null) {
|
if (hit != null) {
|
||||||
var color = hit.color * ambient
|
var color = hit.color * ambient
|
||||||
|
|
||||||
val rayToLight = hit.point.rayTo(light.point)
|
val rayToLight = (hit.point + 0.0001f * hit.normal).rayTo(light.point)
|
||||||
if (scene.intersects(rayToLight) == null) {
|
if (scene.intersects(rayToLight) == null) {
|
||||||
|
|
||||||
val lambert = max(0f, dot(hit.normal, rayToLight.direction))
|
val lambert = max(0f, dot(hit.normal, rayToLight.direction))
|
||||||
|
|
Loading…
Add table
Reference in a new issue