Skinning.fxh shared shader file added
This commit is contained in:
Родитель
273e35f7ff
Коммит
86d888e076
|
@ -129,6 +129,7 @@ set(SHADER_SOURCES
|
|||
Src/Shaders/PostProcess.fx
|
||||
Src/Shaders/RootSig.fxh
|
||||
Src/Shaders/SkinnedEffect.fx
|
||||
Src/Shaders/Skinning.fxh
|
||||
Src/Shaders/SpriteEffect.fx
|
||||
Src/Shaders/Structures.fxh
|
||||
Src/Shaders/ToneMap.fx
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\SpriteEffect.fx" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
|
|
|
@ -374,5 +374,8 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -139,6 +139,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\SpriteEffect.fx" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
|
|
|
@ -374,5 +374,8 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -139,6 +139,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\SpriteEffect.fx" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
|
|
|
@ -374,5 +374,8 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -607,6 +607,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
<None Include="Src\TeapotData.inc" />
|
||||
|
|
|
@ -380,5 +380,8 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -616,6 +616,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
<None Include="Src\TeapotData.inc" />
|
||||
|
|
|
@ -380,5 +380,8 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -87,6 +87,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
<None Include="Src\TeapotData.inc" />
|
||||
|
|
|
@ -219,6 +219,9 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Src\AlphaTestEffect.cpp">
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
<None Include="Src\TeapotData.inc" />
|
||||
|
|
|
@ -219,6 +219,9 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Src\AlphaTestEffect.cpp">
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
<None Include="Src\Shaders\PBRCommon.fxh" />
|
||||
<None Include="Src\Shaders\PixelPacking_Velocity.hlsli" />
|
||||
<None Include="Src\Shaders\RootSig.fxh" />
|
||||
<None Include="Src\Shaders\Skinning.fxh" />
|
||||
<None Include="Src\Shaders\Structures.fxh" />
|
||||
<None Include="Src\Shaders\Utilities.fxh" />
|
||||
<None Include="Src\TeapotData.inc" />
|
||||
|
|
|
@ -382,5 +382,8 @@
|
|||
<Filter>Src\Shaders</Filter>
|
||||
</None>
|
||||
<None Include="README.md" />
|
||||
<None Include="Src\Shaders\Skinning.fxh">
|
||||
<Filter>Src\Shaders\Shared</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
Texture2D<float4> Texture : register(t0);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
Texture2D<float4> Texture : register(t0);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
float ComputeFogFactor(float4 position)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
Texture2D<float4> Texture : register(t0);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
Texture2D<float4> Texture : register(t0);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
struct ColorPair
|
||||
|
|
|
@ -42,21 +42,7 @@ cbuffer SkinningParameters : register(b1)
|
|||
#include "RootSig.fxh"
|
||||
#include "Lighting.fxh"
|
||||
#include "Utilities.fxh"
|
||||
|
||||
|
||||
float3 Skin(inout VSInputNmTxWeights vin, float3 normal, uniform int boneCount)
|
||||
{
|
||||
float4x3 skinning = 0;
|
||||
|
||||
[unroll]
|
||||
for (int i = 0; i < boneCount; i++)
|
||||
{
|
||||
skinning += Bones[vin.Indices[i]] * vin.Weights[i];
|
||||
}
|
||||
|
||||
vin.Position.xyz = mul(vin.Position, skinning);
|
||||
return mul(normal, (float3x3) skinning);
|
||||
}
|
||||
#include "Skinning.fxh"
|
||||
|
||||
|
||||
// Vertex shader: pixel lighting + texture.
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
struct CommonVSOutputPixelLighting
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
Texture2D<float4> Texture : register(t0);
|
||||
|
@ -38,21 +37,7 @@ cbuffer Parameters : register(b0)
|
|||
#include "RootSig.fxh"
|
||||
#include "Lighting.fxh"
|
||||
#include "Utilities.fxh"
|
||||
|
||||
[RootSignature(MainRS)]
|
||||
float3 Skin(inout VSInputNmTxWeights vin, float3 normal, uniform int boneCount)
|
||||
{
|
||||
float4x3 skinning = 0;
|
||||
|
||||
[unroll]
|
||||
for (int i = 0; i < boneCount; i++)
|
||||
{
|
||||
skinning += Bones[vin.Indices[i]] * vin.Weights[i];
|
||||
}
|
||||
|
||||
vin.Position.xyz = mul(vin.Position, skinning);
|
||||
return mul(normal, (float3x3)skinning);
|
||||
}
|
||||
#include "Skinning.fxh"
|
||||
|
||||
|
||||
// Vertex shader: vertex lighting, one bone.
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
|
||||
|
||||
float3 Skin(inout VSInputNmTxWeights vin, float3 normal, uniform int boneCount)
|
||||
{
|
||||
float4x3 skinning = 0;
|
||||
|
||||
[unroll]
|
||||
for (int i = 0; i < boneCount; i++)
|
||||
{
|
||||
skinning += Bones[vin.Indices[i]] * vin.Weights[i];
|
||||
}
|
||||
|
||||
vin.Position.xyz = mul(vin.Position, skinning);
|
||||
return mul(normal, (float3x3) skinning);
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the MIT License.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
#include "Structures.fxh"
|
||||
#include "RootSig.fxh"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
|
||||
|
||||
|
||||
// Vertex shader input structures.
|
||||
|
|
Загрузка…
Ссылка в новой задаче