Skip to content

Commit

Permalink
Added Greyscale post processing effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Jul 25, 2020
1 parent bcd246a commit ee3ffb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Data/DaedalusX64/Shaders/Greyscale_f.cg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
float4 main(
float2 vTexcoord : TEXCOORD0,
uniform sampler2D colorMap : TEXUNIT0) : COLOR
{
float4 sample = tex2D(colorMap, vTexcoord);
float grey = 0.21 * sample.x + 0.71 * sample.y + 0.07 * sample.z;

return float4(grey, grey, grey, 1.0);
}
10 changes: 10 additions & 0 deletions Data/DaedalusX64/Shaders/Greyscale_v.cg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
void main(
float3 position,
float2 texcoord,
uniform float4x4 wvp,
out float4 vPosition : POSITION,
out float2 vTexcoord : TEXCOORD0)
{
vPosition = mul(wvp,float4(position, 1.f));
vTexcoord = texcoord;
}

0 comments on commit ee3ffb9

Please sign in to comment.