Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业7判断直接光照是否被其他物体遮挡的疑问 Reply To: 作业7判断直接光照是否被其他物体遮挡的疑问

#6469 Score: 1
oxine
Participant
9 pts

说的没错,我是这样的
if ((insec_light.distance - Scene::intersect(Ray(hitPoint, ws)).distance)<EPSILON) {// if not blocked
能得到正确的结果,注意insec_light.distance需要手动赋值
insec_light.distance = (insec_light.coords - hitPoint).norm();

This post has received 1 vote up.