GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
visual_manager_3d_gl.c File Reference
#include "visual_manager.h"
#include "texturing.h"
#include <gpac/options.h>
#include <gpac/nodes_mpeg4.h>
#include "gl_inc.h"
+ Include dependency graph for visual_manager_3d_gl.c:

Macros

#define CHECK_GL_EXT(name)   ((strstr(ext, name) != NULL) ? 1 : 0)
 
#define DEL_SHADER(_a)   if (_a) { glDeleteShader(_a); _a = 0; }
 
#define DEL_PROGRAM(_a)   if (_a) { glDeleteProgram(_a); _a = 0; }
 

Functions

void gf_sc_load_opengl_extensions (GF_Compositor *compositor, Bool has_gl_context)
 
Bool visual_3d_compile_shader (u32 shader_id, const char *name, const char *source)
 
void visual_3d_init_stereo_shaders (GF_VisualManager *visual)
 
void visual_3d_init_yuv_shader (GF_VisualManager *visual)
 
void visual_3d_reset_graphics (GF_VisualManager *visual)
 
GF_Err visual_3d_init_autostereo (GF_VisualManager *visual)
 
void visual_3d_end_auto_stereo_pass (GF_VisualManager *visual)
 
static void visual_3d_setup_quality (GF_VisualManager *visual)
 
void visual_3d_setup (GF_VisualManager *visual)
 
void visual_3d_set_background_state (GF_VisualManager *visual, Bool on)
 
void visual_3d_enable_antialias (GF_VisualManager *visual, Bool bOn)
 
void visual_3d_enable_depth_buffer (GF_VisualManager *visual, Bool on)
 
void visual_3d_enable_headlight (GF_VisualManager *visual, Bool bOn, GF_Camera *cam)
 
void visual_3d_set_viewport (GF_VisualManager *visual, GF_Rect vp)
 
void visual_3d_set_scissor (GF_VisualManager *visual, GF_Rect *vp)
 
void visual_3d_clear_depth (GF_VisualManager *visual)
 
void VS3D_DrawAABBNode (GF_TraverseState *tr_state, GF_Mesh *mesh, u32 prim_type, GF_Plane *fplanes, u32 *p_indices, AABBNode *n)
 
void VS3D_DrawMeshIntern (GF_TraverseState *tr_state, GF_Mesh *mesh)
 
void VS3D_DrawNormals (GF_TraverseState *tr_state, GF_Mesh *mesh)
 
void VS3D_DrawAABBNodeBounds (GF_TraverseState *tr_state, AABBNode *node)
 
void visual_3d_draw_bbox (GF_TraverseState *tr_state, GF_BBox *box)
 
void VS3D_DrawMeshBoundingVolume (GF_TraverseState *tr_state, GF_Mesh *mesh)
 
void visual_3d_mesh_paint (GF_TraverseState *tr_state, GF_Mesh *mesh)
 
void visual_3d_mesh_hatch (GF_TraverseState *tr_state, GF_Mesh *mesh, u32 hatchStyle, SFColor hatchColor)
 
void visual_3d_mesh_strike (GF_TraverseState *tr_state, GF_Mesh *mesh, Fixed width, Fixed line_scale, u32 dash_style)
 
void visual_3d_set_material_2d (GF_VisualManager *visual, SFColor col, Fixed alpha)
 
void visual_3d_set_material_2d_argb (GF_VisualManager *visual, u32 col)
 
void visual_3d_clear (GF_VisualManager *visual, SFColor color, Fixed alpha)
 
void visual_3d_draw_image (GF_VisualManager *visual, Fixed pos_x, Fixed pos_y, u32 width, u32 height, u32 pixelformat, char *data, Fixed scale_x, Fixed scale_y)
 
void visual_3d_matrix_get (GF_VisualManager *visual, u32 mat_type, Fixed *mat)
 
void visual_3d_set_matrix_mode (GF_VisualManager *visual, u32 mat_type)
 
void visual_3d_matrix_reset (GF_VisualManager *visual)
 
void visual_3d_matrix_push (GF_VisualManager *visual)
 
void visual_3d_matrix_add (GF_VisualManager *visual, Fixed *mat)
 
void visual_3d_matrix_pop (GF_VisualManager *visual)
 
void visual_3d_matrix_load (GF_VisualManager *visual, Fixed *mat)
 
void visual_3d_set_clipper_2d (GF_VisualManager *visual, GF_Rect clip)
 
void visual_3d_reset_clipper_2d (GF_VisualManager *visual)
 
void visual_3d_set_clip_plane (GF_VisualManager *visual, GF_Plane p)
 
void visual_3d_reset_clip_plane (GF_VisualManager *visual)
 
void visual_3d_set_material (GF_VisualManager *visual, u32 material_type, Fixed *rgba)
 
void visual_3d_set_shininess (GF_VisualManager *visual, Fixed shininess)
 
void visual_3d_set_state (GF_VisualManager *visual, u32 flag_mask, Bool setOn)
 
Bool visual_3d_add_spot_light (GF_VisualManager *visual, Fixed _ambientIntensity, SFVec3f attenuation, Fixed _beamWidth, SFColor color, Fixed _cutOffAngle, SFVec3f direction, Fixed _intensity, SFVec3f location)
 
Bool visual_3d_add_point_light (GF_VisualManager *visual, Fixed _ambientIntensity, SFVec3f attenuation, SFColor color, Fixed _intensity, SFVec3f location)
 
Bool visual_3d_add_directional_light (GF_VisualManager *visual, Fixed _ambientIntensity, SFColor color, Fixed _intensity, SFVec3f direction)
 
void visual_3d_remove_last_light (GF_VisualManager *visual)
 
void visual_3d_clear_all_lights (GF_VisualManager *visual)
 
void visual_3d_set_fog (GF_VisualManager *visual, const char *type, SFColor color, Fixed density, Fixed visibility)
 
void visual_3d_fill_rect (GF_VisualManager *visual, GF_Rect rc, SFColorRGBA color)
 
GF_Err compositor_3d_get_screen_buffer (GF_Compositor *compositor, GF_VideoSurface *fb, u32 depth_dump_mode)
 
GF_Err compositor_3d_release_screen_buffer (GF_Compositor *compositor, GF_VideoSurface *framebuffer)
 
GF_Err compositor_3d_get_offscreen_buffer (GF_Compositor *compositor, GF_VideoSurface *fb, u32 view_idx, u32 depth_dump_mode)
 
void visual_3d_point_sprite (GF_VisualManager *visual, Drawable *stack, GF_TextureHandler *txh, GF_TraverseState *tr_state)
 

Variables

proc_glActiveTexture glActiveTexture = 0
 
proc_glClientActiveTexture glClientActiveTexture = 0
 
proc_glBlendEquation glBlendEquation = 0
 
proc_glPointParameterf glPointParameterf = 0
 
proc_glPointParameterfv glPointParameterfv = 0
 
proc_glGenBuffers glGenBuffers = 0
 
proc_glDeleteBuffers glDeleteBuffers = 0
 
proc_glBindBuffer glBindBuffer = 0
 
proc_glBufferData glBufferData = 0
 
proc_glBufferSubData glBufferSubData = 0
 
proc_glCreateProgram glCreateProgram = 0
 
proc_glDeleteProgram glDeleteProgram = 0
 
proc_glLinkProgram glLinkProgram = 0
 
proc_glUseProgram glUseProgram = 0
 
proc_glCreateShader glCreateShader = 0
 
proc_glDeleteShader glDeleteShader = 0
 
proc_glShaderSource glShaderSource = 0
 
proc_glCompileShader glCompileShader = 0
 
proc_glAttachShader glAttachShader = 0
 
proc_glDetachShader glDetachShader = 0
 
proc_glGetShaderiv glGetShaderiv = 0
 
proc_glGetInfoLogARB glGetInfoLogARB = 0
 
proc_glGetUniformLocation glGetUniformLocation = 0
 
proc_glUniform1f glUniform1f = 0
 
proc_glUniform2f glUniform2f = 0
 
proc_glUniform3f glUniform3f = 0
 
proc_glUniform4f glUniform4f = 0
 
proc_glUniform1i glUniform1i = 0
 
proc_glUniform2i glUniform2i = 0
 
proc_glUniform3i glUniform3i = 0
 
proc_glUniform4i glUniform4i = 0
 
proc_glUniform1fv glUniform1fv = 0
 
proc_glUniform2fv glUniform2fv = 0
 
proc_glUniform3fv glUniform3fv = 0
 
