mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-21 21:55:38 +01:00
Remove unused/sample code. Compile using legacy Jun 2010 SDK.
This commit is contained in:
parent
b85a31a572
commit
a492d9a51e
@ -791,7 +791,7 @@ namespace Giants.WebApi.Clients
|
|||||||
[Newtonsoft.Json.JsonProperty("numPlayers", Required = Newtonsoft.Json.Required.Always)]
|
[Newtonsoft.Json.JsonProperty("numPlayers", Required = Newtonsoft.Json.Required.Always)]
|
||||||
public int NumPlayers { get; set; }
|
public int NumPlayers { get; set; }
|
||||||
|
|
||||||
[Newtonsoft.Json.JsonProperty("maxPlayers", Required = Newtonsoft.Json.Required.Always)]
|
[Newtonsoft.Json.JsonProperty("maxPlayers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
|
||||||
public int MaxPlayers { get; set; }
|
public int MaxPlayers { get; set; }
|
||||||
|
|
||||||
[Newtonsoft.Json.JsonProperty("gameState", Required = Newtonsoft.Json.Required.Always)]
|
[Newtonsoft.Json.JsonProperty("gameState", Required = Newtonsoft.Json.Required.Always)]
|
||||||
|
@ -17,9 +17,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shaders", "Shaders\Shaders.
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Giants.BinTools", "Giants.BinTools\Giants.BinTools.csproj", "{6286A2C7-15F0-4D87-B928-4B012F9E0FFE}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Giants.BinTools", "Giants.BinTools\Giants.BinTools.csproj", "{6286A2C7-15F0-4D87-B928-4B012F9E0FFE}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Giants.EffectCompiler", "Giants.EffectCompiler\Giants.EffectCompiler.csproj", "{F5F3D216-9787-4CFF-88DF-8259CF667F88}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Giants.EffectCompiler", "Giants.EffectCompiler\Giants.EffectCompiler.csproj", "{F5F3D216-9787-4CFF-88DF-8259CF667F88}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Giants.EffectCompiler.Tests", "Giants.EffectCompiler.Tests\Giants.EffectCompiler.Tests.csproj", "{49423BA5-4A9F-47A3-9D2D-E83936272DD0}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Giants.EffectCompiler.Tests", "Giants.EffectCompiler.Tests\Giants.EffectCompiler.Tests.csproj", "{49423BA5-4A9F-47A3-9D2D-E83936272DD0}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -92,11 +92,13 @@ Global
|
|||||||
{D4C21170-82D4-4D1F-81EC-036835AC1238}.Release|x86.ActiveCfg = Release|Any CPU
|
{D4C21170-82D4-4D1F-81EC-036835AC1238}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{D4C21170-82D4-4D1F-81EC-036835AC1238}.Release|x86.Build.0 = Release|Any CPU
|
{D4C21170-82D4-4D1F-81EC-036835AC1238}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|Any CPU.Build.0 = Debug|Win32
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x64.ActiveCfg = Debug|x64
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x64.Build.0 = Debug|x64
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x64.Build.0 = Debug|x64
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x86.ActiveCfg = Debug|Win32
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x86.Build.0 = Debug|Win32
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Debug|x86.Build.0 = Debug|Win32
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|Any CPU.ActiveCfg = Release|Win32
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|Any CPU.Build.0 = Release|Win32
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|x64.ActiveCfg = Release|x64
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|x64.ActiveCfg = Release|x64
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|x64.Build.0 = Release|x64
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|x64.Build.0 = Release|x64
|
||||||
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|x86.ActiveCfg = Release|Win32
|
{9A0AF60B-3C3B-45B7-B5E1-4C9997A68EBB}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
@ -67,6 +67,7 @@
|
|||||||
<ShaderType>Effect</ShaderType>
|
<ShaderType>Effect</ShaderType>
|
||||||
<ShaderModel>2.0</ShaderModel>
|
<ShaderModel>2.0</ShaderModel>
|
||||||
<EntryPointName />
|
<EntryPointName />
|
||||||
|
<AdditionalOptions>/Gec %(AdditionalOptions)</AdditionalOptions>
|
||||||
</FxCompile>
|
</FxCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
@ -74,19 +75,42 @@
|
|||||||
<ShaderType>Effect</ShaderType>
|
<ShaderType>Effect</ShaderType>
|
||||||
<ShaderModel>2.0</ShaderModel>
|
<ShaderModel>2.0</ShaderModel>
|
||||||
<EntryPointName />
|
<EntryPointName />
|
||||||
|
<AdditionalOptions>/Gec %(AdditionalOptions)</AdditionalOptions>
|
||||||
</FxCompile>
|
</FxCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FxCompile Include="fx\LandBump.fx" />
|
<CustomBuild Include="fx\LandBump.fx">
|
||||||
<FxCompile Include="fx\Ocean.fx">
|
<FileType>Document</FileType>
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/Gec %(AdditionalOptions)</AdditionalOptions>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/Gec %(AdditionalOptions)</AdditionalOptions>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
</FxCompile>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
<FxCompile Include="fx\Sky.fx">
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="fx\Ocean.fx">
|
||||||
|
<FileType>Document</FileType>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="fx\Sky.fx">
|
||||||
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
</EntryPointName>
|
</EntryPointName>
|
||||||
</FxCompile>
|
<FileType>Document</FileType>
|
||||||
<FxCompile Include="fx\Water.fx" />
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
</CustomBuild>
|
||||||
|
<CustomBuild Include="fx\Water.fx">
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</AdditionalIncludeDirectories>
|
||||||
|
<FileType>Document</FileType>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">fxo\%(Filename).fxo</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(JUN10SDKUTILPATH)\fxc.exe" /LD /Zi /Tfx_2_0 %(FullPath) /Fo fxo\%(Filename).fxo</Command>
|
||||||
|
</CustomBuild>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
@ -21,19 +21,6 @@ float4 g_TextureFactor : TextureFactor;
|
|||||||
int g_NumLights = 0;
|
int g_NumLights = 0;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////
|
||||||
//The sizes of the various terrain UV Coordinates
|
|
||||||
float detailScale = 1;
|
|
||||||
float diffuseScale = 5;
|
|
||||||
float globalScale;
|
|
||||||
float detailMapStrength = 1;
|
|
||||||
|
|
||||||
float3 sunlightVector = float3(.5,.5,.8);
|
|
||||||
|
|
||||||
//The Colour (and brightness) of the Sunlight
|
|
||||||
float3 lightColour = float3(2,2,2);
|
|
||||||
//The colour (and birghtness) of the ambient light
|
|
||||||
float3 ambientColour = float3(.1,.1,.1);
|
|
||||||
|
|
||||||
|
|
||||||
texture g_LandTexture;
|
texture g_LandTexture;
|
||||||
texture g_LandBumpTexture;
|
texture g_LandBumpTexture;
|
||||||
@ -99,11 +86,11 @@ float4 bx2(float4 x)
|
|||||||
return float4(2.0f * x.xyzw - 1.0f);
|
return float4(2.0f * x.xyzw - 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VS_OUTPUT_BUMP LandBumpVS(
|
||||||
VS_OUTPUT_BUMP LandBumpVS( float4 vPos : POSITION,
|
float4 vPos : POSITION,
|
||||||
float3 vNormal : NORMAL,
|
float3 vNormal : NORMAL,
|
||||||
float4 vDiffuse : COLOR0,
|
float4 vDiffuse : COLOR0,
|
||||||
float4 vDiffuse2 : COLOR1)
|
float4 vDiffuse2 : COLOR1)
|
||||||
{
|
{
|
||||||
VS_OUTPUT_BUMP Output;
|
VS_OUTPUT_BUMP Output;
|
||||||
|
|
||||||
@ -137,17 +124,9 @@ float4 LandBumpPS(VS_OUTPUT_BUMP input) : COLOR0
|
|||||||
|
|
||||||
float3 normalMap;
|
float3 normalMap;
|
||||||
normalMap = saturate((float4)dot((float3)normal, (float3)normalcol)).xyz;
|
normalMap = saturate((float4)dot((float3)normal, (float3)normalcol)).xyz;
|
||||||
#ifdef MIX_4X
|
|
||||||
float3 texel = tex2D(g_LandTextureSampler, input.LandTextureUV).rgb * tex2D(g_LandTextureSampler, input.LandTextureUV * -0.25).rgb * 4;
|
|
||||||
float3 finalColor = 2.0 * (normalMap * (texel) + input.LandBumpDiffuse);
|
|
||||||
#else
|
|
||||||
float3 finalColor = 2.0 * (normalMap * (tex2D(g_LandTextureSampler, input.LandTextureUV)) + input.LandBumpDiffuse);
|
float3 finalColor = 2.0 * (normalMap * (tex2D(g_LandTextureSampler, input.LandTextureUV)) + input.LandBumpDiffuse);
|
||||||
//finalColor *= tex2D(g_ShoreTextureSampler, input.ShoreTextureUV);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//finalColor = (g_TextureFactor * (1 - input.LandDiffuse)) + finalColor;
|
for (int i = 0; i < g_NumLights; i++)
|
||||||
|
|
||||||
for (int i = 0; i < MAX_LIGHTS; i++)
|
|
||||||
{
|
{
|
||||||
// Get light direction for this fragment
|
// Get light direction for this fragment
|
||||||
float3 lightDir = normalize(input.WorldPos - g_LightPositions[i]); // per pixel diffuse lighting
|
float3 lightDir = normalize(input.WorldPos - g_LightPositions[i]); // per pixel diffuse lighting
|
||||||
@ -171,135 +150,7 @@ technique LandBump
|
|||||||
pass P0
|
pass P0
|
||||||
{
|
{
|
||||||
VertexShader = compile vs_2_0 LandBumpVS();
|
VertexShader = compile vs_2_0 LandBumpVS();
|
||||||
PixelShader = compile ps_2_0 LandBumpPS();
|
PixelShader = compile ps_2_0 LandBumpPS();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VS_OUTPUT_BUMP LandNormalVS( float4 vPos : POSITION,
|
|
||||||
float3 vNormal : NORMAL,
|
|
||||||
float4 vDiffuse : COLOR0,
|
|
||||||
float4 vDiffuse2 : COLOR1)
|
|
||||||
{
|
|
||||||
VS_OUTPUT_BUMP Output;
|
|
||||||
|
|
||||||
// Transform the position from object space to homogeneous projection space
|
|
||||||
Output.Position = mul(vPos, g_mWorldViewProjection);
|
|
||||||
|
|
||||||
Output.LandBumpDiffuse = vDiffuse2 * .5f;
|
|
||||||
Output.LandBumpDiffuse.a = 1.0f;
|
|
||||||
|
|
||||||
//Output.LandDiffuse
|
|
||||||
Output.LandDiffuse.rgb = vDiffuse;
|
|
||||||
Output.LandDiffuse.a = 1.0f;
|
|
||||||
|
|
||||||
Output.WorldPos = mul(vPos, g_World);
|
|
||||||
|
|
||||||
// Set dynamically generated tex coords
|
|
||||||
Output.LandBumpTextureUV = mul(vPos, g_TexGenTransform0);
|
|
||||||
Output.LandTextureUV = mul(vPos, g_TexGenTransform1);
|
|
||||||
Output.ShoreTextureUV = mul(vPos, g_ShoreGen);
|
|
||||||
|
|
||||||
// Transform the normal from object space to world space
|
|
||||||
Output.Normal = normalize(mul(vNormal, (float3x3)g_World)); // normal (world space)
|
|
||||||
|
|
||||||
return Output;
|
|
||||||
}
|
|
||||||
|
|
||||||
float4 LandNormalPS(VS_OUTPUT_BUMP input) : COLOR0
|
|
||||||
{
|
|
||||||
float4 Output;
|
|
||||||
//Get Global Normal from the full terrain normal map
|
|
||||||
float3 Normal = tex2D(g_LandBumpTextureSampler, input.LandTextureUV);
|
|
||||||
Normal[0] -= .5;
|
|
||||||
Normal[1] -= .5;
|
|
||||||
Normal[2] -= .5;
|
|
||||||
Normal = normalize(Normal);
|
|
||||||
|
|
||||||
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
// //Get Detail Normal from the detail map
|
|
||||||
// float3 detailNormalMap = (tex2D(g_LandDetailTextureSampler, input.LandTextureUV*100/detailScale));
|
|
||||||
// detailNormalMap[0] -= .5;
|
|
||||||
// detailNormalMap[1] -= .5;
|
|
||||||
// detailNormalMap[2] -= .5;
|
|
||||||
// //Multiply Detail Normal by detailMapStrength
|
|
||||||
// detailNormalMap[0] = mul(detailNormalMap[0], detailMapStrength);
|
|
||||||
// detailNormalMap[1] = mul(detailNormalMap[1], detailMapStrength);
|
|
||||||
//
|
|
||||||
// //Normalize detail Normal
|
|
||||||
// detailNormalMap = normalize(detailNormalMap);
|
|
||||||
//
|
|
||||||
// if(false)
|
|
||||||
// {
|
|
||||||
// //Generate the Tangent Basis for the Detail Normal Map.
|
|
||||||
// float3x3 tangentBasis;
|
|
||||||
//
|
|
||||||
// tangentBasis[0] = cross(Normal, float3(1,0,0));
|
|
||||||
// tangentBasis[1] = cross(Normal, tangentBasis[0]);
|
|
||||||
// tangentBasis[2] = Normal;
|
|
||||||
//
|
|
||||||
// detailNormalMap = detailNormalMap, detailMapStrength;
|
|
||||||
//
|
|
||||||
// Normal = mul(detailNormalMap, tangentBasis);
|
|
||||||
// Normal = normalize(Normal);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// Normal = normalize(Normal*2+detailNormalMap*detailMapStrength);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
float3 sv = normalize(sunlightVector);
|
|
||||||
float3 lightLevel;
|
|
||||||
lightLevel[0] = max(dot(Normal, sv), 0)*lightColour[0]*2;//+ambientColour[0];
|
|
||||||
lightLevel[1] = max(dot(Normal, sv), 0)*lightColour[1]*2;//+ambientColour[1];
|
|
||||||
lightLevel[2] = max(dot(Normal, sv), 0)*lightColour[2]*2;//+ambientColour[2];
|
|
||||||
|
|
||||||
return float4(tex2D(g_LandTextureSampler, input.LandTextureUV) * lightLevel, 1) + input.LandBumpDiffuse;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float4 normal = bx2(tex2D(g_LandBumpTextureSampler, input.LandBumpTextureUV));
|
|
||||||
float4 normalcol = bx2(input.LandDiffuse);
|
|
||||||
|
|
||||||
float3 normalMap;
|
|
||||||
normalMap = saturate((float4)dot((float3)normal, (float3)normalcol)).xyz;
|
|
||||||
#ifdef MIX_4X
|
|
||||||
float3 texel = tex2D(g_LandTextureSampler, input.LandTextureUV).rgb * tex2D(g_LandTextureSampler, input.LandTextureUV * -0.25).rgb * 4;
|
|
||||||
float3 finalColor = 2.0 * (normalMap * (texel) + input.LandBumpDiffuse);
|
|
||||||
#else
|
|
||||||
float3 finalColor = 2.0 * (normalMap * (tex2D(g_LandTextureSampler, input.LandTextureUV)) + input.LandBumpDiffuse);
|
|
||||||
//finalColor *= tex2D(g_ShoreTextureSampler, input.ShoreTextureUV);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//finalColor = (g_TextureFactor * (1 - input.LandDiffuse)) + finalColor;
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_LIGHTS; i++)
|
|
||||||
{
|
|
||||||
// Get light direction for this fragment
|
|
||||||
float3 lightDir = normalize(input.WorldPos - g_LightPositions[i]); // per pixel diffuse lighting
|
|
||||||
|
|
||||||
// Note: Non-uniform scaling not supported
|
|
||||||
float diffuseLighting = saturate(dot(input.Normal, -lightDir));
|
|
||||||
|
|
||||||
// Introduce fall-off of light intensity
|
|
||||||
diffuseLighting *= (g_LightRangeSquared[i] / dot(g_LightPositions[i] - input.WorldPos, g_LightPositions[i] - input.WorldPos));
|
|
||||||
|
|
||||||
float4 diffuseColor = diffuseLighting * g_LightDiffuseColors[i];
|
|
||||||
|
|
||||||
finalColor += diffuseColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
return float4(finalColor, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
technique LandNormal
|
|
||||||
{
|
|
||||||
pass P0
|
|
||||||
{
|
|
||||||
VertexShader = compile vs_2_0 LandNormalVS();
|
|
||||||
PixelShader = compile ps_2_0 LandNormalPS();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,9 +166,10 @@ struct VS_OUTPUT
|
|||||||
float3 WorldPos : TEXCOORD2;
|
float3 WorldPos : TEXCOORD2;
|
||||||
};
|
};
|
||||||
|
|
||||||
VS_OUTPUT LandscapeVS( float4 vPos : POSITION,
|
VS_OUTPUT LandscapeVS(
|
||||||
float3 vNormal : NORMAL,
|
float4 vPos : POSITION,
|
||||||
float4 vDiffuse : COLOR0)
|
float3 vNormal : NORMAL,
|
||||||
|
float4 vDiffuse : COLOR0)
|
||||||
{
|
{
|
||||||
VS_OUTPUT Output;
|
VS_OUTPUT Output;
|
||||||
|
|
||||||
@ -342,7 +194,7 @@ float4 LandscapePS(VS_OUTPUT input) : COLOR0
|
|||||||
{
|
{
|
||||||
float4 finalColor = 0;
|
float4 finalColor = 0;
|
||||||
|
|
||||||
for (int i = 0; i < MAX_LIGHTS; i++)
|
for (int i = 0; i < g_NumLights; i++)
|
||||||
{
|
{
|
||||||
// Get light direction for this fragment
|
// Get light direction for this fragment
|
||||||
float3 lightDir = normalize(input.WorldPos - g_LightPositions[i]); // per pixel diffuse lighting
|
float3 lightDir = normalize(input.WorldPos - g_LightPositions[i]); // per pixel diffuse lighting
|
||||||
@ -358,11 +210,7 @@ float4 LandscapePS(VS_OUTPUT input) : COLOR0
|
|||||||
finalColor += diffuseColor;
|
finalColor += diffuseColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MIX_4X
|
|
||||||
float3 texel = tex2D(g_LandTextureSampler, input.TextureUV).rgb * tex2D(g_LandTextureSampler, input.TextureUV * -0.25).rgb * 4;
|
|
||||||
#else
|
|
||||||
float3 texel = tex2D(g_LandTextureSampler, input.TextureUV);
|
float3 texel = tex2D(g_LandTextureSampler, input.TextureUV);
|
||||||
#endif
|
|
||||||
return float4(saturate((texel.xyz + input.Diffuse) + (finalColor)), 1.0f);
|
return float4(saturate((texel.xyz + input.Diffuse) + (finalColor)), 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +29,6 @@ void RenderSceneVS(
|
|||||||
out float2 oTexCoord0 : TEXCOORD0 )
|
out float2 oTexCoord0 : TEXCOORD0 )
|
||||||
{
|
{
|
||||||
oPosition = mul(iPosition, g_mWorldViewProjection);
|
oPosition = mul(iPosition, g_mWorldViewProjection);
|
||||||
//oPosition = mul(iPosition, g_World);
|
|
||||||
//oPosition = mul(oPosition, g_View);
|
|
||||||
//oPosition = mul(oPosition, g_Projection);
|
|
||||||
oColor0 = float4(1, 1, 1, 1);
|
oColor0 = float4(1, 1, 1, 1);
|
||||||
oTexCoord0 = iTexCoord0;
|
oTexCoord0 = iTexCoord0;
|
||||||
}
|
}
|
||||||
@ -40,12 +37,7 @@ float4 RenderScenePS(
|
|||||||
float4 iColor : COLOR,
|
float4 iColor : COLOR,
|
||||||
float2 iTexCoord0 : TEXCOORD0) : COLOR0
|
float2 iTexCoord0 : TEXCOORD0) : COLOR0
|
||||||
{
|
{
|
||||||
//return float4(1, 1, 1, 1);
|
|
||||||
return tex2D(g_SkyTextureSampler, iTexCoord0);
|
return tex2D(g_SkyTextureSampler, iTexCoord0);
|
||||||
//oColor0 = tex2D(TextureDiffuse0Sampler, iTexCoord0);
|
|
||||||
//float intensity = dot(oColor0.rgb, float3(0.3, 0.59, 0.11));
|
|
||||||
//float p = smoothstep(intensityThreshold, 1.f, intensity);
|
|
||||||
//oColor0 = oColor0 * p * colorMultiplier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
technique RenderWithPixelShader
|
technique RenderWithPixelShader
|
||||||
|
BIN
Shaders/fxo/LandBump.fxo
Normal file
BIN
Shaders/fxo/LandBump.fxo
Normal file
Binary file not shown.
BIN
Shaders/fxo/Ocean.fxo
Normal file
BIN
Shaders/fxo/Ocean.fxo
Normal file
Binary file not shown.
BIN
Shaders/fxo/Sky.fxo
Normal file
BIN
Shaders/fxo/Sky.fxo
Normal file
Binary file not shown.
BIN
Shaders/fxo/Water.fxo
Normal file
BIN
Shaders/fxo/Water.fxo
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user