Problem with Raytraced Shadows

I have a problem with shadowrays in my raytracer.

Please take a look at the following two photos.

3D sMax:

alt text http://neo.cycovery.com/shadow_problem.gif

My Raytracer:

alt text http://neo.cycovery.com/shadow_problem2.jpg

The scene is lit by a bright light shining from the back. It is so bright that there is no gradient in the shading, just white or dark (due to overexposure).

both images were rendered using 3DStudioMax, and both use the same geometry, only in one case the normals are interpolated by triangles.

Now consider the red dot on the surface. In the case of the unexpanded version, it is in a dark area. this means that the light source is not visible from this triangle, since it is facing away from it. However, in the smoothed version, it is in the illuminated area because the interpolated normal assumes that the light will be visible at that point (although the actual geometry of the triangle is facing away from the light source).

Now my problem is when bright shadows appear. If a shadow is taken from the red dot in the scene to check if the light source is visible or not (to determine shading), shadowray will return the intersection, whether normals are interpolated or not (since the intersections depend only on the geometry). Therefore, the pixel will be darkened.

3dsamx - Raytraced. , Raytracer , raytraced ( raytracer, , raytraced , ), , .

, - .

!

+3
5

"" , , . . Tessellation ...
( "3DStudio" ), , , . "". . !

+3

, . , / .

, , ;-) . , , .

, shadowray , , : ) ) , .

0

: , . , .

, , - , , . .

, , " ", , , , .

, , , , , ( ), , .

0

Mat, , , , , ( , ). : "", , , . , .

, BVH, "", , , , , .

0

.

.. shadowRay.dir = shadowRay.dir * 0.0001

, , // .

, , ?

0

Source: https://habr.com/ru/post/1725203/


All Articles