proc_glUniform4fv glUniform4fv = 0
 
proc_glUniform1iv glUniform1iv = 0
 
proc_glUniform2iv glUniform2iv = 0
 
proc_glUniform3iv glUniform3iv = 0
 
proc_glUniform4iv glUniform4iv = 0
 
proc_glUniformMatrix2fv glUniformMatrix2fv = 0
 
proc_glUniformMatrix3fv glUniformMatrix3fv = 0
 
proc_glUniformMatrix4fv glUniformMatrix4fv = 0
 
proc_glUniformMatrix2x3fv glUniformMatrix2x3fv = 0
 
proc_glUniformMatrix3x2fv glUniformMatrix3x2fv = 0
 
proc_glUniformMatrix2x4fv glUniformMatrix2x4fv = 0
 
proc_glUniformMatrix4x2fv glUniformMatrix4x2fv = 0
 
proc_glUniformMatrix3x4fv glUniformMatrix3x4fv = 0
 
proc_glUniformMatrix4x3fv glUniformMatrix4x3fv = 0
 
static char * default_glsl_vertex
 
static char * glsl_view_anaglyph
 
static char * glsl_view_columns
 
static char * glsl_view_rows
 
static char * glsl_view_5VSP19
 
static char * glsl_yuv_shader
 
static char * glsl_yuv_rect_shader_strict
 
static char * glsl_yuv_rect_shader_relaxed
 
static GLubyte hatch_horiz []
 
static GLubyte hatch_vert []
 
static GLubyte hatch_up []
 
static GLubyte hatch_down []
 
static GLubyte hatch_cross []
 

Macro Definition Documentation

#define CHECK_GL_EXT (   name)    ((strstr(ext, name) != NULL) ? 1 : 0)

! HORRIBLE HACK, but on my test devices, it seems that glClipPlanex is missing on the device but not in the SDK lib !!

#define DEL_SHADER (   _a)    if (_a) { glDeleteShader(_a); _a = 0; }
#define DEL_PROGRAM (   _a)    if (_a) { glDeleteProgram(_a); _a = 0; }

Function Documentation

