template project, first version
This commit is contained in:
34
DirectXTK/Src/Shaders/SpriteEffect.fx
Normal file
34
DirectXTK/Src/Shaders/SpriteEffect.fx
Normal file
@@ -0,0 +1,34 @@
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
Texture2D<float4> Texture : register(t0);
|
||||
sampler TextureSampler : register(s0);
|
||||
|
||||
|
||||
cbuffer Parameters : register(b0)
|
||||
{
|
||||
row_major float4x4 MatrixTransform;
|
||||
};
|
||||
|
||||
|
||||
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 Texture.Sample(TextureSampler, texCoord) * color;
|
||||
}
|
||||
Reference in New Issue
Block a user