Jump to content
• ### What is your GameDev Story?

• Advertisement

# promblem in static raytracing

This topic is 4206 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## 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

#### Share this post

##### Share on other sites
Advertisement
Quote:
 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 computed
N = 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.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement
• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• ### Popular Now

• 31
• 16
• 11
• 10
• 11
• Advertisement
• ### Forum Statistics

• Total Topics
634113
• Total Posts
3015592
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!