[Bf-blender-cvs] [9821fe6] master: OpenGL: move two sided lighting check into GPU material code.
Brecht Van Lommel
noreply at git.blender.org
Sun Dec 6 19:45:56 CET 2015
Commit: 9821fe6dc25b7a7fc50754d2c3c66b731631ce9f
Author: Brecht Van Lommel
Date: Fri Nov 27 21:28:36 2015 +0100
Branches: master
https://developer.blender.org/rB9821fe6dc25b7a7fc50754d2c3c66b731631ce9f
OpenGL: move two sided lighting check into GPU material code.
Differential Revision: https://developer.blender.org/D1645
===================================================================
M source/blender/gpu/intern/gpu_draw.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 31b9c07..78a420f 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -49,6 +49,7 @@
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_node_types.h"
@@ -1427,6 +1428,7 @@ static struct GPUMaterialState {
float (*gviewcamtexcofac);
bool backface_culling;
+ bool two_sided_lighting;
GPUBlendMode *alphablend;
GPUBlendMode alphablend_fixed[FIXEDMAT];
@@ -1567,6 +1569,10 @@ void GPU_begin_object_materials(View3D *v3d, RegionView3D *rv3d, Scene *scene, O
GMS.backface_culling = (v3d->flag2 & V3D_BACKFACE_CULLING) != 0;
+ GMS.two_sided_lighting = false;
+ if (ob && ob->type == OB_MESH)
+ GMS.two_sided_lighting = (((Mesh*)ob->data)->flag & ME_TWOSIDED) != 0;
+
GMS.gob = ob;
GMS.gscene = scene;
GMS.is_opensubdiv = use_opensubdiv;
@@ -1878,6 +1884,7 @@ void GPU_end_object_materials(void)
GMS.matbuf = NULL;
GMS.gmatbuf = NULL;
GMS.alphablend = NULL;
+ GMS.two_sided_lighting = false;
/* resetting the texture matrix after the scaling needed for tiled textures */
if (GTS.tilemode) {
More information about the Bf-blender-cvs
mailing list