Re-add trail stuff what
This commit is contained in:
1 parent
cdfdfee05f
commit
7657ced963
2 files changed
+69
No files matched your search
@@ -0,0 +1,69 @@
|
||||
sampler uImage0 : register(s0);
|
||||
sampler uImage1 : register(s1);
|
||||
float3 uColor;
|
||||
float3 uSecondaryColor;
|
||||
float uOpacity;
|
||||
float uSaturation;
|
||||
float uRotation;
|
||||
float uTime;
|
||||
float4 uSourceRect;
|
||||
float2 uWorldPosition;
|
||||
float uDirection;
|
||||
float3 uLightSource;
|
||||
float2 uImageSize0;
|
||||
float2 uImageSize1;
|
||||
matrix uWorldViewProjection;
|
||||
float shouldFlip;
|
||||
float4 uShaderSpecificData;
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float2 TextureCoordinates : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float4 Color : COLOR0;
|
||||
float2 TextureCoordinates : TEXCOORD0;
|
||||
};
|
||||
|
||||
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output = (VertexShaderOutput)0;
|
||||
float4 pos = mul(input.Position, uWorldViewProjection);
|
||||
output.Position = pos;
|
||||
|
||||
output.Color = input.Color;
|
||||
output.TextureCoordinates = input.TextureCoordinates;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
float InverseLerp(float a, float b, float x)
|
||||
{
|
||||
return saturate((x - a) / (b - a));
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 color = input.Color;
|
||||
float2 coords = input.TextureCoordinates;
|
||||
|
||||
// Read the fade map as a streak.
|
||||
float4 fadeMapColor = tex2D(uImage1, coords - float2(uTime * 0.6, 0));
|
||||
float opacity = fadeMapColor.r;
|
||||
float bloomOpacity = sin(coords.y * 3.141) * 1.4;
|
||||
return lerp(color * bloomOpacity, color * opacity, InverseLerp(0, 0.26, coords.x));
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass TrailPass
|
||||
{
|
||||
VertexShader = compile vs_2_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_2_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user