Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
OutputHaze.cpp
1 #include <GLviewer/OutputAttachments/OutputHaze.hh>
2 
3 using namespace std;
4 using namespace BIAS;
5 
6 OutputHaze::OutputHaze(BIAS::glfRenderTarget *out)
8 {
9  InitShader_();
10 }
11 
13 
14 }
15 
16 int OutputHaze::
18  string vertexCode =
19  "void main()\r\n"
20  "{\r\n"
21  " gl_TexCoord[0] = gl_MultiTexCoord0;\r\n"
22  " gl_Position = ftransform();\r\n"
23  "}\r\n";
24  string fragmentCode =
25  "uniform sampler2D tex;\r\n"
26  "uniform sampler2D dep;\r\n"
27  "uniform float w;\r\n"
28  "uniform float h;\r\n"
29  "void main()\r\n"
30  "{\r\n"
31  " vec4 color;\r\n"
32  " vec2 pos = gl_TexCoord[0].st;\r\n"
33  " color = texture2D(tex,pos);\r\n"
34  " float blue = color[2];\r\n"
35  // scale other
36  " color = color * (vec4(1.0)-texture2D(dep, pos));\r\n"
37  " color[0] += 0.0;\r\n"
38  " color[1] += 0.075;\r\n"
39  " color[2] = blue+0.1;\r\n"
40  " color[3] = 1.0;\r\n"
41  " gl_FragColor = color;\r\n"
42  " gl_FragDepth =texture2D(dep, pos).r;\r\n"
43  "}\r\n";
44 
45  return GLProjectionOutputAttachment::InitShader(vertexCode, fragmentCode);
46 }
int InitShader(std::string vertexCode, std::string fragmentCode)
can be called to create output attachment without having to derive new subclass will also create FBO ...
int InitShader_()
creates strings with shader code and calls InitShader(vertex, fragment) from superclass ...
Definition: OutputHaze.cpp:17
virtual ~OutputHaze()
Definition: OutputHaze.cpp:12
Class for extra rendering pass in GLProjection (for now only used in glutGLviewer) ...
Interface for render targets.