Sign in to follow this  
Cornflake420

Questions: Raytracing, shading, and colors

Recommended Posts

Cornflake420    138
A few questions: 1) What is the difference between all of those hue-color models, ex: HSL, HSB, HSV, etc? 2) What are some good internet resources for calculating raytracing effects such as: a] Caustics b] Global illumination 3) What is generally considered the "best" specular shading algorithm (more realistic than Phong)? 4) Given an arbitrary equation that specifies points on a surface, how can a raytracer plug in the ray equation, check for a collision, and calculate the distance? [Edited by - Cornflake420 on December 3, 2005 9:19:06 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I think the difference between those color models are the parameters. I'm not sure if the color-spaces are different.

Share this post


Link to post
Share on other sites
timw    598
Quote:

1) What is the difference between all of those hue-color models, ex: HSL, HSB, HSV, etc?

look them up on wikipedia, they're many ways of describing the same thing. the main difference is there paramaters are often more intuitive to the human, while rgb is what the computer screen wants. some of the models interpolate better then others. but rgb works for most purposes, I haven't had an occasion to use any of em to be honest. I've heard they're usefull when you have highly compressed lo dynamic range stuff.

Quote:

4) Given an arbitrary equation that specifies points on a surface, how can a raytracer plug in the ray equation, check for a collision, and calculate the distance?

it depends on the surface, some surfaces can't be efficently ray traced. look up ray tracing implicit surfaces. usually the surface is triangulated.

Quote:

2) What are some good internet resources for calculating raytracing effects such as:
a] Caustics
b] Global illumination

haven't seen em, you're better off with books. there are tons of lecture notes out there, but they can't beat a good book imo. look up pat hanrahan's notes, Stephen Chenney, marschner. what kind of global illumination are you trying to learn?

Quote:

3) What is generally considered the "best" specular shading algorithm (more realistic than Phong)?


nothing is generally considered the "best" and new shading models are coming out all the time. google Shlick, Shirley/Michael, cook terrance, normalized phong.

Share this post


Link to post
Share on other sites
ApochPiQ    22999
1. Beats me; aside from what's already been said, I personally have no idea. I'm a lazy guy so I've always used RGB.

2. Books > *. For raytracing in particular, pick up Jensen's book Realistic Image Synthesis Using Photon Mapping; the basics of global illumination is covered fairly well, although it won't do you much good if you're not already familiar with the vernacular and mathematics behind illumination models.

Specifically, caustics are a phenomenon (light focused onto a surface by specular reflections; e.g. the little bright splotches on the bottom of a swimming pool, the little shiny spot you get when the sun bounces off your wristwatch, etc.). Global illumination is a family of techniques for lighting a scene that takes into account as many different indirect lighting phenomena as possible; whereas direct or local illumination considers only the light coming from light sources, global illumination includes light bouncing off of other objects, focused through dielectrics, spilling through translucent surfaces, and so on.

3. That depends on what you want to shade, and what you're willing to sacrifice to do it. I personally use Schlick and/or Torrance-Sparrow for most of my purposes, although my lighting model work was quite a while ago. As timw said, things have almost surely progressed since then, and new models are becoming available all the time.

4. Mathematically, you need to solve an intersection equation. This requires a little bit of footwork beforehand by a human. Essentially, you want to set up the equations so that you have a ray equation parameterized in t (for time). A ray is parameterized in t as origin + (direction * t). Then you find some t such that the ray at that point t is on your surface. If the distance vector is normalized, t will be your distance from the origin point to the surface.

Depending on the equations that describe the surface, this may be easy to do analytically (spheres, cones, and generally any of the conical surfaces, and many others) or it may not (implicit surfaces, surfaces of revolution, etc.). An analytical solution will give you essentially an equation that looks like t = foo; solve the foo side and you'll either get an impossible value (negative, infinite, etc.) or you'll get a t that describes the location where the ray hits the surface.

If a simple analytical setup isn't possible, you can fall back to iterative solutions. In this method, you slowly increase t by a tiny value, see if the point on the ray is on the surface, and then repeat. Usually, the surface will give you some way to detect if you "pass" it (e.g. the sign value of the equation will change, assuming the equation zeroes with t). In this case, you can use a binary search to find the precise point of intersection quite easily. It is common to use a bounding sphere or box on the surface, and use the ray's entry and exit points as seed values for the iterative search. If the search fails to converge, the ray missed the object.

If iterative solutions are too expensive or imprecise (common for implicit surfaces) you can simply tesselate the surface with polygons and perform trivial ray-triangle intersection tests instead.

Share this post


Link to post
Share on other sites
Cornflake420    138
I had to figure most of this out on my own, but I will share my findings.

1) HSL/HLS/HLI are synonyms. Their color space is a double cone. That means 0% intensity is always black and 100% intensity is always white.

HSV/HSB have a single cone color space. That means 0% value is always black, and 100% value is the selected hue and intensity.
Eg: HSL( 0, 1.0, 100% ) = white
HSV( 0, 1.0, 100% ) = red

I found that info on Wikipedia

3) I found one that I think looks very real: Beckmann.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this