Fixed Animate Skeleton, TODO Fix Skinning
This commit is contained in:
parent
98644e3fa0
commit
51711b86e3
|
@ -51,7 +51,9 @@ namespace Oyster
|
||||||
|
|
||||||
struct AnimationData
|
struct AnimationData
|
||||||
{
|
{
|
||||||
Math::Float4x4 animatedData[100];
|
Math::Float4x4 AnimatedData[100];
|
||||||
|
Math::Float4x4 BindPoseData[100];
|
||||||
|
Math::Float4x4 RotationData[100];
|
||||||
int Animated;
|
int Animated;
|
||||||
Math::Float3 Pad;
|
Math::Float3 Pad;
|
||||||
};
|
};
|
||||||
|
|
|
@ -84,9 +84,9 @@ namespace Oyster
|
||||||
{
|
{
|
||||||
cube->WorldMatrix == Math::Matrix::identity;
|
cube->WorldMatrix == Math::Matrix::identity;
|
||||||
////store inverse absolut transform
|
////store inverse absolut transform
|
||||||
Math::Matrix* SkinTransform = new Math::Matrix[info->BoneCount];
|
Math::Matrix SkinTransform[100];
|
||||||
Math::Matrix* BoneAnimated = new Math::Matrix[info->BoneCount];
|
Math::Matrix BoneAnimated[100];
|
||||||
Math::Matrix* BoneAbsAnimated = new Math::Matrix[info->BoneCount];
|
Math::Matrix BoneAbsAnimated[100];
|
||||||
|
|
||||||
Math::Matrix Scale = Math::Matrix::identity;
|
Math::Matrix Scale = Math::Matrix::identity;
|
||||||
Scale.m[0][0] = 1;
|
Scale.m[0][0] = 1;
|
||||||
|
@ -107,28 +107,41 @@ namespace Oyster
|
||||||
cube2->WorldMatrix.v[3] = info->bones[b].Absolute.v[3];
|
cube2->WorldMatrix.v[3] = info->bones[b].Absolute.v[3];
|
||||||
//Basic::RenderScene(cube2,1, View, Projection);
|
//Basic::RenderScene(cube2,1, View, Projection);
|
||||||
}
|
}
|
||||||
BoneAnimated[8] = Math3D::RotationMatrix(3.14/4, Math::Float3(0, 0, 1)) * info->bones[8].Relative;
|
//BoneAnimated[8] = Math3D::RotationMatrix(3.14/4, Math::Float3(0, 0, 1)) * info->bones[8].Relative;
|
||||||
BoneAnimated[31] = Math3D::RotationMatrix(3.14/4, Math::Float3(0, 0, 1)) * info->bones[31].Relative;
|
//BoneAnimated[31] = Math3D::RotationMatrix(3.14/4, Math::Float3(0, 0, 1)) * info->bones[31].Relative;
|
||||||
////for each bone in animation
|
////for each bone in animation
|
||||||
////HACK use first bone
|
////HACK use first bone
|
||||||
//int b = 0;
|
int b = 0;
|
||||||
//Model::Animation A = info->Animations[models[i].AnimationPlaying];
|
Model::Animation A = info->Animations[models[i].AnimationPlaying];
|
||||||
//for(int b = 0; b < A.Bones;++b)
|
while(models[i].AnimationTime>A.duration)
|
||||||
//{
|
models[i].AnimationTime -= A.duration;
|
||||||
// //for each frame on bone Write current relative data
|
|
||||||
// //HACK use first frame
|
float position = models[i].AnimationTime;
|
||||||
// int f = 0;
|
for(int b = 0; b < A.Bones;++b)
|
||||||
// //for(int f = 0; f < A.Frames[b]; ++b)
|
{
|
||||||
// {
|
//find current frame
|
||||||
// //find right frame
|
int nrOfFrames = A.Frames[b];
|
||||||
// //HACK accept first
|
Model::Frame PFrame = A.Keyframes[b][nrOfFrames-1];
|
||||||
// Model::Frame Current = A.Keyframes[b][f];
|
Model::Frame NFrame = A.Keyframes[b][nrOfFrames-1];
|
||||||
//
|
bool FrameFound = false;
|
||||||
// //calculate new matrix
|
for (int i = 0; i < nrOfFrames; i++)
|
||||||
// Model::Bone CBone = Current.bone;
|
{
|
||||||
// BoneAnimated[CBone.Parent] = CBone.Relative;
|
if(position < A.Keyframes[b][i].time)
|
||||||
// }
|
{
|
||||||
//}
|
PFrame = A.Keyframes[b][i-1];
|
||||||
|
NFrame = A.Keyframes[b][i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
float denominator = (NFrame.time - PFrame.time);
|
||||||
|
if(denominator == 0)
|
||||||
|
{
|
||||||
|
BoneAnimated[PFrame.bone.Parent] = PFrame.bone.Relative;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
float inter = (float)((position - PFrame.time) / denominator);
|
||||||
|
Math3D::InterpolateOrientation_UsingNonRigidNlerp(PFrame.bone.Relative,NFrame.bone.Relative,inter, BoneAnimated[PFrame.bone.Parent]);
|
||||||
|
}
|
||||||
|
|
||||||
////calculate Absolute Animation Transform
|
////calculate Absolute Animation Transform
|
||||||
for(int b = 0; b < info->BoneCount; ++b)
|
for(int b = 0; b < info->BoneCount; ++b)
|
||||||
|
@ -143,7 +156,8 @@ namespace Oyster
|
||||||
//write data to am
|
//write data to am
|
||||||
for(int b = 0; b < info->BoneCount; ++b)
|
for(int b = 0; b < info->BoneCount; ++b)
|
||||||
{
|
{
|
||||||
am.animatedData[b] = SkinTransform[b] * BoneAbsAnimated[b];
|
am.AnimatedData[b] = (BoneAbsAnimated[b] * SkinTransform[b]);
|
||||||
|
am.BindPoseData[b] = info->bones[b].Absolute;//Math3D::ExtractRotationMatrix(am.animatedData[b]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//retore to draw animated model
|
//retore to draw animated model
|
||||||
|
@ -155,9 +169,9 @@ namespace Oyster
|
||||||
memcpy(data,&(pm),sizeof(pm));
|
memcpy(data,&(pm),sizeof(pm));
|
||||||
Resources::Deffered::ModelData.Unmap();
|
Resources::Deffered::ModelData.Unmap();
|
||||||
|
|
||||||
delete[]SkinTransform;
|
//delete[]SkinTransform;
|
||||||
delete[]BoneAbsAnimated;
|
//delete[]BoneAbsAnimated;
|
||||||
delete[]BoneAnimated;
|
//delete[]BoneAnimated;
|
||||||
|
|
||||||
am.Animated = 1;
|
am.Animated = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ struct VertexIn
|
||||||
float3 normal : NORMAL;
|
float3 normal : NORMAL;
|
||||||
float3 tangent : TANGENT;
|
float3 tangent : TANGENT;
|
||||||
float3 biTangent : BITANGENT;
|
float3 biTangent : BITANGENT;
|
||||||
float4 boneIndex : BONEINDEX;
|
int4 boneIndex : BONEINDEX;
|
||||||
float4 boneWeight : BONEWEIGHT;
|
float4 boneWeight : BONEWEIGHT;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,7 +32,9 @@ SamplerState S1 : register(s0);
|
||||||
|
|
||||||
cbuffer Animation : register(b0)
|
cbuffer Animation : register(b0)
|
||||||
{
|
{
|
||||||
float4x4 BoneAnimation[100];
|
float4x4 AnimatedData[100];
|
||||||
|
float4x4 BindPoseData[100];
|
||||||
|
float4x4 RotationData[100];
|
||||||
int Animated;
|
int Animated;
|
||||||
float3 Pad;
|
float3 Pad;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,14 @@ Texture2D Ambient : register(t2);
|
||||||
|
|
||||||
RWTexture2D<float4> Output;
|
RWTexture2D<float4> Output;
|
||||||
|
|
||||||
|
#define AmbFactor 0.3f;
|
||||||
|
|
||||||
[numthreads(16, 16, 1)]
|
[numthreads(16, 16, 1)]
|
||||||
void main( uint3 DTid : SV_DispatchThreadID )
|
void main( uint3 DTid : SV_DispatchThreadID )
|
||||||
{
|
{
|
||||||
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy] + Diffuse[DTid.xy] * Ambient[DTid.xy/2].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW
|
float4 Light = Diffuse[DTid.xy] + Specular[DTid.xy];
|
||||||
Output[DTid.xy] = float4(Ambient[DTid.xy/2].xyz /* * Ambient[DTid.xy/2].w */, 1);
|
float4 Amb = float4(Ambient[DTid.xy/2].xyz * Ambient[DTid.xy/2].w,1);
|
||||||
|
//Output[DTid.xy] = float4(Ambient[DTid.xy/2].xyz /* * Ambient[DTid.xy/2].w */, 1);
|
||||||
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy];
|
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy];
|
||||||
|
Output[DTid.xy] = Light + Amb * AmbFactor;
|
||||||
}
|
}
|
|
@ -3,12 +3,20 @@
|
||||||
VertexOut main( VertexIn input )
|
VertexOut main( VertexIn input )
|
||||||
{
|
{
|
||||||
VertexOut output;
|
VertexOut output;
|
||||||
Matrix boneTrans = BoneAnimation[input.boneIndex.x]*input.boneWeight.x +
|
|
||||||
BoneAnimation[input.boneIndex.y]*input.boneWeight.y +
|
|
||||||
BoneAnimation[input.boneIndex.z]*input.boneWeight.z +
|
|
||||||
BoneAnimation[input.boneIndex.w]*input.boneWeight.w;
|
|
||||||
|
|
||||||
input.pos = mul(boneTrans, input.pos) + input.pos * int(1-Animated);;
|
float3 offsetX = input.pos - BindPoseData[input.boneIndex.x][3].xyz;
|
||||||
|
float3 offsetY = input.pos - BindPoseData[input.boneIndex.y][3].xyz;
|
||||||
|
float3 offsetZ = input.pos - BindPoseData[input.boneIndex.z][3].xyz;
|
||||||
|
float3 offsetW = input.pos - BindPoseData[input.boneIndex.w][3].xyz;
|
||||||
|
|
||||||
|
Matrix boneTrans = AnimatedData[input.boneIndex.x]*input.boneWeight.x +
|
||||||
|
AnimatedData[input.boneIndex.y]*input.boneWeight.y +
|
||||||
|
AnimatedData[input.boneIndex.z]*input.boneWeight.z +
|
||||||
|
AnimatedData[input.boneIndex.w]*input.boneWeight.w;
|
||||||
|
|
||||||
|
input.pos = mul(boneTrans,input.pos) * Animated + input.pos * int(1-Animated);
|
||||||
|
|
||||||
|
input.normal = mul(boneTrans,input.normal) * Animated + input.normal * int(1-Animated);
|
||||||
/*input.pos =
|
/*input.pos =
|
||||||
(mul(BoneAnimation[input.boneIndex.x], input.pos) * input.boneWeight.x * Animated) +
|
(mul(BoneAnimation[input.boneIndex.x], input.pos) * input.boneWeight.x * Animated) +
|
||||||
(mul(BoneAnimation[input.boneIndex.y], input.pos) * input.boneWeight.y * Animated) +
|
(mul(BoneAnimation[input.boneIndex.y], input.pos) * input.boneWeight.y * Animated) +
|
||||||
|
|
|
@ -0,0 +1,287 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{0EC83E64-230E-48EF-B08C-6AC9651B4F82}</ProjectGuid>
|
||||||
|
<RootNamespace>OysterGraphics</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
|
||||||
|
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||||
|
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||||
|
<IncludePath>C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
|
||||||
|
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||||
|
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||||
|
<IncludePath>C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win32;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
|
||||||
|
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||||
|
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||||
|
<IncludePath>C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<OutDir>$(SolutionDir)..\Bin\DLL\</OutDir>
|
||||||
|
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||||
|
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||||
|
<IncludePath>C:\Program Files (x86)\Visual Leak Detector\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>C:\Program Files (x86)\Visual Leak Detector\lib\Win64;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)OysterMath;$(SolutionDir)Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>GFX_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<ProjectReference>
|
||||||
|
<LinkLibraryDependencies>true</LinkLibraryDependencies>
|
||||||
|
</ProjectReference>
|
||||||
|
<FxCompile>
|
||||||
|
<ObjectFileOutput>$(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso</ObjectFileOutput>
|
||||||
|
<ShaderModel>5.0</ShaderModel>
|
||||||
|
</FxCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>..\OysterPhysic3D\Collision;..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>GFX_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<FxCompile>
|
||||||
|
<ObjectFileOutput>$(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso</ObjectFileOutput>
|
||||||
|
<ShaderModel>5.0</ShaderModel>
|
||||||
|
</FxCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>GFX_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
<FxCompile>
|
||||||
|
<ObjectFileOutput>$(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso</ObjectFileOutput>
|
||||||
|
<EnableDebuggingInformation>true</EnableDebuggingInformation>
|
||||||
|
<ShaderModel>5.0</ShaderModel>
|
||||||
|
</FxCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>GFX_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
<FxCompile>
|
||||||
|
<ObjectFileOutput>$(SolutionDir)..\Bin\Content\Shaders\%(Filename).cso</ObjectFileOutput>
|
||||||
|
<EnableDebuggingInformation>true</EnableDebuggingInformation>
|
||||||
|
<ShaderModel>5.0</ShaderModel>
|
||||||
|
</FxCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Core\Buffer.cpp" />
|
||||||
|
<ClCompile Include="Core\Core.cpp" />
|
||||||
|
<ClCompile Include="Core\Init.cpp" />
|
||||||
|
<ClCompile Include="Core\PipelineManager.cpp" />
|
||||||
|
<ClCompile Include="DllInterfaces\GFXAPI.cpp" />
|
||||||
|
<ClCompile Include="FileLoader\DanLoader.cpp" />
|
||||||
|
<ClCompile Include="FileLoader\ObjReader.cpp" />
|
||||||
|
<ClCompile Include="FileLoader\ShaderLoader.cpp" />
|
||||||
|
<ClCompile Include="FileLoader\ModelLoader.cpp" />
|
||||||
|
<ClCompile Include="Render\Preparations\BasicPreparations.cpp" />
|
||||||
|
<ClCompile Include="Render\Rendering\BasicRender.cpp" />
|
||||||
|
<ClCompile Include="Render\Resources\Deffered.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Core\Core.h" />
|
||||||
|
<ClInclude Include="Core\Dx11Includes.h" />
|
||||||
|
<ClInclude Include="DllInterfaces\GFXAPI.h" />
|
||||||
|
<ClInclude Include="FileLoader\ObjReader.h" />
|
||||||
|
<ClInclude Include="FileLoader\GeneralLoader.h" />
|
||||||
|
<ClInclude Include="Model\Model.h" />
|
||||||
|
<ClInclude Include="Model\ModelInfo.h" />
|
||||||
|
<ClInclude Include="Render\Preparations\Preparations.h" />
|
||||||
|
<ClInclude Include="Render\Rendering\Render.h" />
|
||||||
|
<ClInclude Include="Definitions\GraphicalDefinition.h" />
|
||||||
|
<ClInclude Include="Render\Resources\Deffered.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Misc\Misc.vcxproj">
|
||||||
|
<Project>{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\OysterMath\OysterMath.vcxproj">
|
||||||
|
<Project>{f10cbc03-9809-4cba-95d8-327c287b18ee}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<FxCompile Include="Shader\HLSL\Deffered Shaders\LightPass.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\Deffered Shaders\PixelGatherData.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\Deffered Shaders\PostPass.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\Deffered Shaders\VertexGatherData.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugCameraVertex.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||||
|
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
</AssemblerOutput>
|
||||||
|
<AssemblerOutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
</AssemblerOutputFile>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugPixel.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
|
||||||
|
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||||
|
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">main</EntryPointName>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugVertex.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
|
||||||
|
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
|
||||||
|
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
|
||||||
|
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">main</EntryPointName>
|
||||||
|
<AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
</AssemblerOutput>
|
||||||
|
</FxCompile>
|
||||||
|
<FxCompile Include="Shader\HLSL\SimpleDebug\TextureDebug.hlsl">
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||||
|
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
|
||||||
|
</FxCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Shader\HLSL\Deffered Shaders\Defines.hlsli" />
|
||||||
|
<None Include="Shader\HLSL\Deffered Shaders\GBufferHeader.hlsli" />
|
||||||
|
<None Include="Shader\HLSL\Deffered Shaders\LightCalc.hlsli" />
|
||||||
|
<None Include="Shader\HLSL\Deffered Shaders\PosManipulation.hlsli" />
|
||||||
|
<None Include="Shader\HLSL\Deffered Shaders\SSAO.hlsli" />
|
||||||
|
<None Include="Shader\HLSL\Scene.fbx" />
|
||||||
|
<None Include="Shader\HLSL\SimpleDebug\Debug.hlsl" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
|
@ -160,7 +160,7 @@ HRESULT InitDirect3D()
|
||||||
}
|
}
|
||||||
|
|
||||||
m = Oyster::Graphics::API::CreateModel(L"untitled.dan");
|
m = Oyster::Graphics::API::CreateModel(L"untitled.dan");
|
||||||
m2 = Oyster::Graphics::API::CreateModel(L"still_root_origo.dan");
|
m2 = Oyster::Graphics::API::CreateModel(L"rigidbind_animtest_arms_bindpose (1).dan");
|
||||||
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null);
|
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null);
|
||||||
m2->AnimationPlaying = 0;
|
m2->AnimationPlaying = 0;
|
||||||
m2->AnimationTime = 0.0f;
|
m2->AnimationTime = 0.0f;
|
||||||
|
@ -179,7 +179,7 @@ HRESULT InitDirect3D()
|
||||||
Oyster::Graphics::Definitions::Pointlight pl;
|
Oyster::Graphics::Definitions::Pointlight pl;
|
||||||
pl.Color = Oyster::Math::Float3(1,1,1);
|
pl.Color = Oyster::Math::Float3(1,1,1);
|
||||||
pl.Bright = 1;
|
pl.Bright = 1;
|
||||||
pl.Pos = Oyster::Math::Float3(0,-20.0f,30.4f);
|
pl.Pos = Oyster::Math::Float3(0,-20.0f,0.4f);
|
||||||
pl.Radius = 90;
|
pl.Radius = 90;
|
||||||
|
|
||||||
Oyster::Graphics::API::AddLight(pl);
|
Oyster::Graphics::API::AddLight(pl);
|
||||||
|
@ -198,7 +198,7 @@ HRESULT Update(float deltaTime)
|
||||||
//ma *= 50;
|
//ma *= 50;
|
||||||
//ma.m44 = 1;
|
//ma.m44 = 1;
|
||||||
//m2->WorldMatrix = m2->WorldMatrix * ma;
|
//m2->WorldMatrix = m2->WorldMatrix * ma;
|
||||||
m2->AnimationTime += deltaTime * 0.5f;
|
//m2->AnimationTime += deltaTime * 0.5f;
|
||||||
//m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(1,0,0)*-0,Oyster::Math::Float3(3,4,-1*angle),Oyster::Math::Float3::null);
|
//m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(1,0,0)*-0,Oyster::Math::Float3(3,4,-1*angle),Oyster::Math::Float3::null);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,17 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
|
||||||
Oyster::Graphics::API::ReloadShaders();
|
Oyster::Graphics::API::ReloadShaders();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
//Z -
|
||||||
|
case 0x5A:
|
||||||
|
m2->AnimationTime -= 0.1f;
|
||||||
|
if(m2->AnimationTime < 0)
|
||||||
|
m2->AnimationTime = 0;
|
||||||
|
break;
|
||||||
|
//X +
|
||||||
|
case 0x58:
|
||||||
|
m2->AnimationTime += 0.1f;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue