diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-03-18 00:44:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-03-18 00:44:58 +0300 |
commit | d52400bfbd2a7e4d09b5a71bc461a554d232af15 (patch) | |
tree | 08815f065fc90aac0ae62ae5f3a89d20e19399e6 /source/blender/gpu | |
parent | 1ac0d54fea831c485e8e27e8bfa887e15beb58de (diff) | |
parent | 28f6d223d079b1e5cb67e3fc22fb7f818deb8dcb (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r18677:19317
Notes:
* Sequence transform strip uses G.scene global, this is commented
out now, should be fixed.
* Etch-a-ton code was most difficult to merge. The files already in
2.5 got merged, but no new files were added. Calls to these files
are commented out with "XXX etch-a-ton". editarmature.c and
transform_snap.c were complex to merge. Martin, please check?
* Game engine compiles and links again here for scons/make/cmake
(player still fails to link).
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_draw.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index e326be9d776..ce130951840 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -84,7 +84,7 @@ int GPU_set_tpage(struct MTFace *tface); int GPU_default_lights(void); int GPU_scene_object_lights(struct Scene *scene, struct Object *ob, - int lay, float viewmat[][4]); + int lay, float viewmat[][4], int ortho); /* Text render * - based on moving uv coordinates */ diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 6f69a2b8a31..7f5f85e23a6 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -167,6 +167,8 @@ static int smaller_pow2(int num) static int is_pow2_limit(int num) { /* take texture clamping into account */ + if (G.f & G_TEXTUREPAINT) + return 1; if (U.glreslimit != 0 && num > U.glreslimit) return 0; @@ -175,6 +177,9 @@ static int is_pow2_limit(int num) static int smaller_pow2_limit(int num) { + if (G.f & G_TEXTUREPAINT) + return 1; + /* take texture clamping into account */ if (U.glreslimit != 0 && num > U.glreslimit) return U.glreslimit; @@ -999,6 +1004,8 @@ int GPU_default_lights(void) U.light[2].spec[3]= 1.0; } + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE); + glLightfv(GL_LIGHT0, GL_POSITION, U.light[0].vec); glLightfv(GL_LIGHT0, GL_DIFFUSE, U.light[0].col); glLightfv(GL_LIGHT0, GL_SPECULAR, U.light[0].spec); @@ -1036,7 +1043,7 @@ int GPU_default_lights(void) return count; } -int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4]) +int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4], int ortho) { Base *base; Lamp *la; @@ -1047,6 +1054,10 @@ int GPU_scene_object_lights(Scene *scene, Object *ob, int lay, float viewmat[][4 for(count=0; count<8; count++) glDisable(GL_LIGHT0+count); + /* view direction for specular is not compute correct by default in + * opengl, so we set the settings ourselfs */ + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, (ortho)? GL_FALSE: GL_TRUE); + count= 0; for(base=scene->base.first; base; base=base->next) { @@ -1133,9 +1144,6 @@ void GPU_state_init(void) GPU_default_lights(); - /* no local viewer, looks ugly in ortho mode */ - /* glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, &one); */ - glDepthFunc(GL_LEQUAL); /* scaling matrices */ glEnable(GL_NORMALIZE); |