Blender  V3.3
Functions | Variables
app/opengl/shader.cpp File Reference
#include "app/opengl/shader.h"
#include "util/log.h"
#include "util/string.h"
#include <GL/glew.h>

Go to the source code of this file.

Functions

static void shader_print_errors (const char *task, const char *log, const char *code)
 
static int compile_shader_program (void)
 

Variables

static CCL_NAMESPACE_BEGIN const char * VERTEX_SHADER
 
static const char * FRAGMENT_SHADER
 

Function Documentation

◆ compile_shader_program()

static int compile_shader_program ( void  )
static

◆ shader_print_errors()

static void shader_print_errors ( const char *  task,
const char *  log,
const char *  code 
)
static

Definition at line 48 of file app/opengl/shader.cpp.

References log(), LOG, and blender::compositor::task.

Referenced by compile_shader_program().

Variable Documentation

◆ FRAGMENT_SHADER

const char* FRAGMENT_SHADER
static
Initial value:
=
"#version 330\n"
"uniform sampler2D image_texture;\n"
"in vec2 texCoord_interp;\n"
"out vec4 fragColor;\n"
"\n"
"void main()\n"
"{\n"
" vec4 rgba = texture(image_texture, texCoord_interp);\n"
" fragColor = pow(rgba, vec4(0.45, 0.45, 0.45, 1.0));\n"
"}\n\0"

Definition at line 35 of file app/opengl/shader.cpp.

Referenced by compile_shader_program().

◆ VERTEX_SHADER

CCL_NAMESPACE_BEGIN const char* VERTEX_SHADER
static
Initial value:
=
"#version 330\n"
"uniform vec2 fullscreen;\n"
"in vec2 texCoord;\n"
"in vec2 pos;\n"
"out vec2 texCoord_interp;\n"
"\n"
"vec2 normalize_coordinates()\n"
"{\n"
" return (vec2(2.0) * (pos / fullscreen)) - vec2(1.0);\n"
"}\n"
"\n"
"void main()\n"
"{\n"
" gl_Position = vec4(normalize_coordinates(), 0.0, 1.0);\n"
" texCoord_interp = texCoord;\n"
"}\n\0"

Definition at line 17 of file app/opengl/shader.cpp.

Referenced by compile_shader_program().