OpenGL: rename simple shader to basic shader.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sat, 5 Dec 2015 21:11:31 +0000 (22:11 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 6 Dec 2015 18:35:15 +0000 (19:35 +0100)
21 files changed:
source/blender/blenfont/intern/blf.c
source/blender/blenkernel/intern/pbvh.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/screen/glutil.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/GPU_basic_shader.h [moved from source/blender/gpu/GPU_simple_shader.h with 80% similarity]
source/blender/gpu/SConscript
source/blender/gpu/intern/gpu_basic_shader.c [moved from source/blender/gpu/intern/gpu_simple_shader.c with 91% similarity]
source/blender/gpu/intern/gpu_buffers.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/shaders/gpu_shader_basic_frag.glsl [moved from source/blender/gpu/shaders/gpu_shader_simple_frag.glsl with 100% similarity]
source/blender/gpu/shaders/gpu_shader_basic_vert.glsl [moved from source/blender/gpu/shaders/gpu_shader_simple_vert.glsl with 100% similarity]
source/blender/windowmanager/intern/wm_operators.c

index 8b654d25bcffd48b6b5b7a4fe4388ae8559e03b7..6c3fd090d4accf22f68f00f08bd80e58b9a6de84 100644 (file)
@@ -55,7 +55,7 @@
 
 #include "IMB_colormanagement.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "blf_internal_types.h"
 #include "blf_internal.h"
@@ -498,7 +498,7 @@ static void blf_draw_gl__start(FontBLF *font, GLint *mode)
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
-       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
 
        /* Save the current matrix mode. */
        glGetIntegerv(GL_MATRIX_MODE, mode);
@@ -539,7 +539,7 @@ static void blf_draw_gl__end(GLint mode)
        if (mode != GL_MODELVIEW)
                glMatrixMode(mode);
 
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        glDisable(GL_BLEND);
 }
 
index d4c62fa57dce0642077d803c6a2f61234e6a891f..16ba25e3bef8882b7550181aab5439f897d3aae9 100644 (file)
@@ -1693,7 +1693,7 @@ void BKE_pbvh_node_draw(PBVHNode *node, void *data_v)
                        col[i] = (rand() / (float)RAND_MAX) * 0.3 + 0.7;
        }
 
-       GPU_simple_shader_colors(col, spec, 0, 1.0f);
+       GPU_basic_shader_colors(col, spec, 0, 1.0f);
        glColor3f(1, 0, 0);
 #endif
 
index 244aef633c1712f938615c011fd76381a40193dd..ae2e674416067c3ee1d9b307cc3eccd649fda911 100644 (file)
@@ -56,7 +56,7 @@
 #include "BLF_api.h"
 
 #include "GPU_draw.h"
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "UI_interface.h"
 
@@ -1238,13 +1238,13 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
        zero_v3(light.specular);
        ui_but_v3_get(but, light.direction);
 
-       GPU_simple_shader_light_set(0, &light);
+       GPU_basic_shader_light_set(0, &light);
        for (int a = 1; a < 8; a++)
-               GPU_simple_shader_light_set(a, NULL);
+               GPU_basic_shader_light_set(a, NULL);
 
        /* setup shader */
-       GPU_simple_shader_colors(diffuse, NULL, 0, 1.0f);
-       GPU_simple_shader_bind(GPU_SHADER_LIGHTING);
+       GPU_basic_shader_colors(diffuse, NULL, 0, 1.0f);
+       GPU_basic_shader_bind(GPU_SHADER_LIGHTING);
 
        /* transform to button */
        glPushMatrix();
@@ -1276,7 +1276,7 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
        glCallList(displist);
 
        /* restore */
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        GPU_default_lights();
        glDisable(GL_CULL_FACE);
        
index e0128660e77a2fdff77f2406c6caa1ceaaf936b3..eb07a9d9fbc0739840444fd5f50bbce061fdb2c9 100644 (file)
@@ -34,7 +34,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "GPU_extensions.h"
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
@@ -1123,7 +1123,7 @@ static void icon_draw_texture(
        y1 = iy * icongltex.invh;
        y2 = (iy + ih) * icongltex.invh;
 
-       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
        glBindTexture(GL_TEXTURE_2D, icongltex.id);
 
        /* sharper downscaling, has no effect when scale matches with a mip level */
@@ -1146,7 +1146,7 @@ static void icon_draw_texture(
        glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, 0.0f);
 
        glBindTexture(GL_TEXTURE_2D, 0);
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 }
 
 /* Drawing size for preview images */
index a7f239ed04c6e50882d55428bb11b8ec117c0b3b..4cbea2afed2c3b8c044299a4013228c52ed8212c 100644 (file)
@@ -48,7 +48,7 @@
 #include "IMB_colormanagement.h"
 #include "IMB_imbuf_types.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "UI_interface.h"
 
