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 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
// Sample effect file // Here is a texture parameter texture tex0 < string name = "tiger.bmp"; >; // Here is a vector parameter representing the direction // vector from a light source. The UIDirectional annotation // tells EffectEdit to create a user interface element that can // be used to interactively change the light direction. float3 lightDir < string UIDirectional = "Light Direction"; > = {0.577, -0.577, 0.577}; string XFile = "tiger.x"; // Model to load string BIMG = "lake.bmp"; // Background image DWORD BCLR = 0xff202080; // Background color (if no image) technique tec0 { pass p0 { // Set up reasonable material defaults MaterialAmbient = {1.0, 1.0, 1.0, 1.0}; MaterialDiffuse = {1.0, 1.0, 1.0, 1.0}; MaterialSpecular = {1.0, 1.0, 1.0, 1.0}; MaterialPower = 40.0f; // Set up one directional light LightType[0] = DIRECTIONAL; LightDiffuse[0] = {1.0, 1.0, 1.0, 1.0}; LightSpecular[0] = {1.0, 1.0, 1.0, 1.0}; LightAmbient[0] = {0.1, 0.1, 0.1, 1.0}; LightDirection[0] = <lightDir>; // Use the vector parameter defined above LightRange[0] = 100000.0; // Turn lighting on and use light 0 LightEnable[0] = True; Lighting = True; SpecularEnable = True; // Set up texture stage 0 Texture[0] = <tex0>; // Use the texture parameter defined above ColorOp[0] = Modulate; ColorArg1[0] = Texture; ColorArg2[0] = Diffuse; AlphaOp[0] = Modulate; AlphaArg1[0] = Texture; AlphaArg2[0] = Diffuse; MinFilter[0] = Linear; MagFilter[0] = Linear; MipFilter[0] = Linear; // Disable texture stage 1 ColorOp[1] = Disable; AlphaOp[1] = Disable; } } |
Werbeanzeige