OK. Ich veröffentliche nun meine Ergebnisse.
ein Veränderung des Terrains habe ich nicht feststellen können.
HIER der HLSL-VertexShader
|
HLSL-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
|
VS_OUTPUT VertexShader_Main(VS_INPUT IN)
{
VS_OUTPUT OUTPUT = (VS_OUTPUT) (0);
float4 TEX = float4(IN.TexCords, 0, 0) ; // Texturekordinaten. {Mipmap -Level 0 [TEX.w]}
float4x4 WorldView = mul(World, View); // World * View
float4x4 MATRIX = mul(WorldView, Prj); // World * View * Prj
float4 High_Map = tex2Dlod(Main_sp,TEX ); // Terrain-Map (High-Map)
float4 Position = {0.0, 0.0, 0.0, 0.0}; // Vertexposition
Position.y = High_Map.x; // Vertex verschieben
Position = mul(IN.Position, MATRIX); // Transformieren
OUTPUT.Position = Position; // Werte der OUTPUT-Struktur geben
OUTPUT.Diffuse = IN.Diffuse;
OUTPUT.TexCords = IN.TexCords;
return OUTPUT;
}
|
Algemeine Informationen
Verwendetes Pixel/Vertex-shader Model -> 3.0
Terrain-Model (Mesh) Auflösung -> 20 x 20
High-Map Auflösung -> 20 x 20
Ich habe wegen der Texturekordinaten folgendes heraus gefunden. jedoch klappt es nicht.
man sollte es so ausfüllen. Oder?
TEX.x = Texcord.x
TEX.y = Texcord.y
TEX.z = 0
TEX.w= 0 //mipmap Level