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 |
struct OMEGA_API ogTerrainVertex { og3DVector vPosition; og3DVector vNormal; og3DVector vTexture; static const DWORD dwFVF; }; const DWORD ogTerrainVertex::dwFVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX0 | D3DFVF_TEXCOORDSIZE3(0); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
TECHNIQUE Terrain { PASS P1 { CullMode = CCW; texture[0] = <DetailMap>; ColorOp[0] = SelectArg1; ColorArg1[0] = Texture; ColorOp[1] = Disable; Lighting = false; Alphablendenable = false; Specularenable = false; //FillMode = wireframe; //DEBUG! //VertexShader = compile vs_1_1 VS_Terrain(); //PixelShader = compile ps_2_0 PS_Terrain(); } } |
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
//Variablen float4x4 mWorldViewProjection; float3x3 mRotation; texture NormalMap; texture DetailMap; texture HeightMap; //****************************************// //Ausgangsstruktur struct VS_OUTPUT_Terrain { float4 vPosition : POSITION; float3 vTex0 : TEXCOORD0; }; //VertexShader VS_OUTPUT_Terrain VS_Terrain(float4 vInPos : POSITION, float3 vInTex0 : TEXCOORD0) { VS_OUTPUT_Terrain Out = (VS_OUTPUT_Terrain)(0); //Position mit Höhe Out.vPosition = mul(vInPos, mWorldViewProjection); //3DTexture-Coordintaten Out.vTex0 = vInTex0; return Out; } //****************************************// //Sampler sampler SS_DetailMap = sampler_state { texture = <DetailMap>; MINFILTER = LINEAR; MAGFILTER = LINEAR; MIPFILTER = LINEAR; //ADDRESSU = CLAMP; //ADDRESSV = CLAMP; //ADDRESSW = CLAMP; }; sampler SS_NormalMap = sampler_state { texture = <NormalMap>; MINFILTER = LINEAR; MAGFILTER = LINEAR; MIPFILTER = NONE; }; sampler SS_HeightMap = sampler_state { texture = <HeightMap>; MINFILTER = LINEAR; MAGFILTER = LINEAR; MIPFILTER = NONE; }; //PixelShader float4 PS_Terrain(float3 vInTex0 : TEXCOORD0) : COLOR { //NormalVektor //float4 vNormal = tex2D(SS_NormalMap, vInTex0); //DetailMap (3D-TextureCoords!) //float3 vTexDetail = float3(vInTex0.x, tex2D(SS_HeightMap, vInTex0).r, vInTex0.y); return tex3D(SS_DetailMap, vInTex0); //return tex2D(SS_DetailMap, float2(vInTex0.x, vInTex0.y)); //return float4(1.0f, 1.0f, 1.0f, 1.0f); } |
Administrator
Zitat von »"Black-Panther"«
C-/C++-Quelltext
1 const DWORD ogTerrainVertex::dwFVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX0 | D3DFVF_TEXCOORDSIZE3(0);
Administrator
Treue Seele
Werbeanzeige