Ignore:
Timestamp:
Dec 18, 2012, 3:29:18 PM (7 years ago)
Author:
touky
Message:

"Point light" Tweak

Location:
trunk/src/easymesh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/easymesh/easymesh.cpp

    r2143 r2144  
    119119    m_gpu.shader->Bind();
    120120    m_gpu.shader->SetUniform(m_gpu.modelview, modelview);
    121     m_gpu.shader->SetUniform(m_gpu.model, model);
     121    m_gpu.shader->SetUniform(m_gpu.model, Scene::GetDefault()->GetViewMatrix());
    122122    m_gpu.shader->SetUniform(m_gpu.proj, Scene::GetDefault()->GetProjMatrix());
    123123    m_gpu.shader->SetUniform(m_gpu.normalmat, normalmat);
  • trunk/src/easymesh/shiny.lolfx

    r2143 r2144  
    3838
    3939uniform float in_Damage;
     40uniform mat4 in_Model;
    4041
    4142varying vec4 pass_Eye;
     
    4647// FIXME: the light direction should be passed in the code
    4748vec3 in_LightDir = vec3(0.3, 0.3, 0.7);
    48 vec3 in_Light2_Pos = vec3(0.0, 100.0, 0.0);
     49vec4 in_Light2_Pos = in_Model * vec4(0.0, 0.0, 0.0, 1.0);
    4950
    5051void main(void)
     
    8283
    8384        //Light calculation for point light
    84     s = normalize(pass_TPos.xyz - in_Light2_Pos);
     85    s = normalize(pass_Eye.xyz - in_Light2_Pos.xyz); //(pass_TPos.xyz - in_Light2_Pos);
    8586    v = normalize(-pass_Eye.xyz);
    8687    r = reflect(-s, pass_TNormal);
Note: See TracChangeset for help on using the changeset viewer.