Recommended Posts

Hi,everyone
got problem in my raytracing practice.
If anyone has the same problem like me.
I used a trianglized scene and Phone shading algorithm.
part of the rendering is ok,but other part have granule effect.
anyone who has experience in raytracing can give me some advice.
thanks.
by the way,how can i post a picture here

0

Share this post

Link to post

Share on other sites

Original post by schopenkittoHi,everyonegot problem in my raytracing practice.If anyone has the same problem like me.I used a trianglized scene and Phone shading algorithm.part of the rendering is ok,but other part have granule effect.anyone who has experience in raytracing can give me some advice.thanks.

by the way,how can i post a picture here

Hi, you will need to better describe your problem in order to get useful answers... use html tag <IMG> to include a picture stored somewhere on the net...

Anyway, if I have to guess I would say the source of the artifacts may be some precision error... Once you get the first intersection of the eye ray with the geometry you need to calculate the shadow/reflection/refraction rays. If you use the intersection point as the origin of these rays, chances are that the first intersection found will be the same polygon the ray was shot from. Be sure to add an offset in the direction of the normal of the surface:

R = intersection point of a ray with a surface.S = shadow ray to be computedN = normal at the intersection point

then S.origin = R + N * bias

Bias will be very small, try to find a good value (something like 0.001 should work, but I don't remember what I used).Be sure to always take into account floating point precision errors, for example never compare to numbers directly, but compare a number to a small range instead.