Domanda

Please help me clear up this question I have about the volume ray casting algorithm:

In the wikipedia article (link), it says that "For each sampling point, a gradient of illumination values is computed. These represent the orientation of local surfaces within the volume."

My question is: Why a gradient of illumination values? Why not opacity values? Surely the transition from "stuff" to "no stuff" is more accurately described by changes in opacity.

Consider, for instance, two voxels: [1][2]. 1 is bright and transparent, and 2 is dark and opaque. In my mind this corresponds to a surface facing left. Am I missing something?

È stato utile?

Soluzione

The gradient vector points along the direction of greatest increase. In this case, that means it points in the direction in which illumination increases most rapidly, and so in your [1][2] example the gradient at 2 indeed points left.

Conversely, if you took the gradient of the opacity you'd get a vector pointing towards the direction of increasing opacity, ie "inwards". You could take the negation of that to get a vector pointing outwards, but there's still the problem that opacity is local. It tells you only about the structure of the object in the immediate surroundings. When you're shading something, what you want to know is how well-lit a surface is as you travel from point-to-point. Knowing the surfaces of constant illumination allows you to deduce that, but from a surface of constant opacity you could only deduce how well-lit it'd be if there were nothing between the surface and the light source.

Altri suggerimenti

gradient is the normal vector to iso-surface, you may consider volumetric object as a stack of iso-surfaces (a lot of them ;o), each iso-surface has identical scalar field value upon its surface; Transfer Function sets correspondence of opacity/Red/Green/Blue and scalar values so each iso-surface has an assigned transparency and color. Such representation makes simple to understand the role of volumetric gradient for volume rendering...

In classical ray tracing, you calculate a ray from your eye through a pixel on a screen in front of you and out into the world to see what it hits. Once you determine the intersection point, you need to determine the lighting characteristics at that point. The lighting characteristics depend on the surface normal. When you think about it, the surface normal is a property that's determined not just by the intersection point itself but by the the surrounding surface.

This same principle applies to ray casting. Once you determine that the ray does hit some voxel, you need to analyze surrounding voxels to effectively calculate a "surface normal" that you can use for the lighting calculations.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top