diff options
| author | Bryan Galdrikian <[email protected]> | 2018-05-31 11:36:08 -0700 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2018-05-31 11:36:08 -0700 |
| commit | 7115f60b91b5717d90f643fd692010905c7004db (patch) | |
| tree | effd68c6978751c517d54c2f2bb5bb6e7dc93e18 /samples/resources/shaders/model_simple.hlsl | |
| parent | Updating BlastTool zip (diff) | |
| download | blast-1.1.3_rc1.tar.xz blast-1.1.3_rc1.zip | |
Blast 1.1.3. See docs/release_notes.txt.v1.1.3_rc1
Diffstat (limited to 'samples/resources/shaders/model_simple.hlsl')
| -rwxr-xr-x[-rw-r--r--] | samples/resources/shaders/model_simple.hlsl | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/samples/resources/shaders/model_simple.hlsl b/samples/resources/shaders/model_simple.hlsl index 7d55a72..9796a39 100644..100755 --- a/samples/resources/shaders/model_simple.hlsl +++ b/samples/resources/shaders/model_simple.hlsl @@ -1,42 +1,42 @@ -#include "common_buffers.hlsl" -#include "lighting.hlsl" - -struct VS_INPUT -{ - float3 position : POSITION0; - float3 normal : NORMAL0; - float health : TEXCOORD1; -}; - -struct VS_OUTPUT -{ - float4 position : SV_POSITION; - float4 worldPos : POSITION0; - float3 normal : NORMAL0; - float health : TEXCOORD1; -}; - -VS_OUTPUT VS(VS_INPUT iV) -{ - VS_OUTPUT oV; - - float4 worldSpacePos = mul(float4(iV.position, 1.0f), model); - oV.position = mul(worldSpacePos, viewProjection); - - oV.worldPos = worldSpacePos; - - // normals - float3 worldNormal = mul(iV.normal, (float3x3)model); - oV.normal = worldNormal; - - oV.health = iV.health; - - return oV; -} - -float4 PS(VS_OUTPUT iV) : SV_Target0 -{ - float3 lightColor = CalcPixelLight(defaultColor.xyz, iV.worldPos.xyz, iV.normal); - lightColor.r = 1.0f - iV.health; // hack for health - return float4(lightColor, 1); +#include "common_buffers.hlsl"
+#include "lighting.hlsl"
+
+struct VS_INPUT
+{
+ float3 position : POSITION0;
+ float3 normal : NORMAL0;
+ float health : TEXCOORD1;
+};
+
+struct VS_OUTPUT
+{
+ float4 position : SV_POSITION;
+ float4 worldPos : POSITION0;
+ float3 normal : NORMAL0;
+ float health : TEXCOORD1;
+};
+
+VS_OUTPUT VS(VS_INPUT iV)
+{
+ VS_OUTPUT oV;
+
+ float4 worldSpacePos = mul(float4(iV.position, 1.0f), model);
+ oV.position = mul(worldSpacePos, viewProjection);
+
+ oV.worldPos = worldSpacePos;
+
+ // normals
+ float3 worldNormal = mul(iV.normal, (float3x3)model);
+ oV.normal = worldNormal;
+
+ oV.health = iV.health;
+
+ return oV;
+}
+
+float4 PS(VS_OUTPUT iV) : SV_Target0
+{
+ float3 lightColor = CalcPixelLight(defaultColor.xyz, iV.worldPos.xyz, iV.normal);
+ lightColor.r = 1.0f - iV.health; // hack for health
+ return float4(lightColor, 1);
}
\ No newline at end of file |