void gf_sc_load_opengl_extensions ( GF_Compositor *  compositor,
Bool  has_gl_context 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool visual_3d_compile_shader ( u32  shader_id,
const char *  name,
const char *  source 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_init_stereo_shaders ( GF_VisualManager *  visual)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_init_yuv_shader ( GF_VisualManager *  visual)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_reset_graphics ( GF_VisualManager *  visual)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err visual_3d_init_autostereo ( GF_VisualManager *  visual)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_end_auto_stereo_pass ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

static void visual_3d_setup_quality ( GF_VisualManager *  visual)
static

+ Here is the caller graph for this function:

void visual_3d_setup ( GF_VisualManager *  visual)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_set_background_state ( GF_VisualManager *  visual,
Bool  on 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_enable_antialias ( GF_VisualManager *  visual,
Bool  bOn 
)

+ Here is the caller graph for this function:

void visual_3d_enable_depth_buffer ( GF_VisualManager *  visual,
Bool  on 
)

+ Here is the caller graph for this function:

void visual_3d_enable_headlight ( GF_VisualManager *  visual,
Bool  bOn,
GF_Camera cam 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_set_viewport ( GF_VisualManager *  visual,
GF_Rect  vp 
)

+ Here is the caller graph for this function:

void visual_3d_set_scissor ( GF_VisualManager *  visual,
GF_Rect vp 
)

+ Here is the caller graph for this function:

void visual_3d_clear_depth ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void VS3D_DrawAABBNode ( GF_TraverseState *  tr_state,
GF_Mesh mesh,
u32  prim_type,
GF_Plane fplanes,
u32 p_indices,
AABBNode n 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VS3D_DrawMeshIntern ( GF_TraverseState *  tr_state,
GF_Mesh mesh 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VS3D_DrawNormals ( GF_TraverseState *  tr_state,
GF_Mesh mesh 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VS3D_DrawAABBNodeBounds ( GF_TraverseState *  tr_state,
AABBNode node 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_draw_bbox ( GF_TraverseState *  tr_state,
GF_BBox box 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VS3D_DrawMeshBoundingVolume ( GF_TraverseState *  tr_state,
GF_Mesh mesh 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_mesh_paint ( GF_TraverseState *  tr_state,
GF_Mesh mesh 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_mesh_hatch ( GF_TraverseState *  tr_state,
GF_Mesh mesh,
u32  hatchStyle,
SFColor  hatchColor 
)

+ Here is the caller graph for this function:

void visual_3d_mesh_strike ( GF_TraverseState *  tr_state,
GF_Mesh mesh,
Fixed  width,
Fixed  line_scale,
u32  dash_style 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_set_material_2d ( GF_VisualManager *  visual,
SFColor  col,
Fixed  alpha 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_set_material_2d_argb ( GF_VisualManager *  visual,
u32  col 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_clear ( GF_VisualManager *  visual,
SFColor  color,
Fixed  alpha 
)

+ Here is the caller graph for this function:

void visual_3d_draw_image ( GF_VisualManager *  visual,
Fixed  pos_x,
Fixed  pos_y,
u32  width,
u32  height,
u32  pixelformat,
char *  data,
Fixed  scale_x,
Fixed  scale_y 
)

+ Here is the caller graph for this function:

void visual_3d_matrix_get ( GF_VisualManager *  visual,
u32  mat_type,
Fixed mat 
)

+ Here is the caller graph for this function:

void visual_3d_set_matrix_mode ( GF_VisualManager *  visual,
u32  mat_type 
)

+ Here is the caller graph for this function:

void visual_3d_matrix_reset ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_matrix_push ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_matrix_add ( GF_VisualManager *  visual,
Fixed mat 
)

+ Here is the caller graph for this function:

void visual_3d_matrix_pop ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_matrix_load ( GF_VisualManager *  visual,
Fixed mat 
)

+ Here is the caller graph for this function:

void visual_3d_set_clipper_2d ( GF_VisualManager *  visual,
GF_Rect  clip 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_reset_clipper_2d ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_set_clip_plane ( GF_VisualManager *  visual,
GF_Plane  p 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_reset_clip_plane ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_set_material ( GF_VisualManager *  visual,
u32  material_type,
Fixed rgba 
)

+ Here is the caller graph for this function:

void visual_3d_set_shininess ( GF_VisualManager *  visual,
Fixed  shininess 
)

+ Here is the caller graph for this function:

void visual_3d_set_state ( GF_VisualManager *  visual,
u32  flag_mask,
Bool  setOn 
)

+ Here is the caller graph for this function:

Bool visual_3d_add_spot_light ( GF_VisualManager *  visual,
Fixed  _ambientIntensity,
SFVec3f  attenuation,
Fixed  _beamWidth,
SFColor  color,
Fixed  _cutOffAngle,
SFVec3f  direction,
Fixed  _intensity,
SFVec3f  location 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool visual_3d_add_point_light ( GF_VisualManager *  visual,
Fixed  _ambientIntensity,
SFVec3f  attenuation,
SFColor  color,
Fixed  _intensity,
SFVec3f  location 
)

+ Here is the caller graph for this function:

Bool visual_3d_add_directional_light ( GF_VisualManager *  visual,
Fixed  _ambientIntensity,
SFColor  color,
Fixed  _intensity,
SFVec3f  direction 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_remove_last_light ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_clear_all_lights ( GF_VisualManager *  visual)

+ Here is the caller graph for this function:

void visual_3d_set_fog ( GF_VisualManager *  visual,
const char *  type,
SFColor  color,
Fixed  density,
Fixed  visibility 
)

+ Here is the caller graph for this function:

void visual_3d_fill_rect ( GF_VisualManager *  visual,
GF_Rect  rc,
SFColorRGBA  color 
)

+ Here is the caller graph for this function:

GF_Err compositor_3d_get_screen_buffer ( GF_Compositor *  compositor,
GF_VideoSurface fb,
u32  depth_dump_mode 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err compositor_3d_release_screen_buffer ( GF_Compositor *  compositor,
GF_VideoSurface framebuffer 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err compositor_3d_get_offscreen_buffer ( GF_Compositor *  compositor,
GF_VideoSurface fb,
u32  view_idx,
u32  depth_dump_mode 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void visual_3d_point_sprite ( GF_VisualManager *  visual,
Drawable *  stack,
GF_TextureHandler txh,
GF_TraverseState *  tr_state 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

proc_glActiveTexture glActiveTexture = 0
proc_glClientActiveTexture glClientActiveTexture = 0
proc_glBlendEquation glBlendEquation = 0
proc_glPointParameterf glPointParameterf = 0
proc_glPointParameterfv glPointParameterfv = 0
proc_glGenBuffers glGenBuffers = 0
proc_glDeleteBuffers glDeleteBuffers = 0
proc_glBindBuffer glBindBuffer = 0
proc_glBufferData glBufferData = 0
proc_glBufferSubData glBufferSubData = 0
proc_glCreateProgram glCreateProgram = 0
proc_glDeleteProgram glDeleteProgram = 0
proc_glLinkProgram glLinkProgram = 0
proc_glUseProgram glUseProgram = 0
proc_glCreateShader glCreateShader = 0
proc_glDeleteShader glDeleteShader = 0
proc_glShaderSource glShaderSource = 0
proc_glCompileShader glCompileShader = 0
proc_glAttachShader glAttachShader = 0
proc_glDetachShader glDetachShader = 0
proc_glGetShaderiv glGetShaderiv = 0
proc_glGetInfoLogARB glGetInfoLogARB = 0
proc_glGetUniformLocation glGetUniformLocation = 0
proc_glUniform1f glUniform1f = 0
proc_glUniform2f glUniform2f = 0
proc_glUniform3f glUniform3f = 0
proc_glUniform4f glUniform4f = 0
proc_glUniform1i glUniform1i = 0
proc_glUniform2i glUniform2i = 0
proc_glUniform3i glUniform3i = 0
proc_glUniform4i glUniform4i = 0
proc_glUniform1fv glUniform1fv = 0
proc_glUniform2fv glUniform2fv = 0
proc_glUniform3fv glUniform3fv = 0
proc_glUniform4fv glUniform4fv = 0
proc_glUniform1iv glUniform1iv = 0
proc_glUniform2iv glUniform2iv = 0
proc_glUniform3iv glUniform3iv = 0
proc_glUniform4iv glUniform4iv = 0
proc_glUniformMatrix2fv glUniformMatrix2fv = 0
proc_glUniformMatrix3fv glUniformMatrix3fv = 0
proc_glUniformMatrix4fv glUniformMatrix4fv = 0
proc_glUniformMatrix2x3fv glUniformMatrix2x3fv = 0
proc_glUniformMatrix3x2fv glUniformMatrix3x2fv = 0
proc_glUniformMatrix2x4fv glUniformMatrix2x4fv = 0
proc_glUniformMatrix4x2fv glUniformMatrix4x2fv = 0
proc_glUniformMatrix3x4fv glUniformMatrix3x4fv = 0
proc_glUniformMatrix4x3fv glUniformMatrix4x3fv = 0
char* default_glsl_vertex
static
Initial value:
= "\
varying vec3 gfNormal;\
varying vec3 gfView;\
void main(void)\
{\
gfView = vec3(gl_ModelViewMatrix * gl_Vertex);\
gfNormal = normalize(gl_NormalMatrix * gl_Normal);\
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\
gl_TexCoord[0] = gl_MultiTexCoord0;\
}"
char* glsl_view_anaglyph
static
Initial value:
= "\
uniform sampler2D gfView1;\
uniform sampler2D gfView2;\
void main(void) \
{\
vec4 col1 = texture2D(gfView1, gl_TexCoord[0].st); \
vec4 col2 = texture2D(gfView2, gl_TexCoord[0].st); \
gl_FragColor.r = col1.r;\
gl_FragColor.g = col2.g;\
gl_FragColor.b = col2.b;\
}"
char* glsl_view_columns
static
Initial value:
= "\
uniform sampler2D gfView1;\
uniform sampler2D gfView2;\
void main(void) \
{\
if ( int( mod(gl_FragCoord.x, 2.0) ) == 0) \
gl_FragColor = texture2D(gfView1, gl_TexCoord[0].st); \
else \
gl_FragColor = texture2D(gfView2, gl_TexCoord[0].st); \
}"
char* glsl_view_rows
static
Initial value:
= "\
uniform sampler2D gfView1;\
uniform sampler2D gfView2;\
void main(void) \
{\
if ( int( mod(gl_FragCoord.y, 2.0) ) == 0) \
gl_FragColor = texture2D(gfView1, gl_TexCoord[0].st); \
else \
gl_FragColor = texture2D(gfView2, gl_TexCoord[0].st); \
}"
char* glsl_view_5VSP19
static
Initial value:
= "\
uniform sampler2D gfView1;\
uniform sampler2D gfView2;\
uniform sampler2D gfView3;\
uniform sampler2D gfView4;\
uniform sampler2D gfView5;\
void main(void) {\
vec4 color[5];\
color[0] = texture2D(gfView5, gl_TexCoord[0].st);\
color[1] = texture2D(gfView4, gl_TexCoord[0].st);\
color[2] = texture2D(gfView3, gl_TexCoord[0].st);\
color[3] = texture2D(gfView2, gl_TexCoord[0].st);\
color[4] = texture2D(gfView1, gl_TexCoord[0].st);\
float pitch = 5.0 + 1.0 - mod(gl_FragCoord.y , 5.0);\
int col = int( mod(pitch + 3.0 * (gl_FragCoord.x), 5.0 ) );\
int Vr = int(col);\
int Vg = int(col) + 1;\
int Vb = int(col) + 2;\
if (Vg >= 5) Vg -= 5;\
if (Vb >= 5) Vb -= 5;\
gl_FragColor.r = color[Vr].r;\
gl_FragColor.g = color[Vg].g;\
gl_FragColor.b = color[Vb].b;\
}"
char* glsl_yuv_shader
static
Initial value:
= "\
uniform sampler2D y_plane;\
uniform sampler2D u_plane;\
uniform sampler2D v_plane;\
const vec3 offset = vec3(-0.0625, -0.5, -0.5);\
const vec3 R_mul = vec3(1.164, 0.000, 1.596);\
const vec3 G_mul = vec3(1.164, -0.391, -0.813);\
const vec3 B_mul = vec3(1.164, 2.018, 0.000);\
void main(void) \
{\
vec2 texc;\
vec3 yuv, rgb;\
texc = gl_TexCoord[0].st;\
texc.y = 1.0 - texc.y;\
yuv.x = texture2D(y_plane, texc).r; \
yuv.y = texture2D(u_plane, texc).r; \
yuv.z = texture2D(v_plane, texc).r; \
yuv += offset; \
rgb.r = dot(yuv, R_mul); \
rgb.g = dot(yuv, G_mul); \
rgb.b = dot(yuv, B_mul); \
gl_FragColor = vec4(rgb, 1.0);\
}"
char* glsl_yuv_rect_shader_strict
static
char* glsl_yuv_rect_shader_relaxed
static
Initial value:
= "\
uniform sampler2DRect y_plane;\
uniform sampler2DRect u_plane;\
uniform sampler2DRect v_plane;\
uniform float width;\
uniform float height;\
const vec3 offset = vec3(-0.0625, -0.5, -0.5);\
const vec3 R_mul = vec3(1.164, 0.000, 1.596);\
const vec3 G_mul = vec3(1.164, -0.391, -0.813);\
const vec3 B_mul = vec3(1.164, 2.018, 0.000);\
void main(void) \
{\
vec2 texc;\
vec3 yuv, rgb;\
texc = gl_TexCoord[0].st;\
texc.y = 1.0 - texc.y;\
texc.x *= width;\
texc.y *= height;\
yuv.x = texture2DRect(y_plane, texc).r; \
texc.x /= 2.0;\
texc.y /= 2.0;\
yuv.y = texture2DRect(u_plane, texc).r; \
yuv.z = texture2DRect(v_plane, texc).r; \
yuv += offset; \
rgb.r = dot(yuv, R_mul); \
rgb.g = dot(yuv, G_mul); \
rgb.b = dot(yuv, B_mul); \
gl_FragColor = vec4(rgb, 1.0);\
}"
GLubyte hatch_horiz[]
static
Initial value:
= {
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
}
GLubyte hatch_vert[]
static
Initial value:
= {
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa
}
GLubyte hatch_up[]
static
Initial value:
= {
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03,
0xc0, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30,
0x0c, 0x0c, 0x0c, 0x0c, 0x03, 0x03, 0x03, 0x03
}
GLubyte hatch_down[]
static
Initial value:
= {
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0,
0x03, 0x03, 0x03, 0x03, 0x0c, 0x0c, 0x0c, 0x0c,
0x30, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0xc0
}
GLubyte hatch_cross[]
static
Initial value:
= {
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c
}