Changeset 2318 for trunk/tools


Ignore:
Timestamp:
Feb 2, 2013, 4:25:31 PM (7 years ago)
Author:
sam
Message:

build: fix all vector/scalar type mismatches such as "vec2 * double"
instead of "vec2 * float".

Location:
trunk/tools/neercs/video
Files:
3 edited

Legend:

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

    r2277 r2318  
    15471547        shader_blur_h->Bind();
    15481548        shader_blur_h->SetUniform(shader_blur_h_texture, fbo_back->GetTexture(), 0);
    1549         shader_blur_h->SetUniform(shader_blur_h_radius, glow_large / screen_size.x);
     1549        shader_blur_h->SetUniform(shader_blur_h_radius, glow_large / (float)screen_size.x);
    15501550        TraceQuad();
    15511551        shader_blur_h->Unbind();
     
    15551555        shader_blur_v->Bind();
    15561556        shader_blur_v->SetUniform(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
    1557         shader_blur_v->SetUniform(shader_blur_v_radius, glow_large / screen_size.y);
     1557        shader_blur_v->SetUniform(shader_blur_v_radius, glow_large / (float)screen_size.y);
    15581558        TraceQuad();
    15591559        shader_blur_v->Unbind();
     
    15631563        shader_blur_h->Bind();
    15641564        shader_blur_h->SetUniform(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0);
    1565         shader_blur_h->SetUniform(shader_blur_h_radius, glow_small / screen_size.x);
     1565        shader_blur_h->SetUniform(shader_blur_h_radius, glow_small / (float)screen_size.x);
    15661566        TraceQuad();
    15671567        shader_blur_h->Unbind();
     
    15711571        shader_blur_v->Bind();
    15721572        shader_blur_v->SetUniform(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
    1573         shader_blur_v->SetUniform(shader_blur_v_radius, glow_small / screen_size.y);
     1573        shader_blur_v->SetUniform(shader_blur_v_radius, glow_small / (float)screen_size.y);
    15741574        TraceQuad();
    15751575        shader_blur_v->Unbind();
     
    16381638        shader_blur_h->Bind();
    16391639        shader_blur_h->SetUniform(shader_blur_h_texture, fbo_screen->GetTexture(), 0);
    1640         shader_blur_h->SetUniform(shader_blur_h_radius, blur / screen_size.x);
     1640        shader_blur_h->SetUniform(shader_blur_h_radius, blur / (float)screen_size.x);
    16411641        TraceQuad();
    16421642        shader_blur_h->Unbind();
     
    16461646        shader_blur_v->Bind();
    16471647        shader_blur_v->SetUniform(shader_blur_v_texture, fbo_tmp->GetTexture(), 0);
    1648         shader_blur_v->SetUniform(shader_blur_v_radius, blur / screen_size.y);
     1648        shader_blur_v->SetUniform(shader_blur_v_radius, blur / (float)screen_size.y);
    16491649        TraceQuad();
    16501650        shader_blur_v->Unbind();
     
    16591659        shader_postfx->SetUniform(shader_postfx_texture, fbo_screen->GetTexture(), 0);
    16601660        shader_postfx->SetUniform(shader_postfx_screen_size, (vec2)screen_size);
    1661         shader_postfx->SetUniform(shader_postfx_ratio_2d, (vec2)ratio_2d / 2);
     1661        shader_postfx->SetUniform(shader_postfx_ratio_2d, (vec2)ratio_2d * 0.5f);
    16621662        shader_postfx->SetUniform(shader_postfx_time, fx_angle);
    16631663        shader_postfx->SetUniform(shader_postfx_deform, postfx_deform);
    1664         shader_postfx->SetUniform(shader_postfx_ghost1, vec4(postfx_ghost1.xyz * 0.01, postfx_ghost1.w));
    1665         shader_postfx->SetUniform(shader_postfx_ghost2, vec4(postfx_ghost2.xyz * 0.01, postfx_ghost2.w));
    1666         shader_postfx->SetUniform(shader_postfx_glass, vec4(postfx_glass.xy * 0.01, postfx_glass.z * 0.1, postfx_glass.w));
     1664        shader_postfx->SetUniform(shader_postfx_ghost1, vec4(postfx_ghost1.xyz * 0.01f, postfx_ghost1.w));
     1665        shader_postfx->SetUniform(shader_postfx_ghost2, vec4(postfx_ghost2.xyz * 0.01f, postfx_ghost2.w));
     1666        shader_postfx->SetUniform(shader_postfx_glass, vec4(postfx_glass.xy * 0.01f, postfx_glass.z * 0.1f, postfx_glass.w));
    16671667        shader_postfx->SetUniform(shader_postfx_gradient, postfx_gradient);
    16681668        shader_postfx->SetUniform(shader_postfx_gradient_color, postfx_gradient_color);
    16691669        shader_postfx->SetUniform(shader_postfx_vignetting, postfx_vignetting);
    16701670        shader_postfx->SetUniform(shader_postfx_aberration, postfx_aberration);
    1671         shader_postfx->SetUniform(shader_postfx_moire_h, vec4(postfx_moire_h.xyz, postfx_moire_h.w * 2 * M_PI));
    1672         shader_postfx->SetUniform(shader_postfx_moire_v, vec4(postfx_moire_v.xyz, postfx_moire_v.w * 2 * M_PI));
    1673         shader_postfx->SetUniform(shader_postfx_scanline_h, vec4(postfx_scanline_h.xyz, postfx_scanline_h.w * 2 * M_PI));
    1674         shader_postfx->SetUniform(shader_postfx_scanline_v, vec4(postfx_scanline_v.xyz, postfx_scanline_v.w * 2 * M_PI));
     1671        shader_postfx->SetUniform(shader_postfx_moire_h, vec4(postfx_moire_h.xyz, postfx_moire_h.w * (float)(2 * M_PI)));
     1672        shader_postfx->SetUniform(shader_postfx_moire_v, vec4(postfx_moire_v.xyz, postfx_moire_v.w * (float)(2 * M_PI)));
     1673        shader_postfx->SetUniform(shader_postfx_scanline_h, vec4(postfx_scanline_h.xyz, postfx_scanline_h.w * (float)(2 * M_PI)));
     1674        shader_postfx->SetUniform(shader_postfx_scanline_v, vec4(postfx_scanline_v.xyz, postfx_scanline_v.w * (float)(2 * M_PI)));
    16751675        shader_postfx->SetUniform(shader_postfx_corner, postfx_corner);
    16761676        shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(sync_value * cosf((main_angle - sync_angle) * 6.0f)));
  • trunk/tools/neercs/video/text-render.cpp

    r2317 r2318  
    116116    mat4 xform = mat4::translate(-1.f, -1.f + 2.0f * m_font_size.y
    117117                                        * m_canvas_size.y / m_fbo_size.y, 0.f)
    118                * mat4::scale(vec3(2.f * m_font_size / m_fbo_size, 1.f)
    119                               * vec3(1.f, -1.f, 1.f))
     118               * mat4::scale(vec3((vec2)m_font_size / (vec2)m_fbo_size, 1.f)
     119                              * vec3(2.f, -2.f, 1.f))
    120120               * mat4::translate(0.5f, 0.5f, 0.f);
    121121
  • trunk/tools/neercs/video/text-render.h

    r2155 r2318  
    66#define __TEXT_RENDER_H__
    77
    8 struct TextRender
     8class TextRender
    99{
     10public:
    1011    TextRender(caca_canvas_t *caca, ivec2 font_size);
    1112    void Init();
Note: See TracChangeset for help on using the changeset viewer.