-
Notifications
You must be signed in to change notification settings - Fork 0
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
9725920
commit 2a52f9d
Showing
7 changed files
with
118 additions
and
6 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
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,42 @@ | ||
//*************************************************************************************** | ||
// color.hlsl by Frank Luna (C) 2015 All Rights Reserved. | ||
// | ||
// Transforms and colors geometry. | ||
//*************************************************************************************** | ||
|
||
cbuffer cbPerObject : register(b0) | ||
{ | ||
float4x4 gWorldViewProj; | ||
}; | ||
|
||
struct VertexIn | ||
{ | ||
float3 PosL : POSITION; | ||
float4 Color : COLOR; | ||
}; | ||
|
||
struct VertexOut | ||
{ | ||
float4 PosH : SV_POSITION; | ||
float4 Color : COLOR; | ||
}; | ||
|
||
VertexOut VS(VertexIn vin) | ||
{ | ||
VertexOut vout; | ||
|
||
// Transform to homogeneous clip space. | ||
vout.PosH = mul(float4(vin.PosL, 1.0f), gWorldViewProj); | ||
|
||
// Just pass vertex color into the pixel shader. | ||
vout.Color = vin.Color; | ||
|
||
return vout; | ||
} | ||
|
||
float4 PS(VertexOut pin) : SV_Target | ||
{ | ||
return pin.Color; | ||
} | ||
|
||
|
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,31 @@ | ||
//********************************************************* | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// This code is licensed under the MIT License (MIT). | ||
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF | ||
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY | ||
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR | ||
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. | ||
// | ||
//********************************************************* | ||
|
||
struct PSInput | ||
{ | ||
float4 position : SV_POSITION; | ||
float4 color : COLOR; | ||
}; | ||
|
||
PSInput VSMain(float4 position : POSITION, float4 color : COLOR) | ||
{ | ||
PSInput result; | ||
|
||
result.position = position; | ||
result.color = color; | ||
|
||
return result; | ||
} | ||
|
||
float4 PSMain(PSInput input) : SV_TARGET | ||
{ | ||
return input.color; | ||
} |