@@ -590,7 +590,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
                                        glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, subpart_h, 1, 1, format, GL_UNSIGNED_BYTE, &uc_rect[(((size_t)subpart_y) * offset_y + subpart_h - 1) * img_w * components + (subpart_x * offset_x + subpart_w - 1) * components]);
                        }
 
-                       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
                        glBegin(GL_QUADS);
                        glTexCoord2f((float)(0 + offset_left) / tex_w, (float)(0 + offset_bot) / tex_h);
                        glVertex2f(rast_x + (float)offset_left * xzoom, rast_y + (float)offset_bot * yzoom);
@@ -604,7 +604,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
                        glTexCoord2f((float)(0 + offset_left) / tex_w, (float)(subpart_h - offset_top) / tex_h);
                        glVertex2f(rast_x + (float)offset_left * xzoom, rast_y + (float)(subpart_h - offset_top) * yzoom * scaleY);
                        glEnd();
-                       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
                }
        }
 
index 079d08882070a1b74102c6e0652fec6c277cab68..76f6854e54f4657a553313749619df3c3cd82ab3 100644 (file)
@@ -59,7 +59,7 @@
 
 #include "ED_view3d.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "UI_resources.h"
 
@@ -336,7 +336,7 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
                target->old_col = col;
        }
 
-       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
 
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -459,7 +459,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
                        MEM_freeN(buffer);
        }
 
-       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
 
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -795,7 +795,7 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush,
        }
 
        glPopAttrib();
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 }
 
 
index 2d7367885ca54ba3d8a01668030767dc02daf101..e00ebc14ee047ec6e5ef35252376c5519d44f091 100644 (file)
@@ -58,7 +58,7 @@
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "WM_types.h"
 
