Nope it's simply an algorithm, and at that it's not terribly dissimilar to rasterization...
Code:
// Raytracing
for all fragments
for all triangles
for all lights
// shade a fragment
Code:
// Rasterization
for all triangles
for all fragments
for all lights
// shade a fragment
To that ray tracing algorithm, most simple looks something like this:
Code:
for all fragments
{
for all triangles
{
collision = findCollision();
if(collision < nearestCollision)
{
nearestCollision = collision;
}
}
for all lights
{
shadePixel(nearestCollision);
}
}
So it's little simplier than you wrote (especially if you do highly complex shading within scene with very high depth complexity. Although finding collision between ray and triangle is very slow (so you need to limit it to as less as possible).
First one is optimising algorithm as much as is possible - so you use very cheap intersection test.
Second one is using SIMD for processing 2x2 ray packets at same time.
Third one (and most important) - you use some scene hierarchy, the fastest is SAH KD-tree for static and probably BIH for dynamic.
With correct use of these optimisations (most important is the third, first two doesn't make so big difference) you can render on two quad core CPUs ~half milion triangles interactively with correct shadows (even non-correct soft shadows, correct soft shadows are possible too using area lights, but not interactively for so complex scenes), reflections and refractions.
So in final algorithms look like this (of course there are several more solutions on KD tree traversal, and of course traversal isn't as important as KD tree build ... difference between SAH KD tree and another kind of KD tree ... SAH can be even 2 times faster)
Code:
// KD tree traversal pseudo-code
for all fragments
{
bool hitLeftRight;
int i = 0;
while(node[i].hasChildren)
{
i = FindIntersection of ray with left or right child; // lets say it returns childs index
}
for all triangles in node[i]
{
for all lights
{
shadePixel;
}
}
}
Main problem of course is, that there is no hardware acceleration.
Anyway difference between rasterization and raytracing is in one more thing. Rasterizing triangle is just bunch of projection equations, but for ray tracing it's finding ray-triangle collisions (and it's not as simple as projection equation).