forked from bartvdbraak/blender
BGE BugFix [#25711]render.setBackgroundColor() does not work:
Since rev.2 (hans ftw) we have a strange situation where horizon color was being used at Convert time for the WorldInfo background color (and for the fog). However through the Python API only the Rasterizer background color was being updated. On top of that the KX_KetsjiEngine.cpp::SetBackGround was using the WorldInfo bgcolor when render mode was the potato one (TEXTURED). Bottomline, when in potato mode the glClearColor used was the original one in worldinfo, not the API updated one in Rasterized.
This commit is contained in:
parent
3b0c2accc6
commit
eff0e29cba
@ -188,6 +188,12 @@ float BlenderWorldInfo::getMistColorBlue()
|
|||||||
return m_mistcolor[2];
|
return m_mistcolor[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlenderWorldInfo::setBackColor(float r, float g, float b)
|
||||||
|
{
|
||||||
|
m_backgroundcolor[0] = r;
|
||||||
|
m_backgroundcolor[1] = g;
|
||||||
|
m_backgroundcolor[2] = b;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
BlenderWorldInfo::setMistStart(
|
BlenderWorldInfo::setMistStart(
|
||||||
|
@ -64,6 +64,12 @@ public:
|
|||||||
float getMistColorGreen();
|
float getMistColorGreen();
|
||||||
float getMistColorBlue();
|
float getMistColorBlue();
|
||||||
|
|
||||||
|
void
|
||||||
|
setBackColor(
|
||||||
|
float r,
|
||||||
|
float g,
|
||||||
|
float b
|
||||||
|
);
|
||||||
void
|
void
|
||||||
setMistStart(
|
setMistStart(
|
||||||
float d
|
float d
|
||||||
|
@ -923,6 +923,11 @@ static PyObject* gPySetBackgroundColor(PyObject*, PyObject* value)
|
|||||||
{
|
{
|
||||||
gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
|
gp_Rasterizer->SetBackColor(vec[0], vec[1], vec[2], vec[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KX_WorldInfo *wi = gp_KetsjiScene->GetWorldInfo();
|
||||||
|
if (wi->hasWorld())
|
||||||
|
wi->setBackColor(vec[0], vec[1], vec[2]);
|
||||||
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ public:
|
|||||||
virtual float getAmbientColorGreen()=0;
|
virtual float getAmbientColorGreen()=0;
|
||||||
virtual float getAmbientColorBlue()=0;
|
virtual float getAmbientColorBlue()=0;
|
||||||
|
|
||||||
|
virtual void setBackColor(float,float,float)=0;
|
||||||
virtual void setMistStart(float)=0;
|
virtual void setMistStart(float)=0;
|
||||||
virtual void setMistDistance(float)=0;
|
virtual void setMistDistance(float)=0;
|
||||||
virtual void setMistColorRed(float)=0;
|
virtual void setMistColorRed(float)=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user