Functions | Variables
opengl3.cpp File Reference
#include "opengl3.h"
#include <glad/glad.h>
#include <assert.h>
#include <iostream>
Include dependency graph for opengl3.cpp:

Go to the source code of this file.

Functions

void _check_gl_error (const char *file, int line)
 
void clear_gl_errors ()
 

Variables

static const char * fragment_shader_text
 
static const char * splash_shader_text
 
static const char * vertex_shader_text
 

Function Documentation

void _check_gl_error ( const char *  file,
int  line 
)

Definition at line 690 of file opengl3.cpp.

void clear_gl_errors ( )

Definition at line 722 of file opengl3.cpp.

Variable Documentation

const char* fragment_shader_text
static
Initial value:
=
"#version 110\n"
"varying vec2 textCoords;\n"
"uniform sampler2D textureSampler;\n"
"uniform float opacity;\n"
"void main(void) {\n"
" vec2 tex = vec2(textCoords.x, 1.0 - textCoords.y);\n"
" vec4 color = texture2D(textureSampler, tex);\n"
" gl_FragColor = vec4(color.xyz, opacity);\n"
"}"

Definition at line 245 of file opengl3.cpp.

const char* splash_shader_text
static
Initial value:
=
"#version 110\n"
"varying vec2 textCoords;\n"
"uniform sampler2D textureSampler;\n"
"uniform float opacity;\n"
"uniform vec2 rayOrigin;\n"
"uniform float power;\n"
"void main(void) {\n"
" vec4 FragColor = texture2D(textureSampler, textCoords);\n"
" int samples = 120;\n"
" vec2 delta = vec2(textCoords - rayOrigin);\n"
" delta *= 1.0 / float(samples) * 0.99;"
" vec2 coord = textCoords;\n"
" float illuminationDecay = power;\n"
" for(int i=0; i < samples ; i++)\n"
" {\n"
" coord -= delta;\n"
" vec4 texel = texture2D(textureSampler, coord);\n"
" texel *= illuminationDecay * 0.4;\n"
" texel.x *= 80.0 / 255.0;\n"
" texel.y *= 99.0 / 255.0;\n"
" texel.z *= 115.0 / 255.0;\n"
" FragColor += texel;\n"
" illuminationDecay *= power;\n"
" }\n"
" FragColor = clamp(FragColor, 0.0, 1.0);\n"
" gl_FragColor = vec4(FragColor.xyz, opacity);\n"
"}"

Definition at line 216 of file opengl3.cpp.

const char* vertex_shader_text
static
Initial value:
=
"#version 110\n"
"attribute vec3 position;\n"
"attribute vec2 textureCoords;\n"
"varying vec2 textCoords;\n"
"uniform vec2 elementPosition;\n"
"uniform vec2 elementScale;\n"
"void main(void)\n"
"{\n"
" gl_Position = vec4(position * vec3(elementScale, 1.0) + vec3(elementPosition, 0.0), 1.0);\n"
" textCoords = textureCoords;\n"
"}"

Definition at line 203 of file opengl3.cpp.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:27