mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-06 19:01:06 +03:00
Added animated textures; Refactored screen width and height;
This commit is contained in:
parent
dd81bcb1b2
commit
dc196ca3d2
15 changed files with 263 additions and 61 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue