Changeset 1626


Ignore:
Timestamp:
Jul 11, 2012, 6:42:44 PM (8 years ago)
Author:
sam
Message:

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

File:
1 edited

Legend:

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

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