Changeset 2289 for trunk/tutorial


Ignore:
Timestamp:
Jan 28, 2013, 2:23:57 PM (8 years ago)
Author:
sam
Message:

easymesh: interface the shiny shader with new Light objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tutorial/05_easymesh.cpp

    r2237 r2289  
    5555        Ticker::Ref(m_camera);
    5656
     57        /* Add a white directional light */
     58        m_light1 = new Light();
     59        m_light1->SetPosition(vec4(0.2f, 0.2f, 0.f, 0.f));
     60        m_light1->SetColor(vec4(0.5f, 0.5f, 0.5f, 1.f));
     61        Ticker::Ref(m_light1);
     62
     63        /* Add an orangeish point light */
     64        m_light2 = new Light();
     65        m_light2->SetPosition(vec4(-15.f, 15.f, 15.f, 1.f));
     66        m_light2->SetColor(vec4(0.4f, 0.3f, 0.2f, 1.f));
     67        Ticker::Ref(m_light2);
     68
    5769        m_ready = false;
    5870    }
     
    6173    {
    6274        Ticker::Unref(m_camera);
     75        Ticker::Unref(m_light1);
     76        Ticker::Unref(m_light2);
    6377    }
    6478
     
    115129    mat4 m_mat;
    116130    Camera *m_camera;
     131    Light *m_light1, *m_light2;
    117132
    118133    bool m_ready;
Note: See TracChangeset for help on using the changeset viewer.