source: trunk/tools/neercs/video/render.cpp @ 1644

Last change on this file since 1644 was 1644, checked in by rez, 10 years ago

remanency expanded to 6 buffers, 3 ared used and blended (2,4 and 6)

File size: 20.2 KB
Line 
1//
2// Neercs
3//
4
5#if defined HAVE_CONFIG_H
6#   include "config.h"
7#endif
8
9#if defined _XBOX
10#   define _USE_MATH_DEFINES /* for M_PI */
11#   include <xtl.h>
12#elif defined _WIN32
13#   define _USE_MATH_DEFINES /* for M_PI */
14#   define WIN32_LEAN_AND_MEAN
15#   include <windows.h>
16#endif
17
18#include <cmath>
19#include <cstdio>
20#include <cstdlib>
21#include <ctime>
22#include <string>
23
24#include "core.h"
25#include "lolgl.h"
26
27using namespace std;
28using namespace lol;
29
30#include "../neercs.h"
31#include "render.h"
32#include "text-render.h"
33
34extern char const *lolfx_blurh;
35extern char const *lolfx_blurv;
36extern char const *lolfx_remanency;
37extern char const *lolfx_glow;
38extern char const *lolfx_postfx;
39extern char const *lolfx_radial;
40extern char const *lolfx_simple;
41
42#define PID M_PI/180.0f    // pi ratio
43#define CR 1.0f/256.0f     // color ratio
44
45/*
46 * Various variables
47 */
48
49int active = true;         // window active flag
50float nearplane = 0.1f;    // nearplane
51float farplane = 1000.0f;  // farplane
52int polygon_fillmode = GL_FILL; // fill mode
53bool key_state = 0;        // key state
54/* window variable */
55ivec2 screen_size;         // screen size
56vec3 screen_color = CR * vec3(32, 32, 32); // screen color
57/* object variable */
58float main_angle = 0.0f;   // main angle
59float part_angle = 0.0f;   // part angle
60float fx_angle;            // current angle
61/* fs_quad variable */
62float fs_quad_vtx[] = {-1.0f, 1.0f, 0, 1.0f, -1.0f, -1.0f, 0, 1.0f, 1.0f, -1.0f, 0, 1.0f, 1.0f, 1.0f, 0, 1.0f};
63float fs_quad_tex[] = {0, 1.0f, 0, 0, 1.0f, 0, 1.0f, 1.0f};
64/* flash variable */
65bool flash_flag = false;   // flag
66float flash_angle = 0;     // angle
67float flash_value = 0;     // value
68float flash_speed = 1.5f;  // speed
69/* fade variable */
70bool fade_flag = false;    // flag
71float fade_angle = 0;      // angle
72float fade_value = 0;      // value
73float fade_speed = 0.2f;   // speed
74/* sync variable */
75bool sync_flag = false;    // flag
76float sync_angle = 0;      // angle
77float sync_value = 1.0f;   // value
78float sync_speed = 1.0f;   // speed
79/* beat variable */
80bool beat_flag = false;    // flag
81float beat_angle = 0;      // angle
82float beat_value = 0;      // value
83float beat_speed = 2.0f;   // speed
84/* window variable */
85ivec2 border;              // border width
86/* text variable */
87ivec2 ratio_2d(2,4);       // 2d ratio
88ivec2 map_size(256,256);   // texture map size
89ivec2 font_size(8,8);      // font size
90ivec2 canvas_char(0,0);    // canvas char number
91ivec2 canvas_size(0,0);    // caca size
92/* common variable */
93float value, angle, radius, scale, speed;
94/* shader variable */
95int glow_fbo_size = 2;        // glow fbo size
96float glow_smoothstep = 0.0f; // glow smoothstep value (try 0.025f)
97float glow_mix_ratio1 = 0.5f; // glow mixing ratio
98float glow_mix_ratio2 = 0.5f; // source mixing ratio
99float radial_value1 = 2.0f;
100float radial_value2 = 0.8f;
101float radial_color = 0;       // color
102bool postfx_scanline = true;
103float postfx_deform = 0.625f; // deformation ratio
104
105Shader *shader_simple;
106Shader *shader_blur_h, *shader_blur_v;
107Shader *shader_remanency, *shader_glow, *shader_radial, *shader_postfx;
108// shader variables
109ShaderUniform shader_simple_texture;
110ShaderUniform shader_blur_h_texture,
111              shader_blur_h_screen_size,
112              shader_blur_h_time,
113              shader_blur_h_value;
114ShaderUniform shader_blur_v_texture,
115              shader_blur_v_screen_size,
116              shader_blur_v_time,
117              shader_blur_v_value;
118ShaderUniform shader_remanency_texture,
119              shader_remanency_texture_buffer1,
120              shader_remanency_texture_buffer2,
121              shader_remanency_texture_buffer3,
122              shader_remanency_screen_size,
123              shader_remanency_time,
124              shader_remanency_value1,
125              shader_remanency_value2;
126ShaderUniform shader_glow_texture,
127              shader_glow_texture_prv,
128              shader_glow_screen_size,
129              shader_glow_time,
130              shader_glow_step,
131              shader_glow_value1,
132              shader_glow_value2;
133ShaderUniform shader_radial_texture,
134              shader_radial_screen_size,
135              shader_radial_time,
136              shader_radial_value1,
137              shader_radial_value2,
138              shader_radial_color;
139ShaderUniform shader_postfx_texture,
140              shader_postfx_texture_2d,
141              shader_postfx_screen_size,
142              shader_postfx_time,
143              shader_postfx_flash,
144              shader_postfx_value,
145              shader_postfx_deform,
146              shader_postfx_scanline,
147              shader_postfx_sync;
148
149FrameBuffer *fbo_back, *fbo_front;
150FrameBuffer *fbo_buffer1, *fbo_buffer2, *fbo_buffer3, *fbo_buffer4, *fbo_buffer5, *fbo_buffer6;
151FrameBuffer *fbo_blur_h, *fbo_blur_v, *fbo_ping, *fbo_pong;
152
153TextRender *text_render;
154
155void fs_quad()
156{
157    glLoadIdentity();
158    glDrawArrays(GL_QUADS, 0, 4);
159}
160
161void draw_shader_simple(FrameBuffer *fbo_output, int n)
162{
163    shader_simple->Bind();
164    shader_simple->SetTexture(shader_simple_texture, fbo_output->GetTexture(), n);
165    fs_quad();
166    shader_simple->Unbind();
167}
168
169void rectangle(int x, int y, int w, int h)
170{
171    glLoadIdentity();
172    glBegin(GL_QUADS);
173        glVertex2i(x+w, y  );
174        glVertex2i(x  , y  );
175        glVertex2i(x  , y+h);
176        glVertex2i(x+w, y+h);
177    glEnd();
178}
179
180int Render::InitDraw(void)
181{
182    glDepthMask(GL_TRUE);     // do not write z-buffer
183    glEnable(GL_CULL_FACE);   // disable cull face
184    glCullFace(GL_BACK);      // don't draw front face
185
186    /* Initialise framebuffer objects */
187    fbo_back = new FrameBuffer(screen_size);
188    fbo_front = new FrameBuffer(screen_size);
189    fbo_buffer1 = new FrameBuffer(screen_size);
190    fbo_buffer2 = new FrameBuffer(screen_size);
191    fbo_buffer3 = new FrameBuffer(screen_size);
192    fbo_buffer4 = new FrameBuffer(screen_size);
193    fbo_buffer5 = new FrameBuffer(screen_size);
194    fbo_buffer6 = new FrameBuffer(screen_size);
195    fbo_blur_h = new FrameBuffer(screen_size / glow_fbo_size);
196    fbo_blur_v = new FrameBuffer(screen_size / glow_fbo_size);
197    fbo_ping = new FrameBuffer(screen_size);
198    fbo_pong = new FrameBuffer(screen_size);
199    // shader simple
200    shader_simple = Shader::Create(lolfx_simple);
201    shader_simple_texture = shader_simple->GetUniformLocation("texture");
202    // shader blur horizontal
203    shader_blur_h = Shader::Create(lolfx_blurh);
204    shader_blur_h_texture = shader_blur_h->GetUniformLocation("texture");
205    shader_blur_h_screen_size = shader_blur_h->GetUniformLocation("screen_size");
206    shader_blur_h_time = shader_blur_h->GetUniformLocation("time");
207    shader_blur_h_value = shader_blur_h->GetUniformLocation("value");
208    // shader blur vertical
209    shader_blur_v = Shader::Create(lolfx_blurv);
210    shader_blur_v_texture = shader_blur_v->GetUniformLocation("texture");
211    shader_blur_v_screen_size = shader_blur_v->GetUniformLocation("screen_size");
212    shader_blur_v_time = shader_blur_v->GetUniformLocation("time");
213    shader_blur_v_value = shader_blur_v->GetUniformLocation("value");
214    // shader remanency
215    shader_remanency = Shader::Create(lolfx_remanency);
216    shader_remanency_texture = shader_remanency->GetUniformLocation("texture");
217    shader_remanency_texture_buffer1 = shader_remanency->GetUniformLocation("texture_buffer1");
218    shader_remanency_texture_buffer2 = shader_remanency->GetUniformLocation("texture_buffer2");
219    shader_remanency_texture_buffer3 = shader_remanency->GetUniformLocation("texture_buffer3");
220    shader_remanency_screen_size = shader_remanency->GetUniformLocation("screen_size");
221    shader_remanency_time = shader_remanency->GetUniformLocation("time");
222    shader_remanency_value1 = shader_remanency->GetUniformLocation("value1");
223    shader_remanency_value2 = shader_remanency->GetUniformLocation("value2");
224    // shader glow
225    shader_glow = Shader::Create(lolfx_glow);
226    shader_glow_texture = shader_glow->GetUniformLocation("texture");
227    shader_glow_texture_prv = shader_glow->GetUniformLocation("texture_prv");
228    shader_glow_screen_size = shader_glow->GetUniformLocation("screen_size");
229    shader_glow_time = shader_glow->GetUniformLocation("time");
230    shader_glow_step = shader_glow->GetUniformLocation("step");
231    shader_glow_value1 = shader_glow->GetUniformLocation("value1");
232    shader_glow_value2 = shader_glow->GetUniformLocation("value2");
233    // shader radial
234    shader_radial = Shader::Create(lolfx_radial);
235    shader_radial_texture = shader_radial->GetUniformLocation("texture");
236    shader_radial_screen_size = shader_radial->GetUniformLocation("screen_size");
237    shader_radial_time = shader_radial->GetUniformLocation("time");
238    shader_radial_value1 = shader_radial->GetUniformLocation("value1");
239    shader_radial_value2 = shader_radial->GetUniformLocation("value2");
240    shader_radial_color = shader_radial->GetUniformLocation("color");
241    // shader postfx
242    shader_postfx = Shader::Create(lolfx_postfx);
243    shader_postfx_texture = shader_postfx->GetUniformLocation("texture");
244    shader_postfx_texture_2d = shader_postfx->GetUniformLocation("texture_2d");
245    shader_postfx_screen_size = shader_postfx->GetUniformLocation("screen_size");
246    shader_postfx_time = shader_postfx->GetUniformLocation("time");
247    shader_postfx_flash = shader_postfx->GetUniformLocation("flash");
248    shader_postfx_value = shader_postfx->GetUniformLocation("value");
249    shader_postfx_deform = shader_postfx->GetUniformLocation("deform");
250    shader_postfx_scanline = shader_postfx->GetUniformLocation("scanline");
251    shader_postfx_sync = shader_postfx->GetUniformLocation("sync");
252
253    return true;
254}
255
256int Render::CreateGLWindow()
257{
258    screen_size = Video::GetSize();
259    border = 18 * ratio_2d;
260    border.y = border.x; // enabled to get same border everywhere
261    canvas_char = (screen_size - border * 2) / (font_size * ratio_2d);
262    canvas_size = canvas_char * font_size * ratio_2d;
263
264    border = (screen_size - canvas_size) / 2;
265
266    caca_set_canvas_size(m_caca, canvas_char.x, canvas_char.y);
267
268    InitDraw();
269    return true;
270}
271
272Render::Render(caca_canvas_t *caca)
273  : m_caca(caca),
274    m_ready(false),
275    m_pause(false),
276    m_polygon(true),
277    m_shader(true),
278    m_shader_blur(true),
279    m_shader_remanency(true),
280    m_shader_glow(true),
281    m_shader_fx(true),
282    m_shader_postfx(true),
283    m_border(false)
284{
285    text_render = new TextRender(m_caca, font_size);
286}
287
288void Render::TickGame(float seconds)
289{
290    Entity::TickGame(seconds);
291}
292
293void Render::Pause()
294{
295    m_pause=!m_pause;
296}
297
298void Render::TickDraw(float seconds)
299{
300    /* keyboard manager */
301    if (Input::GetButtonState(27/*SDLK_ESCAPE*/))
302        Ticker::Shutdown();
303    //if (Input::GetButtonState(282/*SDLK_F1*/))
304    //    LEAULE();
305    if (Input::GetButtonState(283/*SDLK_F2*/))
306        {
307        m_polygon=!m_polygon;
308        polygon_fillmode=(m_polygon)?GL_FILL:GL_LINE;
309        glPolygonMode(GL_FRONT,polygon_fillmode);
310        }
311    if (Input::GetButtonState(284/*SDLK_F3*/)&&key_state!=284)
312        {
313        m_shader=!m_shader;
314        key_state=284;
315        }
316    if (Input::GetButtonState(285/*SDLK_F4*/))
317        m_shader_postfx=!m_shader_postfx;
318    if (Input::GetButtonState(286/*SDLK_F5*/))
319        Pause();
320
321    Entity::TickDraw(seconds);
322
323    if (!m_ready)
324    {
325        CreateGLWindow();
326        text_render->Init();
327        m_ready = true;
328    }
329
330    // timer
331    if (!m_pause)
332        main_angle += seconds * 100.0f * PID;
333    if (sync_flag)
334    {
335        angle=(main_angle-sync_angle)*sync_speed;
336        sync_value=1.0f-sinf(angle);
337        if (angle>90.0f*PID)
338        {
339            sync_value=0;
340            sync_flag=false;
341        }
342    }
343    if (beat_flag)
344    {
345        angle=(main_angle-beat_angle)*beat_speed;
346        beat_value=1.0f-sinf(angle);
347        if (angle>90.0f*PID)
348        {
349            beat_value=0;
350            beat_flag=false;
351        }
352    }
353    if (flash_flag)
354    {
355        angle=(main_angle-flash_angle)*flash_speed;
356        flash_value=1.0f-sinf(angle);
357        if (angle>90.0f*PID)
358        {
359            flash_value=0;
360            flash_flag=false;
361        }
362    }
363    if (fade_flag)
364    {
365        angle=(main_angle-fade_angle)*fade_speed;
366        fade_value=1.0f-sinf(angle);
367        if (angle>90.0f*PID)
368        {
369            fade_value=0;
370            fade_flag=false;
371        }
372    }
373
374    Draw2D();
375    Draw3D();
376}
377
378void Render::Draw2D()
379{
380    /* Draw text in an offline buffer */
381    text_render->Render();
382
383    if (m_shader)
384    {
385        fbo_back->Bind();
386    }
387
388    glViewport(0, 0, screen_size.x, screen_size.y);
389
390    /* Clear the back buffer */
391    glEnable(GL_BLEND);
392    glBlendFunc(GL_SRC_COLOR,GL_DST_ALPHA);
393    glClearColor(screen_color.r, screen_color.g, screen_color.b, 1.0f);
394    glClearDepth(1.0f); // set depth buffer
395    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
396
397    text_render->Blit(border, canvas_size);
398
399    //if (m_polygon) glEnable(GL_LINE_SMOOTH); else glDisable(GL_LINE_SMOOTH);
400    glLineWidth((m_polygon)?2.0f:1.0f);
401    fx_angle=main_angle-part_angle;
402    if (m_polygon)
403        glEnable(GL_TEXTURE_2D);
404
405    glMatrixMode(GL_PROJECTION);
406    mat4 m = mat4::ortho(0, screen_size.x, screen_size.y, 0, -1.f, 1.f);
407    glLoadMatrixf(&m[0][0]);
408    glMatrixMode(GL_MODELVIEW);
409    // draw border
410    if (m_border)
411    {
412        glDisable(GL_TEXTURE_2D);
413        glDisable(GL_BLEND);
414        glColor3f(1.0f, 1.0f, 1.0f);
415        rectangle(border.x - ratio_2d.x, border.y - ratio_2d.y, canvas_size.x + ratio_2d.x * 2, ratio_2d.y);
416        rectangle(border.x - ratio_2d.x, border.y, ratio_2d.x, canvas_size.y);
417        rectangle(border.x + canvas_size.x, border.y, ratio_2d.x, canvas_size.y);
418        rectangle(border.x - ratio_2d.x, border.y + canvas_size.y, canvas_size.x + ratio_2d.x * 2, ratio_2d.y);
419        glEnable(GL_BLEND);
420    }
421}
422
423void Render::Draw3D()
424{
425    if (!m_shader)
426        return;
427
428    glDisable(GL_DEPTH_TEST);
429    glDisable(GL_BLEND);
430
431    glEnableClientState(GL_VERTEX_ARRAY);
432    glVertexPointer(4, GL_FLOAT, 0, fs_quad_vtx);
433
434    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
435    glTexCoordPointer(2, GL_FLOAT, 0, fs_quad_tex);
436
437    if (m_shader_remanency)
438    {
439        // shader remanency
440        fbo_ping->Bind();
441        shader_remanency->Bind();
442        shader_remanency->SetTexture(shader_remanency_texture, fbo_back->GetTexture(), 0);
443        shader_remanency->SetTexture(shader_remanency_texture_buffer1, fbo_buffer2->GetTexture(), 1);
444        shader_remanency->SetTexture(shader_remanency_texture_buffer2, fbo_buffer4->GetTexture(), 2);
445        shader_remanency->SetTexture(shader_remanency_texture_buffer3, fbo_buffer6->GetTexture(), 3);
446        shader_remanency->SetUniform(shader_remanency_screen_size, vec2(1.0f));
447        shader_remanency->SetUniform(shader_remanency_time, fx_angle);
448        shader_remanency->SetUniform(shader_remanency_value1, 0.25f);
449        shader_remanency->SetUniform(shader_remanency_value2, 0.25f);
450        fs_quad();
451        shader_remanency->Unbind();
452        fbo_ping->Unbind();
453        // shader simple
454        fbo_back->Bind();
455        draw_shader_simple(fbo_ping, 0);
456        fbo_back->Unbind();
457        // save previous fbo
458        fbo_buffer6->Bind();
459        draw_shader_simple(fbo_buffer5, 0);
460        fbo_buffer6->Unbind();
461        fbo_buffer5->Bind();
462        draw_shader_simple(fbo_buffer4, 0);
463        fbo_buffer5->Unbind();
464        fbo_buffer4->Bind();
465        draw_shader_simple(fbo_buffer3, 0);
466        fbo_buffer4->Unbind();
467        fbo_buffer3->Bind();
468        draw_shader_simple(fbo_buffer2, 0);
469        fbo_buffer3->Unbind();
470        fbo_buffer2->Bind();
471        draw_shader_simple(fbo_buffer1, 0);
472        fbo_buffer2->Unbind();
473        fbo_buffer1->Bind();
474        draw_shader_simple(fbo_front, 0);
475        fbo_buffer1->Unbind();
476    }
477
478    if (m_shader_fx && m_shader_blur)
479    {
480        // shader blur horizontal
481        fbo_ping->Bind();
482        shader_blur_h->Bind();
483        shader_blur_h->SetTexture(shader_blur_h_texture, fbo_back->GetTexture(), 0);
484        shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f));
485        shader_blur_h->SetUniform(shader_blur_h_time, fx_angle);
486        shader_blur_h->SetUniform(shader_blur_h_value, 0.375f/screen_size.x);
487        fs_quad();
488        shader_blur_h->Unbind();
489        fbo_ping->Unbind();
490        // shader blur vertical
491        fbo_front->Bind();
492        shader_blur_v->Bind();
493        shader_blur_v->SetTexture(shader_blur_v_texture, fbo_ping->GetTexture(), 0);
494        shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f));
495        shader_blur_v->SetUniform(shader_blur_v_time, fx_angle);
496        shader_blur_v->SetUniform(shader_blur_v_value, 0.375f/screen_size.y);
497        fs_quad();
498        shader_blur_v->Unbind();
499    }
500    else
501    {
502        // shader simple
503        fbo_front->Bind();
504        draw_shader_simple(fbo_back, 0);
505    }
506    fbo_front->Unbind();
507    // shader glow
508    if (m_shader_fx && m_shader_glow)
509    {
510        // shader blur horizontal
511        fbo_blur_h->Bind();
512        shader_blur_h->Bind();
513        shader_blur_h->SetTexture(shader_blur_h_texture, fbo_ping->GetTexture(), 0);
514        shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size));
515        shader_blur_h->SetUniform(shader_blur_h_time, fx_angle);
516        shader_blur_h->SetUniform(shader_blur_h_value, 2.5f / screen_size.x);
517        fs_quad();
518        shader_blur_h->Unbind();
519        fbo_blur_h->Unbind();
520        // shader blur vertical
521        fbo_blur_v->Bind();
522        shader_blur_v->Bind();
523        shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
524        shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size));
525        shader_blur_v->SetUniform(shader_blur_v_time, fx_angle);
526        shader_blur_v->SetUniform(shader_blur_h_value, 2.5f / screen_size.y);
527        fs_quad();
528        shader_blur_v->Unbind();
529        fbo_blur_v->Unbind();
530        // shader blur horizontal
531        fbo_blur_h->Bind();
532        shader_blur_h->Bind();
533        shader_blur_h->SetTexture(shader_blur_h_texture, fbo_blur_v->GetTexture(), 0);
534        shader_blur_h->SetUniform(shader_blur_h_screen_size, vec2(1.0f / glow_fbo_size));
535        shader_blur_h->SetUniform(shader_blur_h_time, fx_angle);
536        shader_blur_h->SetUniform(shader_blur_h_value, 1.0f / screen_size.x);
537        fs_quad();
538        shader_blur_h->Unbind();
539        fbo_blur_h->Unbind();
540        // shader blur vertical
541        fbo_blur_v->Bind();
542        shader_blur_v->Bind();
543        shader_blur_v->SetTexture(shader_blur_v_texture, fbo_blur_h->GetTexture(), 0);
544        shader_blur_v->SetUniform(shader_blur_v_screen_size, vec2(1.0f / glow_fbo_size));
545        shader_blur_v->SetUniform(shader_blur_v_time, fx_angle);
546        shader_blur_v->SetUniform(shader_blur_h_value, 1.0f / screen_size.y);
547        fs_quad();
548        shader_blur_v->Unbind();
549        fbo_blur_v->Unbind();
550        // shader glow
551        fbo_pong->Bind();
552        shader_glow->Bind();
553        shader_glow->SetTexture(shader_glow_texture, fbo_blur_v->GetTexture(), 0);
554        shader_glow->SetTexture(shader_glow_texture_prv, fbo_front->GetTexture(), 1);
555        shader_glow->SetUniform(shader_glow_screen_size, vec2(1.0f));
556        shader_glow->SetUniform(shader_glow_time, fx_angle);
557        shader_glow->SetUniform(shader_glow_step, glow_smoothstep);
558        shader_glow->SetUniform(shader_glow_value1, glow_mix_ratio1);
559        shader_glow->SetUniform(shader_glow_value2, glow_mix_ratio2);
560        fs_quad();
561        shader_glow->Unbind();
562    }
563    if (!m_shader_fx)
564    {
565        // shader simple
566        fbo_pong->Bind();
567        draw_shader_simple(fbo_front, 0);
568    }
569    fbo_pong->Unbind();
570    if (m_shader_postfx)
571    {
572        // shader postfx
573        shader_postfx->Bind();
574        shader_postfx->SetTexture(shader_postfx_texture, fbo_pong->GetTexture(), 0);
575        shader_postfx->SetUniform(shader_postfx_screen_size, (vec2)screen_size);
576        shader_postfx->SetUniform(shader_postfx_time, fx_angle);
577        shader_postfx->SetUniform(shader_postfx_flash, flash_value);
578        shader_postfx->SetUniform(shader_postfx_value, 4.0f);
579        shader_postfx->SetUniform(shader_postfx_deform, postfx_deform);
580        shader_postfx->SetUniform(shader_postfx_scanline, postfx_scanline);
581        shader_postfx->SetUniform(shader_postfx_sync, (float)fabs(beat_value*cosf((main_angle-beat_angle)*8.0f)));
582        fs_quad();
583        shader_postfx->Unbind();
584    }
585    else
586    {
587        // shader simple
588        draw_shader_simple(fbo_pong, 0);
589    }
590
591    glDisableClientState(GL_VERTEX_ARRAY);
592    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
593}
594
595Render::~Render()
596{
597}
Note: See TracBrowser for help on using the repository browser.