added a shader folder for the stock shaders started the StockShaderCodeGenerator tool added a tools solution file added a bin folder in tools folder for precompiled tools and changed tools project files removed StockEffects content project from solution and added the effect files to the shader folder for reference
45 lines
1.0 KiB
HLSL
45 lines
1.0 KiB
HLSL
//-----------------------------------------------------------------------------
|
|
// SpriteEffect.fx
|
|
//
|
|
// Microsoft XNA Community Game Platform
|
|
// Copyright (C) Microsoft Corporation. All rights reserved.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#include "Macros.fxh"
|
|
|
|
|
|
DECLARE_TEXTURE(Texture, 0);
|
|
|
|
|
|
BEGIN_CONSTANTS
|
|
MATRIX_CONSTANTS
|
|
|
|
float4x4 MatrixTransform _vs(c0) _cb(c0);
|
|
|
|
END_CONSTANTS
|
|
|
|
|
|
void SpriteVertexShader(inout float4 color : COLOR0,
|
|
inout float2 texCoord : TEXCOORD0,
|
|
inout float4 position : SV_Position)
|
|
{
|
|
position = mul(position, MatrixTransform);
|
|
}
|
|
|
|
|
|
float4 SpritePixelShader(float4 color : COLOR0,
|
|
float2 texCoord : TEXCOORD0) : SV_Target0
|
|
{
|
|
return SAMPLE_TEXTURE(Texture, texCoord) * color;
|
|
}
|
|
|
|
|
|
technique SpriteBatch
|
|
{
|
|
pass
|
|
{
|
|
VertexShader = compile vs_2_0 SpriteVertexShader();
|
|
PixelShader = compile ps_2_0 SpritePixelShader();
|
|
}
|
|
}
|