Example #1
0
/*virtual*/ void SDPEldWorld::SetShaderParameters( IRenderer* const pRenderer, Mesh* const pMesh, const View& View ) const
{
	SDPBase::SetShaderParameters( pRenderer, pMesh, View );

	EldritchFramework* const	pFramework		= EldritchFramework::GetInstance();
	EldritchGame* const			pGame			= pFramework->GetGame();
	const Vector4				FogParams		= pGame->GetFogParams();
	const Vector4				FogPosition		= View.m_Location;

	STATIC_HASHED_STRING( FogParams );
	pRenderer->SetPixelShaderFloat4( sFogParams,		FogParams.GetArray(),	1 );

	STATIC_HASHED_STRING( FogViewPosition );
	pRenderer->SetPixelShaderFloat4( sFogViewPosition,	FogPosition.GetArray(),	1 );
}
Example #2
0
/*virtual*/ void SDPEldLit::SetShaderParameters(IRenderer* const pRenderer,
                                                Mesh* const pMesh,
                                                const View& View) const {
  SDPBase::SetShaderParameters(pRenderer, pMesh, View);

  EldritchFramework* const pFramework = EldritchFramework::GetInstance();
  EldritchGame* const pGame = pFramework->GetGame();
  const Vector4 FogParams = pGame->GetFogParams();
  const Vector4 FogPosition = View.m_Location;

  STATIC_HASHED_STRING(FogParams);
  pRenderer->SetPixelShaderFloat4(sFogParams, FogParams.GetArray(), 1);

  STATIC_HASHED_STRING(FogViewPosition);
  pRenderer->SetPixelShaderFloat4(sFogViewPosition, FogPosition.GetArray(), 1);

  EldritchMesh* const pEldritchMesh = static_cast<EldritchMesh*>(pMesh);
  STATIC_HASHED_STRING(LightCube);
  const SVoxelIrradiance& Irradiance = pEldritchMesh->GetIrradianceCube();
  pRenderer->SetPixelShaderFloat4(sLightCube, Irradiance.m_Light[0].GetArray(),
                                  6);
}