   Ray Tracer help (shiny reflective surfaces gone wrong...)
  I'm working on a ray tracer for my graphics project and I'm having an issue getting my surfaces to actually be shiny, like a shiny marble or even like a reflective metallic type object like I've seen in images online. Here is what my ray tracer is churning out when I try to make a reflective/shiny surface.I get this cloudy type looking object, the reflective coefficient is low here, even if I turn it up to 1 (fully reflective) it just looks like some flat circle reflecting the stuff around it for the most part.  For figuring out the color on a reflected object I do reflCoefficient*reflectedRayTraceColor + (1-reflCoefficient)*reflectiveObjectColor.  I'm using phong shading to get the colors as well, I've been looking at this for a while and is the first bug I've come across on this that I couldn't hammer out...   
  How are you calculating phong?The reflections look fine, but it's just missing the specular component.   ;  Ir = ArKaDr + AttLr [KdDr(N dot L) + KsSr(R dot V)^n] Ig = AgKaDg + AttLg [KdDg(N dot L) + KsSg(R dot V)^n] Ib = AbKaDb + AttLb [KdDb(N dot L) + KsSb(R dot V)^n]This is what I'm using, minus the Att (attenuation) coefficient. in the image here the ks is .4 and the specular color is like rgb = .9,.9,.9 and n=1. I'm not sure if somehow the R.V is coming out weird though.   ;  Hi,Try making n > 1. Something like n = 22 will look alright.T   ;  yea I've set various n's as well though, ,ranging from lower like around 20 to 20000, nothing really seems to affect it much however, it's pretty sad face at the moment : /   ;  Are you accumulating colors as you go along, like start with 0, add the reflected color, add the diffuse, add the specular...Does just diffuse work (N dot L)? Should be light at the top and go to black at the bottom.Are your ambient value small enough, like 0.1?I'd try it by commenting bits out. Like just do diffuse, then just do specular, the put reflections back in, see which part it fails on.   ;  I thought I tried a bit of this but I'll do it again just to check...and I have ambient turned up quite a bit actually, so I'll try some.   ;  Reflections seem ok, would you mind posting the relevant code?   ;  sure, i didn't notice if there were code brackets here so if there are let me know and i'll update my post...here is the phong lighting compution function.double * Light::getPhongColor(Vect3D &view, Vect3D &refl, Vect3D &sNorm, Vect3D &lVec, MaterialObject& mo){double * dif = mo.color;double ka = mo.kAmb,kd = mo.kDif,ks = mo.kSpec; double Ir = amb[0]*ka + 1*light[0]*(kd*dif[0]*sNorm.dotWith(lVec) + ks*spec[0]*pow(refl.dotWith(view),mo.n));double Ig = amb[1]*ka + 1*light[1]*(kd*dif[1]*sNorm.dotWith(lVec) + ks*spec[1]*pow(refl.dotWith(view),mo.n));double Ib = amb[2]*ka+ 1*light[2]*(kd*dif[2]*sNorm.dotWith(lVec) + ks*spec[2]*pow(refl.dotWith(view),mo.n)); double * color = new double[4];color[0] = Ir*I;color[1] = Ig*I;color[2] = Ib*I;color[3] = 0;return color;}I'm not sure what else is needed to be seen, the I at the end is just the light's intensity and is just 1 at the moment. And yes I know about some memory leaks I may be having here but I'm not worried about them atm... If you want to see anything else that you think might be awry let me know. I've tweaked some things but nothing great has seemed to happen.   ;  I see a tiny bright spot at the ceiling of your cornell box, and an even tinier one on top of the sphere that might be just an image compression artifact, but to me it looks like it could be the specular?what about moving the light around? it looks like it is right on top of the sphere...it will be hard to see the specular even if it works correctly...   