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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-19 22:11:02 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-19 22:11:02 +0300
commit3bda5490f7f50a795cd8b2c3d841c9375723aee9 (patch)
treecdcd6b5a08cc8566a0d3c8e8e1518fe990d5826f /source/blender/gpu
parent12ad72ba8f4ab598c558428567707413e208eac7 (diff)
2.5: globals cleanup
* G.version removed, use BLENDER_VERSION * G.order removed, ENDIAN_ORDER * G.vd, G.sipo, G.buts, G.sima, .. removed. * G.qual removed * G.simulf removed (was unused in 2.4x) * error() and some other unused stubs removed
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_draw.h9
-rw-r--r--source/blender/gpu/intern/gpu_draw.c14
2 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 2399e7b6a8c..69f44cb2566 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -37,10 +37,11 @@
extern "C" {
#endif
-struct MTFace;
struct Image;
-struct Scene;
+struct MTFace;
struct Object;
+struct Scene;
+struct View3d;
/* OpenGL drawing functions related to shading. These are also
* shared with the game engine, where there were previously
@@ -61,8 +62,8 @@ void GPU_state_init(void);
* GPU_enable_material returns 0 if drawing should be skipped
* - after drawing, the material must be disabled again */
-void GPU_set_object_materials(struct Scene *scene, struct Object *ob,
- int glsl, int *do_alpha_pass);
+void GPU_set_object_materials(struct View3D *v3d, struct Scene *scene,
+ struct Object *ob, int glsl, int *do_alpha_pass);
int GPU_enable_material(int nr, void *attribs);
void GPU_disable_material(void);
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 4025a12a867..237aa802ed8 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -757,6 +757,9 @@ static struct GPUMaterialState {
Material *gboundmat;
Object *gob;
Scene *gscene;
+ int glay;
+ float (*gviewmat)[4];
+ float (*gviewinv)[4];
GPUBlendMode blendmode[MAXMATBUF];
int alphapass;
@@ -779,7 +782,7 @@ Material *gpu_active_node_material(Material *ma)
return ma;
}
-void GPU_set_object_materials(Scene *scene, Object *ob, int glsl, int *do_alpha_pass)
+void GPU_set_object_materials(View3D *v3d, Scene *scene, Object *ob, int glsl, int *do_alpha_pass)
{
extern Material defmaterial; /* from material.c */
Material *ma;
@@ -796,8 +799,11 @@ void GPU_set_object_materials(Scene *scene, Object *ob, int glsl, int *do_alpha_
GMS.gob = ob;
GMS.gscene = scene;
GMS.totmat= ob->totcol;
+ GMS.glay= v3d->lay;
+ GMS.gviewmat= v3d->viewmat;
+ GMS.gviewinv= v3d->viewinv;
- GMS.alphapass = (G.vd && G.vd->transp);
+ GMS.alphapass = (v3d && v3d->transp);
if(do_alpha_pass)
*do_alpha_pass = 0;
@@ -918,8 +924,8 @@ int GPU_enable_material(int nr, void *attribs)
gpumat = GPU_material_from_blender(GMS.gscene, mat);
GPU_material_vertex_attributes(gpumat, gattribs);
- GPU_material_bind(gpumat, GMS.gob->lay, G.vd->lay, 1.0);
- GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, G.vd->viewmat, G.vd->viewinv, GMS.gob->col);
+ GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0);
+ GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col);
GMS.gboundmat= mat;
if(GMS.alphapass) glDepthMask(1);