diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-06 00:11:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-06 21:35:15 +0300 |
commit | 4aab21f9be6ed0598279cfd0086181a99c28b50e (patch) | |
tree | d5378eb1ef12e7ff042923af4395a76312519e4d /source/blender/gpu/intern | |
parent | cf921934b1a6a30461779e26d67d02d0b66bdafc (diff) |
OpenGL: rename simple shader to basic shader.
Diffstat (limited to 'source/blender/gpu/intern')
-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 |
4 files changed, 38 insertions, 38 deletions
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(); } |