Changeset 1330


Ignore:
Timestamp:
May 1, 2012, 11:19:55 PM (9 years ago)
Author:
sam
Message:

orbital: get rid of the normal matrix; we can compute it on the fly later.

Location:
trunk/orbital
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/mesh.h

    r1327 r1330  
    224224    }
    225225
    226     void Render(mat4 const &modelview, mat4 const &proj, mat3 const &normalmat)
    227     {
     226    void Render(mat4 const &modelview, mat4 const &proj)
     227    {
     228        mat3 normalmat = transpose(inverse(mat3(modelview)));
     229
    228230        m_gpu.shader->Bind();
    229231        m_gpu.shader->SetUniform(m_gpu.modelview, modelview);
  • trunk/orbital/orbital.cpp

    r1322 r1330  
    151151    m_modelview = m_camera->GetViewMatrix() * model * anim;
    152152    m_proj = m_camera->GetProjMatrix();
    153     m_normalmat = transpose(inverse(mat3(m_modelview)));
    154153}
    155154
     
    168167    Video::SetClearColor(vec4(0.0f, 0.0f, 0.0f, 1.0f));
    169168
    170     m.Render(m_modelview, m_proj, m_normalmat);
     169    m.Render(m_modelview, m_proj);
    171170}
    172171
  • trunk/orbital/orbital.h

    r1312 r1330  
    3030
    3131    mat4 m_modelview, m_proj;
    32     mat3 m_normalmat;
    3332
    3433    ParticleSystem *m_particlesystem;
  • trunk/orbital/particlesystem.h

    r1326 r1330  
    7070                       * mat4::translate(m_particles[i].m1);
    7171            mat4 modelview = view * model * anim;
    72             mat3 normalmat = transpose(inverse(mat3(modelview)));
    7372
    74             m_mesh.Render(modelview, proj, normalmat);
     73            m_mesh.Render(modelview, proj);
    7574        }
    7675    }
Note: See TracChangeset for help on using the changeset viewer.