-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyramid_point_renderer.cc
62 lines (47 loc) · 2.3 KB
/
pyramid_point_renderer.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
** pyramid_point_render.cc Pyramid Point Based Rendering.
**
**
** history: created 02-Jul-07
*/
#include "pyramid_point_renderer.h"
/**
* Default constructor.
**/
PyramidPointRenderer::PyramidPointRenderer(int w, int h) : PyramidPointRendererBase(w, h, 2) {
}
/**
* Installs the shaders using the GLSL Kernel class.
**/
void PyramidPointRenderer::createShaders ( void ) {
// Store texture names to be passed as uniforms
shader_texture_names = new string[fbo_buffers_count];
shader_texture_names[0] = "textureA";
shader_texture_names[1] = "textureB";
bool link;
// mShaderProjection.SetSources(loadShaderSource("shader_point_projection.vert").toAscii().data(), loadShaderSource("shader_point_projection.frag").toAscii().data());
mShaderProjection.LoadSources("shaders/shader_point_projection.vert", "shaders/shader_point_projection.frag");
link = mShaderProjection.prog.Link();
std::string compileinfo = mShaderProjection.fshd.InfoLog();
std::cout << "Projection Frag shader info : " << compileinfo << "\n";
assert (link == 1);
// mShaderAnalysis.SetSources(loadShaderSource("shader_analysis.vert").toAscii().data(), loadShaderSource("shader_analysis.frag").toAscii().data());
mShaderAnalysis.LoadSources("shaders/shader_analysis.vert", "shaders/shader_analysis.frag");
link = mShaderAnalysis.prog.Link();
compileinfo = mShaderAnalysis.fshd.InfoLog();
std::cout << "Analysis Frag shader info : " << compileinfo << "\n";
assert (link == 1);
// mShaderSynthesis.SetSources(loadShaderSource("shader_synthesis.vert").toAscii().data(), loadShaderSource("shader_synthesis.frag").toAscii().data());
mShaderSynthesis.LoadSources("shaders/shader_synthesis.vert", "shaders/shader_synthesis.frag");
link = mShaderSynthesis.prog.Link();
compileinfo = mShaderSynthesis.fshd.InfoLog();
std::cout << "Synthesis Frag shader info : " << compileinfo << "\n";
assert (link == 1);
// mShaderPhong.SetSources(loadShaderSource("shader_phong.vert").toAscii().data(), loadShaderSource("shader_phong.frag").toAscii().data());
mShaderPhong.LoadSources("shaders/shader_phong.vert", "shaders/shader_phong.frag");
link = mShaderPhong.prog.Link();
compileinfo = mShaderPhong.fshd.InfoLog();
std::cout << "Phong Frag shader info : " << compileinfo << "\n";
assert (link == 1);
check_for_ogl_error("shaders loading");
}