Exemplo n.º 1
0
//----------------------------------------------------------------------------
void ReflectionsAndShadows::CreatePlanarShadow ()
{
    Light* projector = new0 Light(Light::LT_POINT);
    projector->Position = APoint(30.0f, -50.0f, 80.0f);
    LightNode* projectorNode = new0 LightNode(projector);
    mScene->AttachChild(projectorNode);

    mPSEffect = new0 PlanarShadowEffect(1, mBiped);
    Float4 shadowColor(0.0f, 0.0f, 0.0f, 0.5f);
    mPSEffect->SetPlane(0, mPlane0);
    mPSEffect->SetProjector(0, projector);
    mPSEffect->SetShadowColor(0, shadowColor);
}
Exemplo n.º 2
0
//----------------------------------------------------------------------------
void PlanarShadows::CreatePlanarShadow ()
{
#if 1
	Light* projector = new0 Light(Light::LT_POINT);
	projector->Position = APoint(152.0f, -55.0f, 53.0f);
#else
	Light* projector = new0 Light(Light::LT_DIRECTIONAL);
	projector->DVector = AVector(0.25f, 0.25f, -1.0f);
	projector->DVector.Normalize();
#endif
	mProjectorNode = new0 LightNode(projector);
	mScene->AttachChild(mProjectorNode);

	mPSEffect = new0 PlanarShadowEffect(2, mBiped);
	Float4 shadowColor(0.0f, 0.0f, 0.0f, 0.5f);
	mPSEffect->SetPlane(0, mPlane0);
	mPSEffect->SetProjector(0, projector);
	mPSEffect->SetShadowColor(0, shadowColor);
	mPSEffect->SetPlane(1, mPlane1);
	mPSEffect->SetProjector(1, projector);
	mPSEffect->SetShadowColor(1, shadowColor);
}