Default zero mat/amb alpha so bloom does not get overpowered
This commit is contained in:
parent
6e2bf5be83
commit
37c462725c
|
@ -22,8 +22,8 @@ CGraphics::SLightBlock CGraphics::sLightBlock;
|
||||||
|
|
||||||
CGraphics::ELightingMode CGraphics::sLightMode;
|
CGraphics::ELightingMode CGraphics::sLightMode;
|
||||||
uint32 CGraphics::sNumLights;
|
uint32 CGraphics::sNumLights;
|
||||||
const CColor CGraphics::skDefaultAmbientColor = CColor(0.5f, 0.5f, 0.5f, 0.5f);
|
const CColor CGraphics::skDefaultAmbientColor = CColor(0.5f, 0.5f, 0.5f, 0.0f);
|
||||||
CColor CGraphics::sAreaAmbientColor = CColor::skBlack;
|
CColor CGraphics::sAreaAmbientColor = CColor::skTransparentBlack;
|
||||||
float CGraphics::sWorldLightMultiplier;
|
float CGraphics::sWorldLightMultiplier;
|
||||||
CLight CGraphics::sDefaultDirectionalLights[3] = {
|
CLight CGraphics::sDefaultDirectionalLights[3] = {
|
||||||
CLight::BuildDirectional(CVector3f(0), CVector3f (0.f, -0.866025f, -0.5f), CColor(0.3f, 0.3f, 0.3f, 0.3f)),
|
CLight::BuildDirectional(CVector3f(0), CVector3f (0.f, -0.866025f, -0.5f), CColor(0.3f, 0.3f, 0.3f, 0.3f)),
|
||||||
|
@ -171,7 +171,7 @@ void CGraphics::SetDefaultLighting()
|
||||||
UpdateLightBlock();
|
UpdateLightBlock();
|
||||||
|
|
||||||
sVertexBlock.COLOR0_Amb = CColor::skGray;
|
sVertexBlock.COLOR0_Amb = CColor::skGray;
|
||||||
sVertexBlock.COLOR0_Amb.A = 0.5f;
|
sVertexBlock.COLOR0_Mat = CColor::skWhite;
|
||||||
UpdateVertexBlock();
|
UpdateVertexBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ void CGraphics::SetupAmbientColor()
|
||||||
else if (sLightMode == ELightingMode::Basic)
|
else if (sLightMode == ELightingMode::Basic)
|
||||||
sVertexBlock.COLOR0_Amb = skDefaultAmbientColor;
|
sVertexBlock.COLOR0_Amb = skDefaultAmbientColor;
|
||||||
else
|
else
|
||||||
sVertexBlock.COLOR0_Amb = CColor::skWhite;
|
sVertexBlock.COLOR0_Amb = CColor::skTransparentWhite;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGraphics::SetIdentityMVP()
|
void CGraphics::SetIdentityMVP()
|
||||||
|
|
|
@ -269,7 +269,8 @@ void CRenderer::RenderSky(CModel *pSkyboxModel, const SViewInfo& rkViewInfo)
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
CGraphics::sMVPBlock.ModelMatrix = CMatrix4f::skIdentity;
|
CGraphics::sMVPBlock.ModelMatrix = CMatrix4f::skIdentity;
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skWhite;
|
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentWhite;
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
CGraphics::sPixelBlock.SetAllTevColors(CColor::skWhite);
|
CGraphics::sPixelBlock.SetAllTevColors(CColor::skWhite);
|
||||||
CGraphics::sPixelBlock.TintColor = CColor::skWhite;
|
CGraphics::sPixelBlock.TintColor = CColor::skWhite;
|
||||||
CGraphics::sNumLights = 0;
|
CGraphics::sNumLights = 0;
|
||||||
|
|
|
@ -190,8 +190,7 @@ bool CMaterial::SetCurrent(FRenderOptions Options)
|
||||||
CGraphics::sPixelBlock.TevColor[iTev] = mTevColors[iTev];
|
CGraphics::sPixelBlock.TevColor[iTev] = mTevColors[iTev];
|
||||||
|
|
||||||
// Set color channels
|
// Set color channels
|
||||||
// COLOR0_Amb is initialized by the node instead of by the material
|
// COLOR0_Amb,Mat is initialized by the node instead of by the material
|
||||||
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skWhite;
|
|
||||||
|
|
||||||
// Set depth write - force on if alpha is disabled (lots of weird depth issues otherwise)
|
// Set depth write - force on if alpha is disabled (lots of weird depth issues otherwise)
|
||||||
if ((mOptions & EMaterialOption::DepthWrite) || (Options & ERenderOption::NoAlpha)) glDepthMask(GL_TRUE);
|
if ((mOptions & EMaterialOption::DepthWrite) || (Options & ERenderOption::NoAlpha)) glDepthMask(GL_TRUE);
|
||||||
|
|
|
@ -996,6 +996,7 @@ bool CMaterialLoader::SetupIncandecenceStage(STevTracker& Tracker, CMaterial* pM
|
||||||
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
||||||
SetMP3IntermediateIntoMaterialPass(pPass.get(), *IntermediateInca);
|
SetMP3IntermediateIntoMaterialPass(pPass.get(), *IntermediateInca);
|
||||||
|
|
||||||
|
/* KColor is set as the INCA mod color in game */
|
||||||
pPass->SetKColorSel(kKonstOne);
|
pPass->SetKColorSel(kKonstOne);
|
||||||
pPass->SetColorInputs(kZeroRGB, kKonstRGB, kTextureRGB, kPrevRGB);
|
pPass->SetColorInputs(kZeroRGB, kKonstRGB, kTextureRGB, kPrevRGB);
|
||||||
pPass->SetColorOutput(kPrevReg);
|
pPass->SetColorOutput(kPrevReg);
|
||||||
|
@ -1036,6 +1037,7 @@ bool CMaterialLoader::SetupIncandecenceStageNoBloom(STevTracker& Tracker, CMater
|
||||||
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
||||||
SetMP3IntermediateIntoMaterialPass(pPass.get(), *IntermediateInca);
|
SetMP3IntermediateIntoMaterialPass(pPass.get(), *IntermediateInca);
|
||||||
|
|
||||||
|
/* KColor is set as the INCA mod color in game */
|
||||||
pPass->SetKColorSel(kKonstOne);
|
pPass->SetKColorSel(kKonstOne);
|
||||||
pPass->SetColorInputs(kZeroRGB, kKonstRGB, kTextureRGB, kPrevRGB);
|
pPass->SetColorInputs(kZeroRGB, kKonstRGB, kTextureRGB, kPrevRGB);
|
||||||
pPass->SetAlphaInputs(kZeroAlpha, kZeroAlpha, kZeroAlpha, kPrevAlpha);
|
pPass->SetAlphaInputs(kZeroAlpha, kZeroAlpha, kZeroAlpha, kPrevAlpha);
|
||||||
|
@ -1073,6 +1075,7 @@ bool CMaterialLoader::SetupStartingIncandecenceStage(STevTracker& Tracker, CMate
|
||||||
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
auto pPass = std::make_unique<CMaterialPass>(pMat);
|
||||||
SetMP3IntermediateIntoMaterialPass(pPass.get(), *IntermediateInca);
|
SetMP3IntermediateIntoMaterialPass(pPass.get(), *IntermediateInca);
|
||||||
|
|
||||||
|
/* KColor is set as the INCA mod color in game */
|
||||||
pPass->SetKColorSel(kKonstOne);
|
pPass->SetKColorSel(kKonstOne);
|
||||||
pPass->SetColorInputs(kZeroRGB, kTextureRGB, kKonstRGB, kZeroRGB);
|
pPass->SetColorInputs(kZeroRGB, kTextureRGB, kKonstRGB, kZeroRGB);
|
||||||
if (IntermediateInca->mSettings & EPassSettings::BloomContribution)
|
if (IntermediateInca->mSettings & EPassSettings::BloomContribution)
|
||||||
|
|
|
@ -62,6 +62,7 @@ void CCharacterNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderCom
|
||||||
CGraphics::SetDefaultLighting();
|
CGraphics::SetDefaultLighting();
|
||||||
CGraphics::UpdateLightBlock();
|
CGraphics::UpdateLightBlock();
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
|
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
CGraphics::sPixelBlock.LightmapMultiplier = 1.f;
|
CGraphics::sPixelBlock.LightmapMultiplier = 1.f;
|
||||||
CGraphics::sPixelBlock.SetAllTevColors(CColor::skWhite);
|
CGraphics::sPixelBlock.SetAllTevColors(CColor::skWhite);
|
||||||
CGraphics::sPixelBlock.TintColor = TintColor(rkViewInfo);
|
CGraphics::sPixelBlock.TintColor = TintColor(rkViewInfo);
|
||||||
|
|
|
@ -65,6 +65,7 @@ void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand
|
||||||
CGraphics::SetDefaultLighting();
|
CGraphics::SetDefaultLighting();
|
||||||
CGraphics::UpdateLightBlock();
|
CGraphics::UpdateLightBlock();
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
|
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
CGraphics::sPixelBlock.LightmapMultiplier = 1.f;
|
CGraphics::sPixelBlock.LightmapMultiplier = 1.f;
|
||||||
CGraphics::sPixelBlock.SetAllTevColors(CColor::skWhite);
|
CGraphics::sPixelBlock.SetAllTevColors(CColor::skWhite);
|
||||||
}
|
}
|
||||||
|
@ -84,9 +85,11 @@ void CModelNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand
|
||||||
{
|
{
|
||||||
LoadLights(rkViewInfo);
|
LoadLights(rkViewInfo);
|
||||||
if (CGraphics::sLightMode == CGraphics::ELightingMode::None)
|
if (CGraphics::sLightMode == CGraphics::ELightingMode::None)
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skWhite;
|
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentWhite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
|
|
||||||
float Mul = CGraphics::sWorldLightMultiplier;
|
float Mul = CGraphics::sWorldLightMultiplier;
|
||||||
CGraphics::sPixelBlock.SetAllTevColors(CColor(Mul,Mul,Mul));
|
CGraphics::sPixelBlock.SetAllTevColors(CColor(Mul,Mul,Mul));
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,7 +228,7 @@ void CScene::SetActiveArea(CWorld *pWorld, CGameArea *pArea)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 NumLightLayers = mpArea->NumLightLayers();
|
uint32 NumLightLayers = mpArea->NumLightLayers();
|
||||||
CGraphics::sAreaAmbientColor = CColor::skBlack;
|
CGraphics::sAreaAmbientColor = CColor::skTransparentBlack;
|
||||||
|
|
||||||
for (uint32 iLyr = 0; iLyr < NumLightLayers; iLyr++)
|
for (uint32 iLyr = 0; iLyr < NumLightLayers; iLyr++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -132,7 +132,7 @@ void CSceneNode::LoadModelMatrix()
|
||||||
void CSceneNode::BuildLightList(CGameArea *pArea)
|
void CSceneNode::BuildLightList(CGameArea *pArea)
|
||||||
{
|
{
|
||||||
mLightCount = 0;
|
mLightCount = 0;
|
||||||
mAmbientColor = CColor::skBlack;
|
mAmbientColor = CColor::skTransparentBlack;
|
||||||
|
|
||||||
uint32 Index = mLightLayerIndex;
|
uint32 Index = mLightLayerIndex;
|
||||||
if ((pArea->NumLightLayers() <= Index) || (pArea->NumLights(Index) == 0)) Index = 0;
|
if ((pArea->NumLightLayers() <= Index) || (pArea->NumLights(Index) == 0)) Index = 0;
|
||||||
|
@ -152,7 +152,7 @@ void CSceneNode::BuildLightList(CGameArea *pArea)
|
||||||
|
|
||||||
// Default ambient color to white if there are no lights on the selected layer
|
// Default ambient color to white if there are no lights on the selected layer
|
||||||
uint32 NumLights = pArea->NumLights(Index);
|
uint32 NumLights = pArea->NumLights(Index);
|
||||||
if (NumLights == 0) mAmbientColor = CColor::skWhite;
|
if (NumLights == 0) mAmbientColor = CColor::skTransparentWhite;
|
||||||
|
|
||||||
for (uint32 iLight = 0; iLight < NumLights; iLight++)
|
for (uint32 iLight = 0; iLight < NumLights; iLight++)
|
||||||
{
|
{
|
||||||
|
@ -192,7 +192,7 @@ void CSceneNode::LoadLights(const SViewInfo& rkViewInfo)
|
||||||
{
|
{
|
||||||
case CGraphics::ELightingMode::None:
|
case CGraphics::ELightingMode::None:
|
||||||
// No lighting: full white ambient, no dynamic lights
|
// No lighting: full white ambient, no dynamic lights
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skWhite;
|
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentWhite;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CGraphics::ELightingMode::Basic:
|
case CGraphics::ELightingMode::Basic:
|
||||||
|
@ -210,6 +210,8 @@ void CSceneNode::LoadLights(const SViewInfo& rkViewInfo)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
|
|
||||||
CGraphics::sPixelBlock.LightmapMultiplier = (Mode == CGraphics::ELightingMode::World ? 1.f : 0.f);
|
CGraphics::sPixelBlock.LightmapMultiplier = (Mode == CGraphics::ELightingMode::World ? 1.f : 0.f);
|
||||||
CGraphics::UpdateLightBlock();
|
CGraphics::UpdateLightBlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,7 @@ void CScriptNode::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCo
|
||||||
{
|
{
|
||||||
CGraphics::sNumLights = 0;
|
CGraphics::sNumLights = 0;
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentBlack;
|
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentBlack;
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
CGraphics::sPixelBlock.LightmapMultiplier = 1.f;
|
CGraphics::sPixelBlock.LightmapMultiplier = 1.f;
|
||||||
CGraphics::UpdateLightBlock();
|
CGraphics::UpdateLightBlock();
|
||||||
}
|
}
|
||||||
|
@ -192,6 +193,7 @@ void CScriptNode::Draw(FRenderOptions Options, int /*ComponentIndex*/, ERenderCo
|
||||||
{
|
{
|
||||||
CGraphics::SetDefaultLighting();
|
CGraphics::SetDefaultLighting();
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
|
CGraphics::sVertexBlock.COLOR0_Amb = CGraphics::skDefaultAmbientColor;
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skTransparentWhite;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -62,7 +62,7 @@ void CStaticNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderComman
|
||||||
if (IsLightingEnabled)
|
if (IsLightingEnabled)
|
||||||
{
|
{
|
||||||
CGraphics::sNumLights = 0;
|
CGraphics::sNumLights = 0;
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = UseWhiteAmbient ? CColor::skWhite : CColor::skTransparentBlack;
|
CGraphics::sVertexBlock.COLOR0_Amb = UseWhiteAmbient ? CColor::skTransparentWhite : CColor::skTransparentBlack;
|
||||||
CGraphics::sPixelBlock.LightmapMultiplier = 1.0f;
|
CGraphics::sPixelBlock.LightmapMultiplier = 1.0f;
|
||||||
CGraphics::UpdateLightBlock();
|
CGraphics::UpdateLightBlock();
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,11 @@ void CStaticNode::Draw(FRenderOptions Options, int ComponentIndex, ERenderComman
|
||||||
{
|
{
|
||||||
LoadLights(rkViewInfo);
|
LoadLights(rkViewInfo);
|
||||||
if (CGraphics::sLightMode == CGraphics::ELightingMode::None || UseWhiteAmbient)
|
if (CGraphics::sLightMode == CGraphics::ELightingMode::None || UseWhiteAmbient)
|
||||||
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skWhite;
|
CGraphics::sVertexBlock.COLOR0_Amb = CColor::skTransparentWhite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGraphics::sVertexBlock.COLOR0_Mat = CColor::skBlack;
|
||||||
|
|
||||||
float Mul = CGraphics::sWorldLightMultiplier;
|
float Mul = CGraphics::sWorldLightMultiplier;
|
||||||
CGraphics::sPixelBlock.SetAllTevColors(CColor(Mul,Mul,Mul));
|
CGraphics::sPixelBlock.SetAllTevColors(CColor(Mul,Mul,Mul));
|
||||||
CGraphics::sPixelBlock.TintColor = TintColor(rkViewInfo);
|
CGraphics::sPixelBlock.TintColor = TintColor(rkViewInfo);
|
||||||
|
|
Loading…
Reference in New Issue