Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
mWorld = tbMatrixTranslation(m_vPaddlePos); tbDirect3D::Instance().SetTransform(D3DTS_WORLD, mWorld); tbMatrix All = mWorld*mCamera*mProjection; Effekt_WireFrame->GetEffect()->SetMatrix("WorldMatrix", (D3DXMATRIX *) &All); Effekt_WireFrame->Begin(); Effekt_WireFrame->Pass(0); D3D.SetTransform(D3DTS_WORLD, mWorld); m_pPaddleModel->Render(); Effekt_WireFrame->End(); |
Alter Hase
Alter Hase
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
VS_OUTPUT_PhongWithShadow VS_PhongWithShadow( float4 Position : POSITION0, float3 Normal : NORMAL0, float2 Tex0 : TEXCOORD0 ) { VS_OUTPUT_PhongWithShadow Output = (VS_OUTPUT_PhongWithShadow) 0; Output.Position = mul( Position, mWorldViewProjection ); Output.Normal = normalize( mul( Normal, mWorldView ) ); Output.Tex0 = Tex0; Output.View = -normalize( mul( Position, mWorldView ) ); Output.Light = -vLightDirectionRelative; float4 LightDepth = mul( Position, mWorldLightViewProjection ); Output.ShadowTex.x = 0.5f + 0.5f * LightDepth.x; Output.ShadowTex.y = 0.5f - 0.5f * LightDepth.y; Output.LightDepth = LightDepth.z - fShadowOffset; return Output; } |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
float4 PS_PhongWithShadowTextured( float2 Tex0 : TEXCOORD0, float3 Normal : TEXCOORD1, float3 View : TEXCOORD2, float3 Light : TEXCOORD3, float2 ShadowTex : TEXCOORD4, float LightDepth : TEXCOORD5 ) : COLOR0 { float3 Reflect = normalize( 2.0f * dot( Normal, Light ) * Normal - Light ); float4 Ambient = cLightAmbient * cMaterialAmbient; float4 Diffuse = cLightDiffuse * cMaterialDiffuse * max( 0.0f, dot( Normal, Light ) ); float4 Specular = cLightSpecular * cMaterialSpecular * pow( max( 0.0f, dot( Reflect, View ) ), fMaterialReflection ); float Lighted = step( 0.0f, tex2D( LightDepthMapSampler, ShadowTex ).z - LightDepth ); Lighted *= fShadowIntensity; return (Lighted * (Diffuse + Specular) + Ambient) * tex2D( SkinSampler, Tex0 ); } |
Werbeanzeige