@@ -1087,7 +1087,7 @@ static void draw_plane_marker_image(Scene *scene,
 
                        glColor4f(1.0, 1.0, 1.0, plane_track->image_opacity);
 
-                       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
                        glGenTextures(1, (GLuint *)&texid);
 
                        glBindTexture(GL_TEXTURE_2D, texid);
@@ -1111,7 +1111,7 @@ static void draw_plane_marker_image(Scene *scene,
                        glPopMatrix();
 
                        glBindTexture(GL_TEXTURE_2D, 0);
-                       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
                        if (transparent) {
                                glDisable(GL_BLEND);
index 925804b8bb4414aacc08d605d8ed3d66533972b1..deb0a3f6d03a204da85b94292b96ad2eac16b391 100644 (file)
@@ -58,7 +58,7 @@
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "ED_anim_api.h"
 #include "ED_gpencil.h"
@@ -1296,7 +1296,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
 
        glColor4f(1.0, 1.0, 1.0, 1.0);
 
-       GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
        glGenTextures(1, (GLuint *)&texid);
 
        glBindTexture(GL_TEXTURE_2D, texid);
@@ -1371,7 +1371,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
        glEnd();
 
        glBindTexture(GL_TEXTURE_2D, 0);
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        if (sseq->mainb == SEQ_DRAW_IMG_IMBUF && sseq->flag & SEQ_USE_ALPHA)
                glDisable(GL_BLEND);
        glDeleteTextures(1, &texid);
index 37906ebec6acb0fe06800bab727b9e44fc34c6cc..2ff3dcdda29a397764c27190bbbe2694cfb99ffe 100644 (file)
@@ -61,7 +61,7 @@
 #include "ED_armature.h"
 #include "ED_keyframes_draw.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "UI_resources.h"
 
@@ -885,7 +885,7 @@ static void draw_sphere_bone(const short dt, int armflag, int boneflag, short co
 
        if (dt == OB_SOLID) {
                /* set up solid drawing */
-               GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
                
                gluQuadricDrawStyle(qobj, GLU_FILL); 
                glShadeModel(GL_SMOOTH);
@@ -967,7 +967,7 @@ static void draw_sphere_bone(const short dt, int armflag, int boneflag, short co
        /* restore */
        if (dt == OB_SOLID) {
                glShadeModel(GL_FLAT);
-               GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        }
        
        glPopMatrix();
@@ -1165,7 +1165,7 @@ static void draw_b_bone(const short dt, int armflag, int boneflag, short constfl
        
        /* set up solid drawing */
        if (dt > OB_WIRE) {
-               GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
                
                if (armflag & ARM_POSEMODE)
                        set_pchan_glColor(PCHAN_COLOR_SOLID, boneflag, constflag);
@@ -1175,7 +1175,7 @@ static void draw_b_bone(const short dt, int armflag, int boneflag, short constfl
                draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth);
                
                /* disable solid drawing */
-               GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        }
        else {
                /* wire */
@@ -1294,7 +1294,7 @@ static void draw_bone(const short dt, int armflag, int boneflag, short constflag
 
        /* set up solid drawing */
        if (dt > OB_WIRE) {
-               GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
                UI_ThemeColor(TH_BONE_SOLID);
        }
        
@@ -1348,7 +1348,7 @@ static void draw_bone(const short dt, int armflag, int boneflag, short constflag
 
        /* disable solid drawing */
        if (dt > OB_WIRE) {
-               GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        }
 }
 
@@ -2603,12 +2603,12 @@ bool draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
                if (ELEM(arm->drawtype, ARM_LINE, ARM_WIRE)) {
                        const float diffuse[3] = {0.64f, 0.64f, 0.64f};
                        const float specular[3] = {0.5f, 0.5f, 0.5f};
-                       GPU_simple_shader_colors(diffuse, specular, 35, 1.0f);
+                       GPU_basic_shader_colors(diffuse, specular, 35, 1.0f);
                }
                else {
                        const float diffuse[3] = {1.0f, 1.0f, 1.0f};
                        const float specular[3] = {1.0f, 1.0f, 1.0f};
-                       GPU_simple_shader_colors(diffuse, specular, 35, 1.0f);
+                       GPU_basic_shader_colors(diffuse, specular, 35, 1.0f);
                        glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);  /* only for lighting... */
                }
        }
index 452e36e6eb5e54be721bf956d15ea9f80e827d9a..de7a8ed0a7ccf9c819d772a65f1f637e7984e96f 100644 (file)
@@ -63,7 +63,7 @@
 #include "GPU_extensions.h"
 #include "GPU_draw.h"
 #include "GPU_material.h"
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "RE_engine.h"
 
@@ -384,11 +384,11 @@ static bool set_draw_settings_cached(int clearcache, MTexPoly *texface, Material
                        float specular[3];
                        mul_v3_v3fl(specular, &ma->specr, ma->spec);
 
-                       GPU_simple_shader_colors(NULL, specular, ma->har, 0.0f);
-                       GPU_simple_shader_bind(options);
+                       GPU_basic_shader_colors(NULL, specular, ma->har, 0.0f);
+                       GPU_basic_shader_bind(options);
                }
                else {
-                       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
                }
 
                c_lit = lit;
@@ -529,7 +529,7 @@ static void draw_textured_end(void)
 
        glShadeModel(GL_FLAT);
        glDisable(GL_CULL_FACE);
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
        /* XXX, bad patch - GPU_default_lights() calls
         * glLightfv(GL_POSITION, ...) which
@@ -1077,15 +1077,15 @@ static void tex_mat_set_texture_cb(void *userData, int mat_nr, void *attribs)
                        if (data->two_sided_lighting)
                                options |= GPU_SHADER_TWO_SIDED;
 
-                       GPU_simple_shader_colors(diffuse, NULL, 0, 0.0f);
-                       GPU_simple_shader_bind(options);
+                       GPU_basic_shader_colors(diffuse, NULL, 0, 0.0f);
+                       GPU_basic_shader_bind(options);
 
                        return;
                }
        }
 
        /* disable texture material */
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
        if (data->shadeless) {
                glColor3f(1.0f, 1.0f, 1.0f);
@@ -1188,7 +1188,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
 
        /* reset opengl state */
        GPU_end_object_materials();
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
        glBindTexture(GL_TEXTURE_2D, 0);
 
@@ -1210,13 +1210,13 @@ static void draw_mesh_paint_light_begin(void)
 {
        /* get material diffuse color from vertex colors but set default spec */
        const float specular[3] = {0.47f, 0.47f, 0.47f};
-       GPU_simple_shader_colors(NULL, specular, 35, 1.0f);
-       GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_colors(NULL, specular, 35, 1.0f);
+       GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
 }
 
 static void draw_mesh_paint_light_end(void)
 {
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 }
 
 void draw_mesh_paint_weight_faces(DerivedMesh *dm, const bool use_light,
index af44c8ca9982e609a0f70469094e508f9b39addd..8944c316f7e512c1123c6e7bc43ad63dfcd5a114 100644 (file)
@@ -89,7 +89,7 @@
 #include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "GPU_select.h"
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 
 #include "ED_mesh.h"
 #include "ED_particle.h"
@@ -1800,8 +1800,8 @@ static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d,
        if (v3d->flag2 & V3D_RENDER_OVERRIDE)
                return;
 
-       GPU_simple_shader_colors(NULL, NULL, 0, 1.0f);
-       GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_colors(NULL, NULL, 0, 1.0f);
+       GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
 
        glShadeModel(GL_SMOOTH);
 
@@ -1815,7 +1815,7 @@ static void draw_viewport_reconstruction(Scene *scene, Base *base, View3D *v3d,
 
        /* restore */
        glShadeModel(GL_FLAT);
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
        if ((dflag & DRAW_CONSTCOLOR) == 0) {
                glColor3ubv(ob_wire_col);
@@ -4157,12 +4157,12 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
                                GPU_end_object_materials();
 
                                /* set default specular */
-                               GPU_simple_shader_colors(NULL, specular, 35, 1.0f);
-                               GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+                               GPU_basic_shader_colors(NULL, specular, 35, 1.0f);
+                               GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
 
                                dm->drawMappedFaces(dm, NULL, NULL, NULL, NULL, DM_DRAW_USE_COLORS | DM_DRAW_NEED_NORMALS);
 
-                               GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+                               GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
                        }
                }
                else {
@@ -5462,8 +5462,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                        }
 
                        // XXX test
-                       GPU_simple_shader_colors(NULL, NULL, 0.0f, 1.0f);
-                       GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_colors(NULL, NULL, 0.0f, 1.0f);
+                       GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
                }
 
                if (totchild && (part->draw & PART_DRAW_PARENT) == 0)
@@ -5636,7 +5636,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                if (1) { //ob_dt > OB_WIRE) {
                        if (part->draw_col == PART_DRAW_COL_MAT)
                                glDisableClientState(GL_COLOR_ARRAY);
-                       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
                }
 
                if (cdata2) {
@@ -5697,8 +5697,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
                if (pdd->ndata && ob_dt > OB_WIRE) {
                        glEnableClientState(GL_NORMAL_ARRAY);
                        glNormalPointer(GL_FLOAT, 0, pdd->ndata);
-                       GPU_simple_shader_colors(NULL, NULL, 0.0f, 1.0f);
-                       GPU_simple_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
+                       GPU_basic_shader_colors(NULL, NULL, 0.0f, 1.0f);
+                       GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR);
                }
 
                if ((dflag & DRAW_CONSTCOLOR) == 0) {
@@ -5730,7 +5730,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
 
 /* 7. */
        
-       GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
        glDisableClientState(GL_COLOR_ARRAY);
        glDisableClientState(GL_VERTEX_ARRAY);
        glDisableClientState(GL_NORMAL_ARRAY);
index 328623f884fa810f18ec4cdb6a1642e8829a2c94..60fa77babd9e69b63b67982116c187c9f25bc0e9 100644 (file)
@@ -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)
similarity index 80%
rename from source/blender/gpu/GPU_simple_shader.h
rename to source/blender/gpu/GPU_basic_shader.h
index b62abc6152a53dd50d5f0f69a3783dac283bb4a2..3298f0f35b4afc70a08770a89c639abcb6826fe9 100644 (file)
  * ***** 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
 }
index d27d5b09b5650e023efe644a3ba71f3739db9275..15898f5c203b8928529e5616a560ce4986ccda7b 100644 (file)
@@ -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"),
similarity index 91%
rename from source/blender/gpu/intern/gpu_simple_shader.c
rename to source/blender/gpu/intern/gpu_basic_shader.c
index ea26d1da67566f862aa6e82e5e50d7c30600deee..2dcee877279d1024f2cef0f19519c4b9a7f601fc 100644 (file)
@@ -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);
 }
index efbd4c1afda94c12f5a5cdce92b3561b7e7586e4..3c44811324c25ced70077acfe941f6f5fe3feb3a 100644 (file)
@@ -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);
                }
        }
 }
index cb4d0a75cd34b23d932395ec7dcb3c4aae63b17d..d35536f04b90b75d140993aeb4f6d8323b4cde6f 100644 (file)
@@ -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
index ddb7aa4cf8fa27146b643ea5a0994f826e122141..5e2fa19a754b654a8de44699ad8a0b3b5eceb8a6 100644 (file)
@@ -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();
 }
 
index 0ac26e7d8837ef493516edac8299155f4d068c32..f7f2487e49ca8287623b2e98c24d31e24f00035f 100644 (file)
 #include "ED_util.h"
 #include "ED_view3d.h"
 
-#include "GPU_simple_shader.h"
+#include "GPU_basic_shader.h"
 #include "GPU_material.h"
 
 #include "RNA_access.h"
@@ -4180,7 +4180,7 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph
                }
 
                /* draw textured quad */
-               GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR);
                glBegin(GL_QUADS);
                glTexCoord2f(0, 0);
                glVertex2f(-radius, -radius);
@@ -4191,7 +4191,7 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph
                glTexCoord2f(0, 1);
                glVertex2f(-radius, radius);
                glEnd();
-               GPU_simple_shader_bind(GPU_SHADER_USE_COLOR);
+               GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
                /* undo rotation */
                if (rc->rot_prop)