diff options
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/CMakeLists.txt | 12 | ||||
-rw-r--r-- | source/blender/gpu/GPU_basic_shader.h (renamed from source/blender/gpu/GPU_simple_shader.h) | 24 | ||||
-rw-r--r-- | source/blender/gpu/SConscript | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_basic_shader.c (renamed from source/blender/gpu/intern/gpu_simple_shader.c) | 32 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 8 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 30 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 6 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_basic_frag.glsl (renamed from source/blender/gpu/shaders/gpu_shader_simple_frag.glsl) | 0 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_basic_vert.glsl (renamed from source/blender/gpu/shaders/gpu_shader_simple_vert.glsl) | 0 |
9 files changed, 58 insertions, 58 deletions
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 328623f884f..60fa77babd9 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -52,7 +52,7 @@ set(SRC intern/gpu_extensions.c intern/gpu_init_exit.c intern/gpu_material.c - intern/gpu_simple_shader.c + intern/gpu_basic_shader.c intern/gpu_select.c intern/gpu_compositing.c intern/gpu_debug.c @@ -71,8 +71,8 @@ set(SRC shaders/gpu_shader_material.glsl shaders/gpu_shader_sep_gaussian_blur_frag.glsl shaders/gpu_shader_sep_gaussian_blur_vert.glsl - shaders/gpu_shader_simple_frag.glsl - shaders/gpu_shader_simple_vert.glsl + shaders/gpu_shader_basic_frag.glsl + shaders/gpu_shader_basic_vert.glsl shaders/gpu_shader_vertex.glsl shaders/gpu_shader_vsm_store_frag.glsl shaders/gpu_shader_vsm_store_vert.glsl @@ -85,7 +85,7 @@ set(SRC GPU_glew.h GPU_init_exit.h GPU_material.h - GPU_simple_shader.h + GPU_basic_shader.h GPU_select.h GPU_compositing.h intern/gpu_codegen.h @@ -98,8 +98,8 @@ data_to_c_simple(shaders/gpu_program_smoke_color_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_material.glsl SRC) data_to_c_simple(shaders/gpu_shader_sep_gaussian_blur_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_sep_gaussian_blur_vert.glsl SRC) -data_to_c_simple(shaders/gpu_shader_simple_frag.glsl SRC) -data_to_c_simple(shaders/gpu_shader_simple_vert.glsl SRC) +data_to_c_simple(shaders/gpu_shader_basic_frag.glsl SRC) +data_to_c_simple(shaders/gpu_shader_basic_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_vertex.glsl SRC) data_to_c_simple(shaders/gpu_shader_vertex_world.glsl SRC) data_to_c_simple(shaders/gpu_shader_vsm_store_frag.glsl SRC) diff --git a/source/blender/gpu/GPU_simple_shader.h b/source/blender/gpu/GPU_basic_shader.h index b62abc6152a..3298f0f35b4 100644 --- a/source/blender/gpu/GPU_simple_shader.h +++ b/source/blender/gpu/GPU_basic_shader.h @@ -25,12 +25,12 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file GPU_simple_shader.h +/** \file GPU_basic_shader.h * \ingroup gpu */ -#ifndef __GPU_SIMPLE_SHADER_H__ -#define __GPU_SIMPLE_SHADER_H__ +#ifndef __GPU_BASIC_SHADER_H__ +#define __GPU_BASIC_SHADER_H__ #include "BLI_utildefines.h" @@ -40,7 +40,7 @@ extern "C" { /* Fixed Function Shader */ -typedef enum GPUSimpleShaderOption { +typedef enum GPUBasicShaderOption { GPU_SHADER_USE_COLOR = (1<<0), /* use glColor, for lighting it replaces diffuse */ GPU_SHADER_LIGHTING = (1<<1), /* use lighting */ GPU_SHADER_TWO_SIDED = (1<<2), /* flip normals towards viewer */ @@ -49,15 +49,15 @@ typedef enum GPUSimpleShaderOption { GPU_SHADER_SOLID_LIGHTING = (1<<4), /* use faster lighting (set automatically) */ GPU_SHADER_OPTIONS_NUM = 5, GPU_SHADER_OPTION_COMBINATIONS = (1<<GPU_SHADER_OPTIONS_NUM) -} GPUSimpleShaderOption; +} GPUBasicShaderOption; -void GPU_simple_shaders_init(void); -void GPU_simple_shaders_exit(void); +void GPU_basic_shaders_init(void); +void GPU_basic_shaders_exit(void); -void GPU_simple_shader_bind(int options); -int GPU_simple_shader_bound_options(void); +void GPU_basic_shader_bind(int options); +int GPU_basic_shader_bound_options(void); -void GPU_simple_shader_colors(const float diffuse[3], const float specular[3], +void GPU_basic_shader_colors(const float diffuse[3], const float specular[3], int shininess, float alpha); /* Fixed Function Lighting */ @@ -85,8 +85,8 @@ typedef struct GPULightData { float spot_exponent; } GPULightData; -void GPU_simple_shader_light_set(int light_num, GPULightData *light); -void GPU_simple_shader_light_set_viewer(bool local); +void GPU_basic_shader_light_set(int light_num, GPULightData *light); +void GPU_basic_shader_light_set_viewer(bool local); #ifdef __cplusplus } diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript index d27d5b09b56..15898f5c203 100644 --- a/source/blender/gpu/SConscript +++ b/source/blender/gpu/SConscript @@ -70,8 +70,8 @@ sources.extend(( os.path.join(env['DATA_SOURCES'], "gpu_shader_geometry.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_program_smoke_frag.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_program_smoke_color_frag.glsl.c"), - os.path.join(env['DATA_SOURCES'], "gpu_shader_simple_frag.glsl.c"), - os.path.join(env['DATA_SOURCES'], "gpu_shader_simple_vert.glsl.c"), + os.path.join(env['DATA_SOURCES'], "gpu_shader_basic_frag.glsl.c"), + os.path.join(env['DATA_SOURCES'], "gpu_shader_basic_vert.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_fx_ssao_frag.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_fx_dof_hq_frag.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_fx_dof_hq_vert.glsl.c"), diff --git a/source/blender/gpu/intern/gpu_simple_shader.c b/source/blender/gpu/intern/gpu_basic_shader.c index ea26d1da675..2dcee877279 100644 --- a/source/blender/gpu/intern/gpu_simple_shader.c +++ b/source/blender/gpu/intern/gpu_basic_shader.c @@ -25,7 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/gpu/intern/gpu_simple_shader.c +/** \file blender/gpu/intern/gpu_basic_shader.c * \ingroup gpu * * GLSL shaders to replace fixed function OpenGL materials and lighting. These @@ -48,7 +48,7 @@ #include "BLI_utildefines.h" #include "GPU_extensions.h" -#include "GPU_simple_shader.h" +#include "GPU_basic_shader.h" /* State */ @@ -66,12 +66,12 @@ static struct { /* Init / exit */ -void GPU_simple_shaders_init(void) +void GPU_basic_shaders_init(void) { memset(&GPU_MATERIAL_STATE, 0, sizeof(GPU_MATERIAL_STATE)); } -void GPU_simple_shaders_exit(void) +void GPU_basic_shaders_exit(void) { int i; @@ -117,11 +117,11 @@ static int detect_options() } #endif -static GPUShader *gpu_simple_shader(int options) +static GPUShader *gpu_basic_shader(int options) { /* glsl code */ - extern char datatoc_gpu_shader_simple_vert_glsl[]; - extern char datatoc_gpu_shader_simple_frag_glsl[]; + extern char datatoc_gpu_shader_basic_vert_glsl[]; + extern char datatoc_gpu_shader_basic_frag_glsl[]; GPUShader *shader; /* detect if we can do faster lighting for solid draw mode */ @@ -149,8 +149,8 @@ static GPUShader *gpu_simple_shader(int options) strcat(defines, "#define USE_SCENE_LIGHTING\n"); shader = GPU_shader_create( - datatoc_gpu_shader_simple_vert_glsl, - datatoc_gpu_shader_simple_frag_glsl, + datatoc_gpu_shader_basic_vert_glsl, + datatoc_gpu_shader_basic_frag_glsl, NULL, NULL, defines, 0, 0, 0); @@ -171,11 +171,11 @@ static GPUShader *gpu_simple_shader(int options) /* Bind / unbind */ -void GPU_simple_shader_bind(int options) +void GPU_basic_shader_bind(int options) { if (USE_GLSL) { if (options) { - GPUShader *shader = gpu_simple_shader(options); + GPUShader *shader = gpu_basic_shader(options); if (shader) GPU_shader_bind(shader); @@ -215,16 +215,16 @@ void GPU_simple_shader_bind(int options) GPU_MATERIAL_STATE.bound_options = options; } -int GPU_simple_shader_bound_options(void) +int GPU_basic_shader_bound_options(void) { /* ideally this should disappear, anything that uses this is making fragile - * assumptions that the simple shader is bound and not another shader */ + * assumptions that the basic shader is bound and not another shader */ return GPU_MATERIAL_STATE.bound_options; } /* Material Colors */ -void GPU_simple_shader_colors(const float diffuse[3], const float specular[3], +void GPU_basic_shader_colors(const float diffuse[3], const float specular[3], int shininess, float alpha) { float gl_diffuse[4], gl_specular[4]; @@ -246,7 +246,7 @@ void GPU_simple_shader_colors(const float diffuse[3], const float specular[3], glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, CLAMPIS(shininess, 1, 128)); } -void GPU_simple_shader_light_set(int light_num, GPULightData *light) +void GPU_basic_shader_light_set(int light_num, GPULightData *light) { int light_bit = (1 << light_num); @@ -320,7 +320,7 @@ void GPU_simple_shader_light_set(int light_num, GPULightData *light) } } -void GPU_simple_shader_light_set_viewer(bool local) +void GPU_basic_shader_light_set_viewer(bool local) { glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, (local)? GL_TRUE: GL_FALSE); } diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index efbd4c1afda..3c44811324c 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -57,7 +57,7 @@ #include "GPU_buffers.h" #include "GPU_draw.h" -#include "GPU_simple_shader.h" +#include "GPU_basic_shader.h" #include "bmesh.h" @@ -1844,8 +1844,8 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial, glEnableClientState(GL_COLOR_ARRAY); /* weak inspection of bound options, should not be necessary ideally */ - bound_options = GPU_simple_shader_bound_options(); - GPU_simple_shader_bind(bound_options | GPU_SHADER_USE_COLOR); + bound_options = GPU_basic_shader_bound_options(); + GPU_basic_shader_bind(bound_options | GPU_SHADER_USE_COLOR); } GPU_buffer_bind(buffers->vert_buf, GPU_BINDING_ARRAY); @@ -1925,7 +1925,7 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial, if (!wireframe) { glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_COLOR_ARRAY); - GPU_simple_shader_bind(bound_options); + GPU_basic_shader_bind(bound_options); } } } diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index cb4d0a75cd3..d35536f04b9 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -79,7 +79,7 @@ #include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_material.h" -#include "GPU_simple_shader.h" +#include "GPU_basic_shader.h" #include "PIL_time.h" @@ -1715,12 +1715,12 @@ int GPU_object_material_bind(int nr, void *attribs) float diffuse[3], specular[3]; mul_v3_v3fl(diffuse, &defmaterial.r, defmaterial.ref + defmaterial.emit); mul_v3_v3fl(specular, &defmaterial.specr, defmaterial.spec); - GPU_simple_shader_colors(diffuse, specular, 35, 1.0f); + GPU_basic_shader_colors(diffuse, specular, 35, 1.0f); if (GMS.two_sided_lighting) - GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_TWO_SIDED); + GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_TWO_SIDED); else - GPU_simple_shader_bind(GPU_SHADER_LIGHTING); + GPU_basic_shader_bind(GPU_SHADER_LIGHTING); return 0; } @@ -1797,13 +1797,13 @@ int GPU_object_material_bind(int nr, void *attribs) } else { /* or do fixed function opengl material */ - GPU_simple_shader_colors(GMS.matbuf[nr].diff, + GPU_basic_shader_colors(GMS.matbuf[nr].diff, GMS.matbuf[nr].spec, GMS.matbuf[nr].hard, GMS.matbuf[nr].alpha); if (GMS.two_sided_lighting) - GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_TWO_SIDED); + GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_TWO_SIDED); else - GPU_simple_shader_bind(GPU_SHADER_LIGHTING); + GPU_basic_shader_bind(GPU_SHADER_LIGHTING); } /* set (alpha) blending mode */ @@ -1866,7 +1866,7 @@ void GPU_object_material_unbind(void) GMS.gboundmat = NULL; } else - GPU_simple_shader_bind(GPU_SHADER_USE_COLOR); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); GPU_set_material_alpha_blend(GPU_BLEND_SOLID); } @@ -1949,7 +1949,7 @@ int GPU_default_lights(void) U.light[2].spec[3] = 1.0; } - GPU_simple_shader_light_set_viewer(false); + GPU_basic_shader_light_set_viewer(false); for (a = 0; a < 8; a++) { if (a < 3 && U.light[a].flag) { @@ -1961,12 +1961,12 @@ int GPU_default_lights(void) copy_v3_v3(light.diffuse, U.light[a].col); copy_v3_v3(light.specular, U.light[a].spec); - GPU_simple_shader_light_set(a, &light); + GPU_basic_shader_light_set(a, &light); count++; } else - GPU_simple_shader_light_set(a, NULL); + GPU_basic_shader_light_set(a, NULL); } return count; @@ -1980,11 +1980,11 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[4][ /* disable all lights */ for (count = 0; count < 8; count++) - GPU_simple_shader_light_set(count, NULL); + GPU_basic_shader_light_set(count, NULL); /* view direction for specular is not computed correct by default in * opengl, so we set the settings ourselfs */ - GPU_simple_shader_light_set_viewer(!ortho); + GPU_basic_shader_light_set_viewer(!ortho); count = 0; @@ -2031,7 +2031,7 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[4][ light.type = GPU_LIGHT_POINT; } - GPU_simple_shader_light_set(count, &light); + GPU_basic_shader_light_set(count, &light); glPopMatrix(); @@ -2152,7 +2152,7 @@ void GPU_state_init(void) gpu_multisample(false); - GPU_simple_shader_bind(GPU_SHADER_USE_COLOR); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } #ifdef WITH_OPENSUBDIV diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index ddb7aa4cf8f..5e2fa19a754 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -49,7 +49,7 @@ #include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_compositing.h" -#include "GPU_simple_shader.h" +#include "GPU_basic_shader.h" #include "intern/gpu_private.h" @@ -256,12 +256,12 @@ void gpu_extensions_init(void) GPU_invalid_tex_init(); - GPU_simple_shaders_init(); + GPU_basic_shaders_init(); } void gpu_extensions_exit(void) { - GPU_simple_shaders_exit(); + GPU_basic_shaders_exit(); GPU_invalid_tex_free(); } diff --git a/source/blender/gpu/shaders/gpu_shader_simple_frag.glsl b/source/blender/gpu/shaders/gpu_shader_basic_frag.glsl index 94c73d9e248..94c73d9e248 100644 --- a/source/blender/gpu/shaders/gpu_shader_simple_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_basic_frag.glsl diff --git a/source/blender/gpu/shaders/gpu_shader_simple_vert.glsl b/source/blender/gpu/shaders/gpu_shader_basic_vert.glsl index 8ccd0feb5e2..8ccd0feb5e2 100644 --- a/source/blender/gpu/shaders/gpu_shader_simple_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_basic_vert.glsl |