This repository has been archived by the owner on Mar 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add effect.Image and effect.ImageTiled
- Loading branch information
Showing
14 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |