Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualBrother Bob

Posted 22 July 2013 - 12:27 PM

You could also move these to the vertex shader so they are only being calculated once for every vertex instead of once every fragment.  For low poly models which take up a lot of screen space this should be much more efficient. 
//---------------------------------------------------------------------------------------------
  vec3 toPointLight = vec3(u_LightPos[i]);
float distance = length(toPointLight - v_Position);
vec3 lightVector = toPointLight - v_Position;
float diffuseDiff = 0.0; // The diffuse difference contributed from current light


#3marcClintDion

Posted 22 July 2013 - 03:30 AM

There is far too much arrogance and out right abuse by site moderators, they are teaching other people to behave this way.  The posts I've made will all be shorty removed and replaced with this notice.  Game development is not the only thing being taught here, bad behavior is being taught as well.


#2marcClintDion

Posted 11 June 2013 - 02:36 PM

You could also move these to the vertex shader so they are only being calculated once for every vertex instead of once every fragment.  For low poly models which take up a lot of screen space this should be much more efficient. 
//---------------------------------------------------------------------------------------------
    vec3 toPointLight = vec3(u_LightPos[i]);
    float distance = length(toPointLight - v_Position);
    vec3 lightVector = toPointLight - v_Position;
    float diffuseDiff = 0.0; // The diffuse difference contributed from current light


#1marcClintDion

Posted 11 June 2013 - 06:56 AM

You could also move these to the vertex shader so they are only being calculate once for every vertex instead of once every fragment.  For low poly models which take up a lot of screen space this should be much more efficient. 
//---------------------------------------------------------------------------------------------
    vec3 toPointLight = vec3(u_LightPos[i]);
    float distance = length(toPointLight - v_Position);
    vec3 lightVector = toPointLight - v_Position;
    float diffuseDiff = 0.0; // The diffuse difference contributed from current light


PARTNERS