Jump to content
  • Advertisement
Sign in to follow this  
BadEggGames

Does my Blinn shading look right?

This topic is 1144 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!