Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
Add effect.Image and effect.ImageTiled
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que committed Jul 27, 2016
1 parent 8466d17 commit fbc8203
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Build/Projects/Protogame.definition
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,12 @@
<None Include="..\Protogame.Resources\effect.Invert.fx">
<Link>Resources\effect.Invert.fx</Link>
</None>
<None Include="..\Protogame.Resources\effect.Image.fx">
<Link>Resources\effect.Image.fx</Link>
</None>
<None Include="..\Protogame.Resources\effect.ImageTiled.fx">
<Link>Resources\effect.ImageTiled.fx</Link>
</None>
<None Include="..\Protogame.Resources\effect.PointLight.fx">
<Link>Resources\effect.PointLight.fx</Link>
</None>
Expand Down
Binary file added Protogame.Resources/effect.Image-Android.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.Image-Linux.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.Image-MacOSX.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.Image-Ouya.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.Image-Windows.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.Image-iOS.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.ImageTiled-Android.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.ImageTiled-Linux.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.ImageTiled-MacOSX.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.ImageTiled-Ouya.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.ImageTiled-Windows.bin
Binary file not shown.
Binary file added Protogame.Resources/effect.ImageTiled-iOS.bin
Binary file not shown.
70 changes: 70 additions & 0 deletions Protogame.Resources/effect.ImageTiled.fx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
PROTOGAME_DECLARE_TEXTURE(Texture) = sampler_state
{
Texture = (Texture);
AddressU = WRAP;
AddressV = WRAP;
MagFilter = LINEAR;
MinFilter = LINEAR;
MipFilter = LINEAR;
};

float4x4 World;
float4x4 View;
float4x4 Projection;

struct VertexShaderInput
{
float4 Position : PROTOGAME_POSITION(0);
float2 TexCoord : PROTOGAME_TEXCOORD(0);
};

struct ForwardVertexShaderOutput
{
float4 Position : PROTOGAME_POSITION_RASTERIZER;
float2 TexCoord : PROTOGAME_TEXCOORD(0);
};

struct ForwardPixelShaderOutput
{
float4 Color : PROTOGAME_TARGET(0);
};

ForwardVertexShaderOutput ForwardVertexShader(VertexShaderInput input)
{
ForwardVertexShaderOutput output;

float4 worldPosition = mul(input.Position, World);
float4 viewPosition = mul(worldPosition, View);
output.Position = mul(viewPosition, Projection);

output.TexCoord = input.TexCoord;

return output;
}

ForwardPixelShaderOutput ForwardPixelShader(ForwardVertexShaderOutput input)
{
ForwardPixelShaderOutput output;

output.Color = PROTOGAME_SAMPLE_TEXTURE(Texture, input.TexCoord);

return output;
}

technique RENDER_PASS_TYPE_FORWARD
{
pass
{
VertexShader = compile PROTOGAME_VERTEX_LOW_SHADER ForwardVertexShader();
PixelShader = compile PROTOGAME_PIXEL_LOW_SHADER ForwardPixelShader();
}
}

technique RENDER_PASS_TYPE_CANVAS
{
pass
{
VertexShader = compile PROTOGAME_VERTEX_LOW_SHADER ForwardVertexShader();
PixelShader = compile PROTOGAME_PIXEL_LOW_SHADER ForwardPixelShader();
}
}

0 comments on commit fbc8203

Please sign in to comment.