Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Romanov <a.romanov@blend4web.com>2015-12-26 00:57:50 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2015-12-27 00:15:23 +0300
commit700c40e2f9b59b7e780429fdc10fb0d2d5d117a1 (patch)
tree8a6ed722fba1e652fe9756276c83da3467f396aa /source/blender/gpu/GPU_basic_shader.h
parent58cf3327e481cea3dbd2c1c0b89b02d4d2ca7be4 (diff)
OpenGL: stipple support added to basic GLSL shader
The is intended to replace the deprecated glPolygonStipple() calls with a shader based alternative, once we switch over to GLSL shaders. Reviewers: brecht Differential Revision: https://developer.blender.org/D1688
Diffstat (limited to 'source/blender/gpu/GPU_basic_shader.h')
-rw-r--r--source/blender/gpu/GPU_basic_shader.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_basic_shader.h b/source/blender/gpu/GPU_basic_shader.h
index 3298f0f35b4..f964e056d44 100644
--- a/source/blender/gpu/GPU_basic_shader.h
+++ b/source/blender/gpu/GPU_basic_shader.h
@@ -47,10 +47,27 @@ typedef enum GPUBasicShaderOption {
GPU_SHADER_TEXTURE_2D = (1<<3), /* use 2D texture to replace diffuse color */
GPU_SHADER_SOLID_LIGHTING = (1<<4), /* use faster lighting (set automatically) */
- GPU_SHADER_OPTIONS_NUM = 5,
+ GPU_SHADER_STIPPLE = (1<<5), /* use stipple */
+ GPU_SHADER_OPTIONS_NUM = 6,
GPU_SHADER_OPTION_COMBINATIONS = (1<<GPU_SHADER_OPTIONS_NUM)
} GPUBasicShaderOption;
+/* Keep these in sync with gpu_shader_basic_frag.glsl */
+typedef enum GPUBasicShaderStipple {
+ GPU_SHADER_STIPPLE_HALFTONE = 0,
+ GPU_SHADER_STIPPLE_QUARTTONE = 1,
+ GPU_SHADER_STIPPLE_CHECKER_8PX = 2,
+ GPU_SHADER_STIPPLE_HEXAGON = 3,
+ GPU_SHADER_STIPPLE_DIAG_STRIPES = 4,
+ GPU_SHADER_STIPPLE_DIAG_STRIPES_SWAP = 5,
+ GPU_SHADER_STIPPLE_S3D_INTERLACE_ROW = 6,
+ GPU_SHADER_STIPPLE_S3D_INTERLACE_ROW_SWAP = 7,
+ GPU_SHADER_STIPPLE_S3D_INTERLACE_COLUMN = 8,
+ GPU_SHADER_STIPPLE_S3D_INTERLACE_COLUMN_SWAP = 9,
+ GPU_SHADER_STIPPLE_S3D_INTERLACE_CHECKER = 10,
+ GPU_SHADER_STIPPLE_S3D_INTERLACE_CHECKER_SWAP = 11
+} GPUBasicShaderStipple;
+
void GPU_basic_shaders_init(void);
void GPU_basic_shaders_exit(void);
@@ -87,6 +104,7 @@ typedef struct GPULightData {
void GPU_basic_shader_light_set(int light_num, GPULightData *light);
void GPU_basic_shader_light_set_viewer(bool local);
+void GPU_basic_shader_stipple(GPUBasicShaderStipple stipple_id);
#ifdef __cplusplus
}