Does my Blinn shading look right?

Started by
2 comments, last by BadEggGames 8 years, 7 months ago

Hi all,

I am trying to implement simple blinn specularity but am not sure what the end result is supposed to look like.

My balls don't look shiny :P

(Just diffuse)

sphere_1440827736819.png

(Specularity)

sphere_1440827942841.png

Is that how its supposed to look before adding reflection?

Advertisement

//specular
float attenuate = (light1.intensity / (distanceFromLight*5));
Ray halfRay = new Ray(inter, ((normLight.cpy().add((viewRay.direction.cpy()).scl(0.5f)))));
specular = 0.9f * (float)(Math.pow(Math.max(0,(surfNorm.cpy().dot(halfRay.direction))),2));
specular = specular * attenuate;
That hard-coded 2 is your SpecPower value. It has a range of 0 (lambertian) to infinity (mirror).

Set it to something like 200 and your balls will look shinier.

Wow, thanks Hodgman.

Instantly better :)

This topic is closed to new replies.

Advertisement