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:
authorMitchell Stokes <mogurijin@gmail.com>2012-06-17 11:59:22 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-06-17 11:59:22 +0400
commit245c94a75e60c2c0b58c1f39d189258e2e424e29 (patch)
tree54cfd167492f8b66f455395a7f66d8503b5d482e
parent0df30d1063cc185770451b3b2ebf3fcd0341c642 (diff)
Fix for [#31848] "BGE: Commit r47628 breaks custom GLSL material shaders" reported by Alex Fraser.
Custom shaders is a case where the BGE can be using GLSL materials and still need to upload textures without bf_gpu. I tweaked some logic to handle this special case and added more comments.
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index 939f0693161..5459ebe945c 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -176,7 +176,8 @@ void KX_BlenderMaterial::OnConstruction(int layer)
mMaterial->matname<< ", image will not be available");
}
// If we're using glsl materials, the textures are handled by bf_gpu, so don't load them twice!
- else if (!mMaterial->glslmat) {
+ // However, if we're using a custom shader, then we still need to load the textures ourselves.
+ else if (!mMaterial->glslmat || mBlenderShader) {
if ( mMaterial->img[i] ) {
if ( ! mTextures[i].InitFromImage(i, mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 ))
spit("unable to initialize image("<<i<<") in "<<