Ignore:
Timestamp:
Feb 5, 2013, 5:07:09 PM (7 years ago)
Author:
touky
Message:

render : Added DebugRenderMode & corresponding shaders. naive (VERY) implementation in MeshViewer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/MeshViewer.cpp

    r2364 r2370  
    5151        //FOV compensation doesn't work
    5252        ivec2 video_size = Video::GetSize();
    53         float near = -video_size.x - video_size.y;
    54         float far = video_size.x + video_size.y;
     53        float near = (float)-video_size.x - video_size.y;
     54        float far = (float)video_size.x + video_size.y;
    5555        float t1 = tanf(new_fov / 2);
    56         float dist = video_size.x / (2.0f * t1);
     56        float dist = (float)video_size.x / (2.0f * t1);
    5757        //m_fov_compensation = mat4::translate(-0.5f * video_size.x, -0.5f * video_size.y, -dist);
    5858        m_fov_compensation = mat4::translate(vec3(.0f));
     
    157157        WorldEntity::TickGame(seconds);
    158158
    159         //Shutdown logic
    160         if (Input::WasReleased(Key::Escape))
    161             Ticker::Shutdown();
     159        //TODO : This should probably be "standard LoL behaviour"
     160        {
     161            //Shutdown logic
     162            if (Input::WasReleased(Key::Escape))
     163                Ticker::Shutdown();
     164        }
    162165
    163166        //Update Mesh BBox - Get the Min/Max needed
     
    283286    {
    284287        WorldEntity::TickDraw(seconds);
     288
     289        //TODO : This should probably be "standard LoL behaviour"
     290        {
     291            if (Input::WasReleased(Key::F1))
     292                Video::SetDebugRenderMode(DebugRenderMode::Default);
     293            if (Input::WasReleased(Key::F2))
     294                Video::SetDebugRenderMode(DebugRenderMode::Wireframe);
     295            if (Input::WasReleased(Key::F3))
     296                Video::SetDebugRenderMode(DebugRenderMode::Lighting);
     297            if (Input::WasReleased(Key::F4))
     298                Video::SetDebugRenderMode(DebugRenderMode::Normal);
     299            if (Input::WasReleased(Key::F5))
     300                Video::SetDebugRenderMode(DebugRenderMode::UV);
     301        }
    285302
    286303        for (int i = 0; i < m_meshes.Count(); i++)
Note: See TracChangeset for help on using the changeset viewer.