-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5aad737
commit 129b997
Showing
5 changed files
with
91 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
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
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,47 @@ | ||
//-------------------------------------------------------------------------------------- | ||
// Constant buffers | ||
//-------------------------------------------------------------------------------------- | ||
Texture2D diffuse_texture : register(t0); | ||
SamplerState linear_sample : register(s0); | ||
|
||
cbuffer cb_camera : register(b0) { | ||
matrix world_to_view; | ||
matrix view_to_projection; | ||
}; | ||
|
||
cbuffer cb_model : register(b1) { | ||
matrix model_to_world; | ||
} | ||
|
||
//----------------------------------------------------------------------------- | ||
// Input structures | ||
//----------------------------------------------------------------------------- | ||
struct VS_INPUT { | ||
float4 p : POSITION; | ||
float3 n : NORMAL; | ||
float2 tex : TEXCOORD0; | ||
}; | ||
|
||
struct PS_INPUT { | ||
float4 p : SV_POSITION; | ||
float2 tex : TEXCOORD0; | ||
}; | ||
|
||
//----------------------------------------------------------------------------- | ||
// Vertex Shader | ||
//----------------------------------------------------------------------------- | ||
PS_INPUT VS(VS_INPUT input) { | ||
PS_INPUT output = (PS_INPUT)0; | ||
output.p = mul(input.p, model_to_world); | ||
output.p = mul(output.p, world_to_view); | ||
output.p = mul(output.p, view_to_projection); | ||
output.tex = input.tex; | ||
return output; | ||
} | ||
|
||
//----------------------------------------------------------------------------- | ||
// Pixel Shader | ||
//----------------------------------------------------------------------------- | ||
float4 PS(PS_INPUT input) : SV_Target{ | ||
return diffuse_texture.Sample(linear_sample, input.tex); | ||
} |
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 @@ | ||
#include "effect.fx" |
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 @@ | ||
#include "effect.fx" |