   ray tracing color
  i have coded a ray tracer and got some nice resultshttp://img245.imageshack.us/img245/8103/tututu.pngbut look like when i tured all the effect off i got some problem with the colorhttp://img695.yfrog.com/img695/5722/777a.pngthe left side of the wall there is kind of wrong coloringthis is what iam usingfloat dot = Vector3.Dot(ray.Direction, normal);Vector3 reflect = Vector3.Reflect(ray.Direction, normal);float specular = (float)Math.Pow(Vector3.Dot(dir, reflect), 25);if (dot < 0)dot = 0;color += ((gameObject.Color * Lights.Color) * (0.8f * shade * dot))) + (Lights.Color * (specular * 0.0f * shade));shade is 1.0f (0.4f when shadow)colors are float values (0 = 0, 1.0f = 255)i have turred off the specular for the testis it normal result or i have done something wrong?
  what is color set to at the start?   ;  wall 245,222,179floor 240,255,255light white * 0.8fits converted to float at object creation   ;  Looks fine to me, within error margins of current displays.The reason that you get banding in the darker portions of the image is due to the gamma mapping done by displays (on a per-channel basis) that maps a linear RGB scale to a linear intensity scale:I_out = I_in ^ (1/gamma).Most displays have a gamma of 2-3, resulting in a non-linear transformation. This is why there is less detail in darker regions, and why RGB color is not really enough to encode all possible colors except on a perfect display.see here for more info:http://en.wikipedia.org/wiki/Gamma_correction   ;Quote:Original post by AresseraLooks fine to me, within error margins of current displays.The reason that you get banding in the darker portions of the image is due to the gamma mapping done by displays (on a per-channel basis) that maps a linear RGB scale to a linear intensity scale:I_out = I_in ^ (1/gamma).Most displays have a gamma of 2-3, resulting in a non-linear transformation. This is why there is less detail in darker regions, and why RGB color is not really enough to encode all possible colors except on a perfect display.see here for more info:http://en.wikipedia.org/wiki/Gamma_correctionthanks :]i will work on itedit:i tryed to use color = color ^ (1/2.2f).it didnt solve my problemif RGB is not enough what can i use instead?[Edited by - EvilMortal on May 9, 2010 6:04:55 AM]