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
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
float4x4 WorldMatrix; float4x4 ViewMatrix; float4x4 ProjectionMatrix; struct VS_OUTPUT { float4 Position : POSITION; float3 Normal : TEXCOORD1; }; VS_OUTPUT vs_main(float4 Position : POSITION, float3 Normal : NORMAL) { VS_OUTPUT Out = (VS_OUTPUT) 0; float4 worldPosition = mul(Position, WorldMatrix); float4 viewPosition = mul(worldPosition, ViewMatrix); Out.Position = mul(viewPosition, ProjectionMatrix); Out.Normal = Normal; return Out; } float4 ps_main(float4 Position : POSITION, float3 Normal : TEXCOORD1) : COLOR0 { float4 LightDir = {1.0f, -0.3f, 1.0f, 1.0f}; return (dot(LightDir, Normal)+0.2f); } technique aaa { pass Pass0 { VertexShader = compile vs_2_0 vs_main(); PixelShader = compile ps_2_0 ps_main(); } } |
Quellcode |
|
1 |
return (dot(LightDir, Normal)+0.2f); |
Quellcode |
|
1 2 3 |
int LightCount; float4 LightColor[LightCount]; float3 LightDirection[LightCount]; |
Zitat von »"Deppomat"«
***** das denn nicht eine unheimliche Speicher verschwendung auf der Grafikkarte? Wenn ich einen float4 Array mit der Größe von 9999999, dann ***** das dann doch ein wenig verschwendung. Habe die begrenzung der Lichter auf 16 gesetzt, das sollte eigentlich vollkommen ausreichen
Werbeanzeige