Changeset 1624


Ignore:
Timestamp:
Jul 11, 2012, 5:34:16 PM (8 years ago)
Author:
sam
Message:

neercs: always initialise shaders at launch time, so we don’t have to do
it later.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/render.cpp

    r1623 r1624  
    175175    glCullFace(GL_BACK);      // don't draw front face
    176176
    177     if (m_shader)
    178     {
    179         /* Initialise framebuffer objects */
    180         fbo_back = new FrameBuffer(screen_size);
    181         fbo_front = new FrameBuffer(screen_size);
    182         fbo_blur_h = new FrameBuffer(screen_size / glow_fbo_size);
    183         fbo_blur_v = new FrameBuffer(screen_size / glow_fbo_size);
    184         fbo_ping = new FrameBuffer(screen_size);
    185         fbo_pong = new FrameBuffer(screen_size);
    186         // shader simple
    187         shader_simple = Shader::Create(lolfx_simple);
    188         shader_simple_texture = shader_simple->GetUniformLocation("texture");
    189         // shader blur horizontal
    190         shader_blur_h = Shader::Create(lolfx_blurh);
    191         shader_blur_h_texture = shader_blur_h->GetUniformLocation("texture");
    192         shader_blur_h_screen_size = shader_blur_h->GetUniformLocation("screen_size");
    193         shader_blur_h_time = shader_blur_h->GetUniformLocation("time");
    194         shader_blur_h_value = shader_blur_h->GetUniformLocation("value");
    195         // shader blur vertical
    196         shader_blur_v = Shader::Create(lolfx_blurv);
    197         shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture");
    198         shader_blur_v_screen_size = shader_blur_v->GetUniformLocation("screen_size");
    199         shader_blur_v_time = shader_blur_v->GetUniformLocation("time");
    200         shader_blur_v_value = shader_blur_v->GetUniformLocation("value");
    201         // shader glow
    202         shader_glow = Shader::Create(lolfx_glow);
    203         shader_glow_texture = shader_glow->GetUniformLocation("texture");
    204         shader_glow_texture_prv = shader_glow->GetUniformLocation("texture_prv");
    205         shader_glow_screen_size = shader_glow->GetUniformLocation("screen_size");
    206         shader_glow_time = shader_glow->GetUniformLocation("time");
    207         shader_glow_step = shader_glow->GetUniformLocation("step");
    208         shader_glow_value1 = shader_glow->GetUniformLocation("value1");
    209         shader_glow_value2 = shader_glow->GetUniformLocation("value2");
    210         // shader radial
    211         shader_radial = Shader::Create(lolfx_radial);
    212         shader_radial_texture = shader_radial->GetUniformLocation("texture");
    213         shader_radial_screen_size = shader_radial->GetUniformLocation("screen_size");
    214         shader_radial_time = shader_radial->GetUniformLocation("time");
    215         shader_radial_value1 = shader_radial->GetUniformLocation("value1");
    216         shader_radial_value2 = shader_radial->GetUniformLocation("value2");
    217         shader_radial_color = shader_radial->GetUniformLocation("color");
    218         // shader postfx
    219         shader_postfx = Shader::Create(lolfx_postfx);
    220         shader_postfx_texture = shader_postfx->GetUniformLocation("texture");
    221         shader_postfx_texture_2d = shader_postfx->GetUniformLocation("texture_2d");
    222         shader_postfx_screen_size = shader_postfx->GetUniformLocation("screen_size");
    223         shader_postfx_time = shader_postfx->GetUniformLocation("time");
    224         shader_postfx_flash = shader_postfx->GetUniformLocation("flash");
    225         shader_postfx_value = shader_postfx->GetUniformLocation("value");
    226         shader_postfx_deform = shader_postfx->GetUniformLocation("deform");
    227         shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline");
    228         shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
    229     }
     177    /* Initialise framebuffer objects */
     178    fbo_back = new FrameBuffer(screen_size);
     179    fbo_front = new FrameBuffer(screen_size);
     180    fbo_blur_h = new FrameBuffer(screen_size / glow_fbo_size);
     181    fbo_blur_v = new FrameBuffer(screen_size / glow_fbo_size);
     182    fbo_ping = new FrameBuffer(screen_size);
     183    fbo_pong = new FrameBuffer(screen_size);
     184    // shader simple
     185    shader_simple = Shader::Create(lolfx_simple);
     186    shader_simple_texture = shader_simple->GetUniformLocation("texture");
     187    // shader blur horizontal
     188    shader_blur_h = Shader::Create(lolfx_blurh);
     189    shader_blur_h_texture = shader_blur_h->GetUniformLocation("texture");
     190    shader_blur_h_screen_size = shader_blur_h->GetUniformLocation("screen_size");
     191    shader_blur_h_time = shader_blur_h->GetUniformLocation("time");
     192    shader_blur_h_value = shader_blur_h->GetUniformLocation("value");
     193    // shader blur vertical
     194    shader_blur_v = Shader::Create(lolfx_blurv);
     195    shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture");
     196    shader_blur_v_screen_size = shader_blur_v->GetUniformLocation("screen_size");
     197    shader_blur_v_time = shader_blur_v->GetUniformLocation("time");
     198    shader_blur_v_value = shader_blur_v->GetUniformLocation("value");
     199    // shader glow
     200    shader_glow = Shader::Create(lolfx_glow);
     201    shader_glow_texture = shader_glow->GetUniformLocation("texture");
     202    shader_glow_texture_prv = shader_glow->GetUniformLocation("texture_prv");
     203    shader_glow_screen_size = shader_glow->GetUniformLocation("screen_size");
     204    shader_glow_time = shader_glow->GetUniformLocation("time");
     205    shader_glow_step = shader_glow->GetUniformLocation("step");
     206    shader_glow_value1 = shader_glow->GetUniformLocation("value1");
     207    shader_glow_value2 = shader_glow->GetUniformLocation("value2");
     208    // shader radial
     209    shader_radial = Shader::Create(lolfx_radial);
     210    shader_radial_texture = shader_radial->GetUniformLocation("texture");
     211    shader_radial_screen_size = shader_radial->GetUniformLocation("screen_size");
     212    shader_radial_time = shader_radial->GetUniformLocation("time");
     213    shader_radial_value1 = shader_radial->GetUniformLocation("value1");
     214    shader_radial_value2 = shader_radial->GetUniformLocation("value2");
     215    shader_radial_color = shader_radial->GetUniformLocation("color");
     216    // shader postfx
     217    shader_postfx = Shader::Create(lolfx_postfx);
     218    shader_postfx_texture = shader_postfx->GetUniformLocation("texture");
     219    shader_postfx_texture_2d = shader_postfx->GetUniformLocation("texture_2d");
     220    shader_postfx_screen_size = shader_postfx->GetUniformLocation("screen_size");
     221    shader_postfx_time = shader_postfx->GetUniformLocation("time");
     222    shader_postfx_flash = shader_postfx->GetUniformLocation("flash");
     223    shader_postfx_value = shader_postfx->GetUniformLocation("value");
     224    shader_postfx_deform = shader_postfx->GetUniformLocation("deform");
     225    shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline");
     226    shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
    230227
    231228    return true;
Note: See TracChangeset for help on using the changeset viewer.