tags:

views:

219

answers:

2

Hello, i don't make out the difference between raytracing and shading technique like Phong or Gouraud.

For 3D modeling do one have to choose between those algorithms or they can be implemented both in the same algorithm.

Thank you.

+1  A: 

Phong is more like a surface property, they describe how light is scattered. See http://en.wikipedia.org/wiki/Brdf

Ray Tracing is an algorithm that simulates the process of light scattering. See http://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29

You can use Phong-BRDFs in a realistic ray tracer to describe surfaces, and there also exists an approximation that is usable in rasterization.

phresnel
I'm coding a raytracer, do i need to use a shading algorithm like Phong or Gouraud ?
nax
In the beginning, you don't need to. It is easiest to support just diffuse surfaces, for which you just trace a shadow ray, and specular (aka perfect mirror) surfaces, for which you'll recurse.I recommend http://www.devmaster.net/articles/raytracing_series/part1.php by Jacco Bikker. If you have more questions, there is also a forum dedicated to ray tracing, http://ompf.org/forum .
phresnel
+1  A: 

Technically ray tracing really only determines visibility and distance. Recursively it can be used for reflections, refractions, and shadows (checking light source visibility).

Stochastic ray tracing or photon mapping can simulate light scattering.

Phong and Gouraud shading are reflection models applied to at a surface.

It is common for people starting out in ray tracing to use a Phong or Gouraud lighting model. You can use those lighting models with any rendering system (scan conversion for example).

phkahler
Ok so i can use a shading algorithm like the Phong one in my raytracer ?
nax
Yes, but see the other posts and replies, basics first ;)
phresnel
Agreed. Solid color first (no shading) just verify you can render something, then diffuse, then Phong, then something better.
phkahler