Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualnewObjekt

Posted 12 April 2013 - 09:33 PM

So I've gotten some pretty good results by making changes to how normals and stuff are calculated.

http://inferno.codebrainshideout.net/Images/specular%20n%20stuff.png

Does this look alright to you guys?

 

I also would really like to make the specular light change based on the angle the player is looking at things from.

I was thinking

 

vec3 vertexNormal;

vec3 lightDirection;

vec3 cameraDirection;

 

vec3 a = reflect(lightDirection, vertexNormal);

float shininess = pow(max(dot(a, cameraDirection), 2);

 

But I don't know how to get the camera direction and I don't know if the GLSL reflect works like that.


#1newObjekt

Posted 12 April 2013 - 09:30 PM

So I've gotten some pretty good results by making changes to how normals and stuff are calculated.

http://inferno.codebrainshideout.net/Images/specular%20n%20stuff.png

Does this look alright to you guys?

 

I also would really like to make the specular light change based on the angle the player is looking at things from.

I was thinking

 

vec3 vertexNormal;

vec3 lightDirection;

vec3 cameraDirection;

 

vec3 a = reflect(lightDirection, vertexNormal);

float shininess = pow(max(dot(a, cameraDirection), 2);

 

But I don't know how to get the looking direction of the viewport and I don't know if the GLSL reflect works like that.


PARTNERS