V( g_pMeshFloor->DrawSubset( 0 ) );
pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_ARGB( 0, 0x3F, 0xAF, 0xFF ), 1.0f, 0L );
pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_ARGB( 0xFF, 0, 0, 0 ), 1.0f, 0L );
// Light direction is same as camera front (reversed)
vLightDir = -( *g_Camera.GetWorldAhead() );
// Shade (Ambient + etc.)
o.Diffuse = float4( MaterialAmbient.xyz + saturate( dot( Normal, lhtDir.xyz ) ) * MaterialDiffuse.xyz, 1.0 );
float Intensity = saturate( dot( Normal, lhtDir.xyz ) );
o.Diffuse = Intensity * MaterialDiffuse;
float Intensity = saturate( dot( Normal, lhtDir.xyz ) );
Intensity = 1.0f - Intensity; // عكس شدة الإضاءة
o.Diffuse = Intensity * MaterialDiffuse;
float4 MaterialDiffuse : MATERIALDIFFUSE = { 0.0f, 0.8f, 0.0f, 1.0f };
technique Skinning20
{
pass p0
{
VertexShader = ( vsArray20[ CurNumBones ] );
PixelShader = compile ps_2_0 PixScene();
// نمط دمج الإضافة
AlphaBlendEnable = True;
SrcBlend = One;
DestBlend = One;
}
}
// نمط دمج الإضافة
AlphaBlendEnable = True;
SrcBlend = One;
DestBlend = One;
ZEnable = False;
float2 UVOffset = { 0,0 };
// copy the input texture coordinate through
o.Tex0 = i.Tex0.xy + UVOffset;
FLOAT UVOffsetVal = (FLOAT)fTime * 0.1f;
D3DXVECTOR4 uvOffset(UVOffsetVal,UVOffsetVal,UVOffsetVal,UVOffsetVal);
g_pEffect->SetVector( "UVOffset", &uvOffset );
if( pMAEffect )
pMAEffect->SetVector( "UVOffset", &uvOffset );