Added animated textures; Refactored screen width and height;

This commit is contained in:
MontyTRC89 2018-08-29 21:44:48 +02:00
parent dd81bcb1b2
commit dc196ca3d2
15 changed files with 263 additions and 61 deletions

View file

@ -135,6 +135,8 @@ VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
int modelType = round(tex2D(NormalSampler, input.TextureCoordinate).w * 16.0f);
float3 diffuseColor = tex2D(ColorSampler, input.TextureCoordinate).rgb;
float3 ambientColor = tex2D(VertexColorSampler, input.TextureCoordinate).rgb;
float4 light = tex2D(LightSampler, input.TextureCoordinate);
@ -145,7 +147,6 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
bool underwater = ((pixelFlags / 32) == 1);
if (pixelFlags >= 32) pixelFlags -= 32;
int modelType = pixelFlags;*/
int modelType = round(tex2D(NormalSampler, input.TextureCoordinate).w * 16.0f);
//if (underwater)
// return float4(0, 0, 1, 1);

View file

@ -161,7 +161,7 @@ PixelShaderOutput PixelShaderFunction(VertexShaderOutput input)
float3 yaxis = tex2D(CausticsSampler, p.xz).rgb;
float3 zaxis = tex2D(CausticsSampler, p.xy).rgb;
vertexColors += float4((xaxis * blending.x + yaxis * blending.y + zaxis * blending.z).xyz, 0.0f) * attenuation;
vertexColors += float4((xaxis * blending.x + yaxis * blending.y + zaxis * blending.z).xyz, 0.0f) * attenuation * 2.0f;
}
if (ModelType == MODELTYPE_ROOM || ModelType == MODELTYPE_ROOM_UNDERWATER)

View file

@ -55,8 +55,8 @@ float4x4 LightProjection;
bool AmbientPass;
float HalfPixelX = 1.0f / 800.0f;
float HalfPixelY = 1.0f / 600.0f;
float HalfPixelX;
float HalfPixelY;
texture2D ColorMap;
sampler ColorSampler = sampler_state
@ -152,7 +152,7 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
input.ScreenPosition.xy /= input.ScreenPosition.w;
texCoord = 0.5f * (float2(input.ScreenPosition.x, -input.ScreenPosition.y) + 1);
texCoord -= float2(0.5f / 800.0f, 0.5f / 600.0f);
texCoord -= float2(HalfPixelX, HalfPixelY);
}
// Get the normal and transform back to -1 ... 1