Commit 006ee784 authored by Byurrrer's avatar Byurrrer

сделал инверсию значения shadow intensity для локальных источников света

parent 6a9244a9
......@@ -129,7 +129,7 @@ PSO_Lbuffer main(VSO_ResPos IN)
fDiffuse *= max(fShadow, lerp(0.01, 0.09, g_vLightColor.w));
#endif
fDiffuse = lerp(fDiffuse, 1.0, g_vLightPowerDistShadow.z);
fDiffuse = lerp(1.0, fDiffuse, g_vLightPowerDistShadow.z);
OUT.vAmdient.xyz = g_vLightColor.xyz * g_vLightColor.xyz * g_vLightPowerDistShadow.x * fAttenuation;
OUT.vAmdient.w = fDiffuse * fMdiffuse * vParam.w * g_vLightPowerDistShadow.x * 2.0 * fAttenuation;
......
......@@ -96,7 +96,7 @@ void CLightDirectional::onSync()
if (SLight_GetTypeShadowed(m_idLight) != m_iShadowType)
SLight_SetTypeShadowed(m_idLight, (LTYPE_SHADOW)m_iShadowType);
SLight_SetShadowCoef(m_idLight, m_fShadowIntensity);
SLight_SetShadowIntensity(m_idLight, m_fShadowIntensity);
static SMQuaternion curr_rot;
SLight_GetOrient(m_idLight, &curr_rot);
......
......@@ -88,7 +88,7 @@ void CLightPoint::onSync()
m_fShadowDist = m_fDist;
}
SLight_SetShadowCoef(m_idLight, m_fShadowIntensity);
SLight_SetShadowIntensity(m_idLight, m_fShadowIntensity);
if (SLight_GetShadowLocalFar(m_idLight) != m_fShadowDist)
SLight_SetShadowLocalFar(m_idLight, m_fShadowDist);
......
......@@ -123,7 +123,7 @@ CLights::CLight::CLight()
m_typeLight = LTYPE_LIGHT_NONE;
m_szName[0] = 0;
m_fShadowCoef = 0.01;
m_fShadowIntensity = 0.0;
m_id = -1;
......@@ -573,15 +573,15 @@ void CLights::setLightDist(ID id, float radius_height, bool is_create)
lightCountUpdateNull(id);
}
void CLights::setLightShadowCoef(ID id, float fShadowCoef)
void CLights::setLightShadowIntensity(ID id, float fShadowIntensity)
{
LIGHTS_PRE_COND_ID(id, _VOID);
m_aLights[id]->m_fShadowCoef = fShadowCoef;
m_aLights[id]->m_fShadowIntensity = fShadowIntensity;
}
float CLights::getLightShadowCoef(ID id)
float CLights::getLightShadowIntensity(ID id)
{
return m_aLights[id]->m_fShadowCoef;
return m_aLights[id]->m_fShadowIntensity;
}
void CLights::setLightPos(ID id, const float3* vec, bool greal)
......
......@@ -79,8 +79,8 @@ public:
float getLightDist(ID id) const;
void setLightDist(ID id, float fRadiusHeight, bool isCreate);
void setLightShadowCoef(ID id, float fShadowCoef);
float getLightShadowCoef(ID id);
void setLightShadowIntensity(ID id, float fShadowCoef);
float getLightShadowIntensity(ID id);
//-----------------------------------------------------------------------------
......@@ -214,7 +214,7 @@ public:
float2_t m_vTopBottomRadius;
float m_fAngle;
float m_fShadowCoef;
float m_fShadowIntensity;
ISXBound *m_pBoundVolume;
float4x4 m_mWorldMat;
......
......@@ -184,16 +184,16 @@ SX_LIB_API void SLight_SetCastGlobalShadow(bool isShadowed)
return ArrLights->setCastGlobalShadow(isShadowed);
}
SX_LIB_API void SLight_SetShadowCoef(ID id, float m_fShadowCoef)
SX_LIB_API void SLight_SetShadowIntensity(ID id, float m_fShadowCoef)
{
ML_PRECOND(_VOID);
ArrLights->setLightShadowCoef(id, m_fShadowCoef);
ArrLights->setLightShadowIntensity(id, m_fShadowCoef);
}
SX_LIB_API float SLight_GetShadowCoef(ID id)
SX_LIB_API float SLight_GetShadowIntensity(ID id)
{
ML_PRECOND(0);
return ArrLights->getLightShadowCoef(id);
return ArrLights->getLightShadowIntensity(id);
}
SX_LIB_API void SLight_GetColor(ID id, float3 *pColor)
......
......@@ -273,10 +273,11 @@ SX_LIB_API bool SLight_GetCastGlobalShadow();
//! установить общую тень для всего от глобального источника (все в тень)
SX_LIB_API void SLight_SetCastGlobalShadow(bool isShadowed);
//! установить интенсивность тени для локального источника света [0 - нет тени, 1 - черная тень]
SX_LIB_API void SLight_SetShadowIntensity(ID id, float m_fShadowCoef);
SX_LIB_API void SLight_SetShadowCoef(ID id, float m_fShadowCoef);
SX_LIB_API float SLight_GetShadowCoef(ID id);
//! возвращает интенсивность тени локального источника света
SX_LIB_API float SLight_GetShadowIntensity(ID id);
//-----------------------------------------------------------------------------
......
......@@ -1222,7 +1222,7 @@ void rfunc::ComLighting(DWORD timeDelta)
SLight_GetPos(i, &tmpPosition, true);
tmpPowerDistShadow.x = SLight_GetPower(i);
tmpPowerDistShadow.y = SLight_GetDist(i);
tmpPowerDistShadow.z = SLight_GetShadowCoef(i);
tmpPowerDistShadow.z = SLight_GetShadowIntensity(i);
if (SLight_GetType(i) != LTYPE_LIGHT_GLOBAL)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment