Merge branch 'Graphics' of https://github.com/dean11/Danbias into Graphics

Conflicts:
	Code/DanBias.sln
	Code/OysterGraphics/Model/Model.h
	Code/OysterGraphics/Shader/HLSL/Deffered Shaders/PostPass.hlsl
	Code/Tester/Tester.vcxproj
This commit is contained in:
lanariel 2014-01-27 15:38:09 +01:00
commit 9cf82dd3b1
17 changed files with 594 additions and 398 deletions

View File

@ -23,26 +23,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OysterNetworkServer", "Netw
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkDependencies", "Network\NetworkDependencies\NetworkDependencies.vcxproj", "{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkDependencies", "Network\NetworkDependencies\NetworkDependencies.vcxproj", "{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameLogic", "GameLogic\GameLogic.vcxproj", "{B1195BB9-B3A5-47F0-906C-8DEA384D1520}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\GamePhysics.vcxproj", "{104FA3E9-94D9-4E1D-A941-28A03BC8A095}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\GamePhysics.vcxproj", "{104FA3E9-94D9-4E1D-A941-28A03BC8A095}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "Game\DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tester", "Tester\Tester.vcxproj", "{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Game", "Game", "{20720CA7-795C-45AD-A302-9383A6DD503A}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameLogic", "Game\GameLogic\GameLogic.vcxproj", "{B1195BB9-B3A5-47F0-906C-8DEA384D1520}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasServer", "Game\DanBiasServer\DanBiasServer.vcxproj", "{52380DAA-0F4A-4D97-8E57-98DF39319CAF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasLauncher", "Game\DanBiasLauncher\DanBiasLauncher.vcxproj", "{8690FDDF-C5B7-4C42-A337-BD5243F29B85}"
ProjectSection(ProjectDependencies) = postProject
{52380DAA-0F4A-4D97-8E57-98DF39319CAF} = {52380DAA-0F4A-4D97-8E57-98DF39319CAF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetworkAPI", "Network\NetworkAPI\NetworkAPI.vcxproj", "{460D625F-2AC9-4559-B809-0BA89CEAEDF4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameProtocols", "Game\GameProtocols\GameProtocols.vcxproj", "{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasServerLauncher", "Game\DanBiasServerLauncher\DanBiasServerLauncher.vcxproj", "{060B1890-CBF3-4808-BA99-A4776222093B}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -54,26 +41,26 @@ Global
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Mixed Platforms.Build.0 = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.ActiveCfg = Debug|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Build.0 = Debug|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.Build.0 = Release|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Mixed Platforms.Build.0 = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.ActiveCfg = Release|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.ActiveCfg = Release|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.Build.0 = Release|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|Win32.Build.0 = Release|Win32
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.ActiveCfg = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.ActiveCfg = Release|x64
{0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.Build.0 = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Release|x64.Build.0 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Mixed Platforms.Build.0 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.ActiveCfg = Debug|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Build.0 = Debug|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.Build.0 = Release|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Mixed Platforms.Build.0 = Release|x64
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.ActiveCfg = Release|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.ActiveCfg = Release|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.Build.0 = Release|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|Win32.Build.0 = Release|Win32
{F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|x64.ActiveCfg = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Release|x64.ActiveCfg = Release|x64
@ -126,54 +113,65 @@ Global
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.Build.0 = Release|Win32 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|Win32.Build.0 = Release|Win32
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.ActiveCfg = Release|x64 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.ActiveCfg = Release|x64
{7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.Build.0 = Release|x64 {7E3990D2-3D94-465C-B58D-64A74B3ECF9B}.Release|x64.Build.0 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.Build.0 = Release|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Mixed Platforms.Build.0 = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.ActiveCfg = Release|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.ActiveCfg = Release|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.Build.0 = Release|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|Win32.Build.0 = Release|Win32
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.ActiveCfg = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.ActiveCfg = Release|x64
{2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.Build.0 = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Release|x64.Build.0 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Mixed Platforms.Build.0 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.ActiveCfg = Debug|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.ActiveCfg = Debug|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.Build.0 = Debug|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|Win32.Build.0 = Debug|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.ActiveCfg = Debug|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Debug|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Debug|x64.Build.0 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.Build.0 = Release|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Mixed Platforms.Build.0 = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.ActiveCfg = Release|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.ActiveCfg = Release|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.Build.0 = Release|Win32 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|Win32.Build.0 = Release|Win32
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.ActiveCfg = Release|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.ActiveCfg = Release|x64
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.Build.0 = Release|x64 {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8}.Release|x64.Build.0 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Mixed Platforms.Build.0 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.ActiveCfg = Debug|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.ActiveCfg = Debug|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.Build.0 = Debug|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|Win32.Build.0 = Debug|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.ActiveCfg = Debug|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Debug|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Debug|x64.Build.0 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.Build.0 = Release|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|Mixed Platforms.Build.0 = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.ActiveCfg = Release|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.ActiveCfg = Release|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.Build.0 = Release|Win32 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|Win32.Build.0 = Release|Win32
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.ActiveCfg = Release|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.ActiveCfg = Release|x64
{6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.Build.0 = Release|x64 {6A066806-F43F-4B31-A4E3-57179674F460}.Release|x64.Build.0 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Debug|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Debug|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.Build.0 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.Build.0 = Release|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Mixed Platforms.Build.0 = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.ActiveCfg = Release|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.ActiveCfg = Release|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.Build.0 = Release|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|Win32.Build.0 = Release|Win32
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.ActiveCfg = Release|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.ActiveCfg = Release|x64
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.Build.0 = Release|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Release|x64.Build.0 = Release|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.ActiveCfg = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
@ -184,8 +182,19 @@ Global
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.Build.0 = Release|Win32 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.ActiveCfg = Release|x64 {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|x64.Build.0 = Release|x64 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Mixed Platforms.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.ActiveCfg = Debug|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.Build.0 = Debug|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Mixed Platforms.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.Build.0 = Release|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32
@ -198,78 +207,6 @@ Global
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64
{2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64 {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.ActiveCfg = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|Win32.Build.0 = Debug|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.ActiveCfg = Debug|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Debug|x64.Build.0 = Debug|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Mixed Platforms.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.ActiveCfg = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|Win32.Build.0 = Release|Win32
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.ActiveCfg = Release|x64
{B1195BB9-B3A5-47F0-906C-8DEA384D1520}.Release|x64.Build.0 = Release|x64
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.ActiveCfg = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|Win32.Build.0 = Debug|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.ActiveCfg = Debug|x64
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Debug|x64.Build.0 = Debug|x64
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Mixed Platforms.Build.0 = Release|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Win32.ActiveCfg = Release|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|Win32.Build.0 = Release|Win32
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|x64.ActiveCfg = Release|x64
{52380DAA-0F4A-4D97-8E57-98DF39319CAF}.Release|x64.Build.0 = Release|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.ActiveCfg = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|Win32.Build.0 = Debug|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.ActiveCfg = Debug|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Debug|x64.Build.0 = Debug|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Mixed Platforms.Build.0 = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.ActiveCfg = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|Win32.Build.0 = Release|Win32
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.ActiveCfg = Release|x64
{8690FDDF-C5B7-4C42-A337-BD5243F29B85}.Release|x64.Build.0 = Release|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.ActiveCfg = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|Win32.Build.0 = Debug|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.ActiveCfg = Debug|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Debug|x64.Build.0 = Debug|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Mixed Platforms.Build.0 = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.ActiveCfg = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|Win32.Build.0 = Release|Win32
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.ActiveCfg = Release|x64
{460D625F-2AC9-4559-B809-0BA89CEAEDF4}.Release|x64.Build.0 = Release|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.ActiveCfg = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|Win32.Build.0 = Debug|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.ActiveCfg = Debug|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Debug|x64.Build.0 = Debug|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Mixed Platforms.Build.0 = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.ActiveCfg = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|Win32.Build.0 = Release|Win32
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.ActiveCfg = Release|x64
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78}.Release|x64.Build.0 = Release|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.ActiveCfg = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|Win32.Build.0 = Debug|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.ActiveCfg = Debug|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Debug|x64.Build.0 = Debug|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Mixed Platforms.Build.0 = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.ActiveCfg = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|Win32.Build.0 = Release|Win32
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.ActiveCfg = Release|x64
{060B1890-CBF3-4808-BA99-A4776222093B}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -278,12 +215,5 @@ Global
{838B25C2-D19E-49FE-8CB0-9A977CA3C7E8} = {C27B926E-B3EF-4990-8822-47580E43A0BE} {838B25C2-D19E-49FE-8CB0-9A977CA3C7E8} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{6A066806-F43F-4B31-A4E3-57179674F460} = {C27B926E-B3EF-4990-8822-47580E43A0BE} {6A066806-F43F-4B31-A4E3-57179674F460} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{C5AA09D0-6594-4CD3-BD92-1D380C7B3B50} = {C27B926E-B3EF-4990-8822-47580E43A0BE} {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{460D625F-2AC9-4559-B809-0BA89CEAEDF4} = {C27B926E-B3EF-4990-8822-47580E43A0BE}
{2A1BC987-AF42-4500-802D-89CD32FC1309} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{B1195BB9-B3A5-47F0-906C-8DEA384D1520} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{52380DAA-0F4A-4D97-8E57-98DF39319CAF} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{8690FDDF-C5B7-4C42-A337-BD5243F29B85} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{DA2AA800-ED64-4649-8B3B-E7F1E3968B78} = {20720CA7-795C-45AD-A302-9383A6DD503A}
{060B1890-CBF3-4808-BA99-A4776222093B} = {20720CA7-795C-45AD-A302-9383A6DD503A}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -14,12 +14,6 @@ namespace Oyster
Oyster::Math::Float3 normal; Oyster::Math::Float3 normal;
}; };
struct VP
{
Oyster::Math::Matrix V;
Oyster::Math::Matrix P;
};
struct PerModel struct PerModel
{ {
Math::Matrix WV; Math::Matrix WV;
@ -55,6 +49,13 @@ namespace Oyster
float Bright; float Bright;
}; };
struct AnimationData
{
int Animated;
Math::Float3 Pad;
Math::Matrix animatedData[10];
};
} }
} }
} }

View File

@ -82,8 +82,9 @@ namespace Oyster
Model::Model* m = new Model::Model(); Model::Model* m = new Model::Model();
m->WorldMatrix = Oyster::Math::Float4x4::identity; m->WorldMatrix = Oyster::Math::Float4x4::identity;
m->Visible = true; m->Visible = true;
m->AnimationPlaying = -1;
m->info = Oyster::Resource::OysterResource::LoadResource(filename.c_str(),Oyster::Graphics::Loading::LoadDAN); m->info = (Model::ModelInfo*)Oyster::Resource::OysterResource::LoadResource(filename.c_str(),Oyster::Graphics::Loading::LoadDAN);
Model::ModelInfo* mi = (Model::ModelInfo*)m->info; Model::ModelInfo* mi = (Model::ModelInfo*)m->info;
if(!mi || mi->Vertices->GetBufferPointer() == NULL) if(!mi || mi->Vertices->GetBufferPointer() == NULL)

View File

@ -102,206 +102,301 @@ struct MaterialHeader
/// ///
struct SkeletonHeader struct SkeletonHeader
{ {
// do this... unsigned int numBones;
///
SkeletonHeader(char* data)
{
memcpy(&numBones, data, sizeof(unsigned int));
}
}; };
/// ///
struct AnimationHeader struct AnimationHeader
{ {
// do this... unsigned int numAnims;
};
struct Frame
{ AnimationHeader(char* data)
// do this... {
memcpy(&numAnims, data, sizeof(unsigned int));
}
}; };
/// ///
void Oyster::Graphics::Loading::UnloadDAN(void* data) void Oyster::Graphics::Loading::UnloadDAN(void* data)
{ {
Model::ModelInfo* info = (Model::ModelInfo*) data; Model::ModelInfo* info = (Model::ModelInfo*) data;
SAFE_DELETE(info->Vertices); SAFE_DELETE(info->Vertices);
if(info->Indexed) if(info->Indexed)
{ {
SAFE_DELETE(info->Indecies); SAFE_DELETE(info->Indecies);
} }
for(int i =0;i<info->Material.size();++i) for(int i =0;i<info->Material.size();++i)
{ {
Oyster::Resource::OysterResource::ReleaseResource(info->Material[i]); Oyster::Resource::OysterResource::ReleaseResource(info->Material[i]);
} }
delete info; delete info;
} }
static wchar_t* charToWChar(const char* text) static wchar_t* charToWChar(const char* text)
{ {
// Convert to a wchar_t* // Convert to a wchar_t*
size_t origsize = strlen(text) + 1; size_t origsize = strlen(text) + 1;
size_t convertedChars = 0; size_t convertedChars = 0;
wchar_t* wcstring = new wchar_t[origsize]; wchar_t* wcstring = new wchar_t[origsize];
mbstowcs_s(&convertedChars, wcstring, origsize, text, _TRUNCATE); mbstowcs_s(&convertedChars, wcstring, origsize, text, _TRUNCATE);
return wcstring; return wcstring;
} }
/// static void ReadData(void* Destination, std::ifstream& file, int size)
void Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[], Oyster::Resource::CustomData& out) {
{ char* buffer = new char[size];
// file.read(buffer,size);
Oyster::Graphics::Model::ModelInfo* modelInfo = new Oyster::Graphics::Model::ModelInfo(); memcpy(Destination,buffer,size);
modelInfo->Indexed = false; delete[] buffer;
// Open file in binary mode }
///
void Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[], Oyster::Resource::CustomData& out)
{
//
Oyster::Graphics::Model::ModelInfo* modelInfo = new Oyster::Graphics::Model::ModelInfo();
modelInfo->Indexed = false;
modelInfo->Animated = false;
// Open file in binary mode
std::ifstream danFile; std::ifstream danFile;
danFile.open(filename, std::ios::binary); danFile.open(filename, std::ios::binary);
if (!danFile.is_open()) if (!danFile.is_open())
return; return;
// Read file header
char* buffer = new char[sizeof(FileHeader)];
danFile.read(buffer, sizeof(FileHeader));
FileHeader fileHeader(buffer);
delete[] buffer; // ( note: may crash here.)
// If problem with compatability then close file and return from method
if (fileHeader.versionMajor != DANFILEVERSIONMAJOR)
{
danFile.close();
return;
}
// Read the .dan-file
while (!danFile.eof())
{
// read header type
unsigned int headerType;
buffer = new char[4];
danFile.read(buffer, 4);
memcpy(&headerType, buffer, 4);
//delete[] buffer; // ( note: may crash here.)
// handle header type
switch ((HeaderType)headerType)
{
// vertex header
case HeaderType::VERTEXHEADER:
{
// Fetch vertex header, number of vertices
buffer = new char[4];
danFile.read(buffer, 4);
VertexHeader vertexHeader(buffer);
delete[] buffer; // ( note: may crash here.)
// Fetch all vertices
Vertex* vertices = new Vertex[vertexHeader.numVertices];
unsigned int bufferSize = VERTEXSIZE * vertexHeader.numVertices;
buffer = new char[bufferSize];
danFile.read(buffer, bufferSize);
memcpy(vertices, buffer, bufferSize);
delete[] buffer; // ( note: may crash here.)
// Do the deed
Oyster::Graphics::Core::Buffer* vertexBuffer = new Oyster::Graphics::Core::Buffer();
Oyster::Graphics::Core::Buffer::BUFFER_INIT_DESC bufferInitDesc;
bufferInitDesc.ElementSize = sizeof(Vertex);
bufferInitDesc.InitData = vertices;
bufferInitDesc.NumElements = vertexHeader.numVertices;
bufferInitDesc.Type = Oyster::Graphics::Core::Buffer::BUFFER_TYPE::VERTEX_BUFFER;
bufferInitDesc.Usage = Oyster::Graphics::Core::Buffer::BUFFER_USAGE::BUFFER_DEFAULT;
vertexBuffer->Init(bufferInitDesc);
modelInfo->VertexCount = vertexHeader.numVertices;
modelInfo->Vertices = vertexBuffer;
delete[] vertices; // ( note: may crash here.)
break;
}
case HeaderType::INDEXHEADER:
{
// Fetch vertex header, number of vertices
buffer = new char[4];
danFile.read(buffer, 4);
IndexHeader indexHeader(buffer);
delete[] buffer; // ( note: may crash here.)
// Fetch all indices
unsigned int* indices = new unsigned int[indexHeader.numIndices];
unsigned int bufferSize = sizeof(unsigned int) * indexHeader.numIndices;
buffer = new char[bufferSize];
danFile.read(buffer, bufferSize);
memcpy(indices, buffer, bufferSize);
delete[] buffer; // ( note: may crash here.)
// Do the deed
Oyster::Graphics::Core::Buffer* indexBuffer = new Oyster::Graphics::Core::Buffer();
Oyster::Graphics::Core::Buffer::BUFFER_INIT_DESC bufferInitDesc;
bufferInitDesc.ElementSize = sizeof(unsigned int);
bufferInitDesc.InitData = indices;
bufferInitDesc.NumElements = indexHeader.numIndices;
bufferInitDesc.Type = Oyster::Graphics::Core::Buffer::BUFFER_TYPE::INDEX_BUFFER;
bufferInitDesc.Usage = Oyster::Graphics::Core::Buffer::BUFFER_USAGE::BUFFER_DEFAULT;
indexBuffer->Init(bufferInitDesc);
modelInfo->IndexCount = indexHeader.numIndices;
modelInfo->Indecies = indexBuffer;
modelInfo->Indexed = true;
delete[] indices; // ( note: may crash here.)
break;
}
// material header
case HeaderType::MATERIALHEADER:
{
// Fetch material header, 2 texture path strings
MaterialHeader materialHeader;
buffer = new char[4];
danFile.read(buffer, 4);
memcpy(&materialHeader.diffuseMapPathLength, buffer, 4);
delete[] buffer; // ( note: may crash here.)
buffer = new char[materialHeader.diffuseMapPathLength]; // Read file header
danFile.read(buffer, materialHeader.diffuseMapPathLength); char* buffer = new char[sizeof(FileHeader)];
danFile.read(buffer, sizeof(FileHeader));
FileHeader fileHeader(buffer);
delete[] buffer; // ( note: may crash here.)
// If problem with compatability then close file and return from method
if (fileHeader.versionMajor != DANFILEVERSIONMAJOR)
{
danFile.close();
return;
}
// Read the .dan-file
while (!danFile.eof())
{
// read header type
unsigned int headerType;
ReadData(&headerType,danFile,4);
// handle header type
switch ((HeaderType)headerType)
{
// vertex header
case HeaderType::VERTEXHEADER:
{
// Fetch vertex header, number of vertices
buffer = new char[4];
danFile.read(buffer, 4);
VertexHeader vertexHeader(buffer);
delete[] buffer; // ( note: may crash here.)
// Fetch all vertices
unsigned int bufferSize = VERTEXSIZE * vertexHeader.numVertices;
buffer = new char[bufferSize];
danFile.read(buffer, bufferSize);
// Do the deed
Oyster::Graphics::Core::Buffer* vertexBuffer = new Oyster::Graphics::Core::Buffer();
Oyster::Graphics::Core::Buffer::BUFFER_INIT_DESC bufferInitDesc;
bufferInitDesc.ElementSize = sizeof(Vertex);
bufferInitDesc.InitData = buffer;
bufferInitDesc.NumElements = vertexHeader.numVertices;
bufferInitDesc.Type = Oyster::Graphics::Core::Buffer::BUFFER_TYPE::VERTEX_BUFFER;
bufferInitDesc.Usage = Oyster::Graphics::Core::Buffer::BUFFER_USAGE::BUFFER_DEFAULT;
vertexBuffer->Init(bufferInitDesc);
modelInfo->VertexCount = vertexHeader.numVertices;
modelInfo->Vertices = vertexBuffer;
delete[] buffer; // ( note: may crash here.)
break;
}
case HeaderType::INDEXHEADER:
{
// Fetch vertex header, number of vertices
buffer = new char[4];
danFile.read(buffer, 4);
IndexHeader indexHeader(buffer);
delete[] buffer; // ( note: may crash here.)
// Fetch all indices
unsigned int* indices = new unsigned int[indexHeader.numIndices];
unsigned int bufferSize = sizeof(unsigned int) * indexHeader.numIndices;
ReadData(indices,danFile,bufferSize);
// Do the deed
Oyster::Graphics::Core::Buffer* indexBuffer = new Oyster::Graphics::Core::Buffer();
Oyster::Graphics::Core::Buffer::BUFFER_INIT_DESC bufferInitDesc;
bufferInitDesc.ElementSize = sizeof(unsigned int);
bufferInitDesc.InitData = indices;
bufferInitDesc.NumElements = indexHeader.numIndices;
bufferInitDesc.Type = Oyster::Graphics::Core::Buffer::BUFFER_TYPE::INDEX_BUFFER;
bufferInitDesc.Usage = Oyster::Graphics::Core::Buffer::BUFFER_USAGE::BUFFER_DEFAULT;
indexBuffer->Init(bufferInitDesc);
modelInfo->IndexCount = indexHeader.numIndices;
modelInfo->Indecies = indexBuffer;
modelInfo->Indexed = true;
delete[] indices; // ( note: may crash here.)
break;
}
// material header
case HeaderType::MATERIALHEADER:
{
// Fetch material header, 2 texture path strings
MaterialHeader materialHeader;
//read difuse map name length
ReadData(&materialHeader.diffuseMapPathLength,danFile,4);
//read diffuse map name
materialHeader.diffuseMapPath = new char[materialHeader.diffuseMapPathLength+1]; materialHeader.diffuseMapPath = new char[materialHeader.diffuseMapPathLength+1];
memcpy(materialHeader.diffuseMapPath, buffer, materialHeader.diffuseMapPathLength); ReadData(materialHeader.diffuseMapPath,danFile,materialHeader.diffuseMapPathLength);
materialHeader.diffuseMapPath[materialHeader.diffuseMapPathLength] = 0; //null terminate
delete[] buffer; // ( note: may crash here.) materialHeader.diffuseMapPath[materialHeader.diffuseMapPathLength] = 0;
buffer = new char[4]; //read normal map name length
danFile.read(buffer, 4); ReadData(&materialHeader.normalMapPathLength,danFile,4);
memcpy(&materialHeader.normalMapPathLength, buffer, 4);
delete[] buffer; // ( note: may crash here.)
buffer = new char[materialHeader.normalMapPathLength]; //read difuse map name
danFile.read(buffer, materialHeader.normalMapPathLength);
materialHeader.normalMapPath = new char[materialHeader.normalMapPathLength + 1]; materialHeader.normalMapPath = new char[materialHeader.normalMapPathLength + 1];
memcpy(materialHeader.normalMapPath, buffer, materialHeader.normalMapPathLength); ReadData(materialHeader.normalMapPath,danFile,materialHeader.normalMapPathLength);
materialHeader.normalMapPath[materialHeader.normalMapPathLength] = 0; materialHeader.normalMapPath[materialHeader.normalMapPathLength] = 0;
delete[] buffer; // ( note: may crash here.)
//load diffuse map
// wchar_t* path = charToWChar(materialHeader.diffuseMapPath);
ID3D11ShaderResourceView* diffuseMap = (ID3D11ShaderResourceView*)Oyster::Resource::OysterResource::LoadResource(charToWChar(materialHeader.diffuseMapPath), Oyster::Graphics::Loading::LoadTexture); ID3D11ShaderResourceView* diffuseMap = (ID3D11ShaderResourceView*)Oyster::Resource::OysterResource::LoadResource(path, Oyster::Graphics::Loading::LoadTexture);
ID3D11ShaderResourceView* normalMap = (ID3D11ShaderResourceView*)Oyster::Resource::OysterResource::LoadResource(charToWChar(materialHeader.normalMapPath), Oyster::Graphics::Loading::LoadTexture); delete[] path;
modelInfo->Material.push_back(diffuseMap);
modelInfo->Material.push_back(normalMap); //load normal map
path = charToWChar(materialHeader.normalMapPath);
break; ID3D11ShaderResourceView* normalMap = (ID3D11ShaderResourceView*)Oyster::Resource::OysterResource::LoadResource(path, Oyster::Graphics::Loading::LoadTexture);
} delete[] path;
// skeleton header
case HeaderType::SKELETONHEADER: //add to model
{ modelInfo->Material.push_back(diffuseMap);
// not implemented... modelInfo->Material.push_back(normalMap);
break;
} //clean up
// animation header delete[] materialHeader.diffuseMapPath;
case HeaderType::ANIMATIONHEADER: delete[] materialHeader.normalMapPath;
{
// not implemented... break;
break; }
}
} // skeleton header
} case HeaderType::SKELETONHEADER:
{
// close file // Fetch Skeleton header, number of Bones
danFile.close(); buffer = new char[4];
danFile.read(buffer, 4);
// Set modelinfo as output data SkeletonHeader skeletonHeader(buffer);
out.loadedData = modelInfo; delete[] buffer; // ( note: may crash here.)
out.resourceUnloadFnc = Oyster::Graphics::Loading::UnloadDAN;
//array for bone data
Oyster::Graphics::Model::Bone* bones = new Oyster::Graphics::Model::Bone[skeletonHeader.numBones];
//read bones
ReadData(bones,danFile,skeletonHeader.numBones * sizeof(Oyster::Graphics::Model::Bone));
//read skeleton Hiarchy
modelInfo->BoneCount = skeletonHeader.numBones;
modelInfo->bones = bones;
break;
}
// animation header
case HeaderType::ANIMATIONHEADER:
{
//get num anims
buffer = new char[4];
danFile.read(buffer, 4);
AnimationHeader animationHeader(buffer);
delete[] buffer;
Oyster::Graphics::Model::Animation* anims = new Oyster::Graphics::Model::Animation[animationHeader.numAnims];
for(int a = 0; a < animationHeader.numAnims; ++a)
{
//read name of animation
int nameLength;
ReadData(&nameLength,danFile,4);
char* name = new char[nameLength + 1];
ReadData(name,danFile,nameLength);
name[nameLength] = 0;
wchar_t* wName = charToWChar(name);
anims[a].name = std::wstring(wName);
delete[] wName;
//read nr of bones in animation
ReadData(&anims[a].Bones,danFile,4);
//create Frame array and Bone part of KeyFrameArray;
anims[a].Frames = new int[anims[a].Bones];
anims[a].Keyframes = new Oyster::Graphics::Model::Frame*[anims[a].Bones];
//loop per bone and gather data
for(int b = 0; b < anims[a].Bones; ++b)
{
//read bone index
int boneIndex;
ReadData(&boneIndex,danFile,4);
//read nr of frames per bone
ReadData(&anims[a].Frames[b],danFile,4);
//create frame matrix
anims[a].Keyframes[b] = new Oyster::Graphics::Model::Frame[anims[a].Frames[b]];
for(int f = 0; f < anims[a].Frames[b]; ++f)
{
//write index of bone
anims[a].Keyframes[b][f].bone.Parent = boneIndex;
//read bone transform
ReadData(&anims[a].Keyframes[b][f].bone.Transform,danFile,sizeof(Oyster::Math::Matrix));
ReadData(&anims[a].Keyframes[b][f].time,danFile,sizeof(double));
}
}
}
modelInfo->AnimationCount = animationHeader.numAnims;
modelInfo->Animations = anims;
modelInfo->Animated = true;
break;
}
}
}
// close file
danFile.close();
// Set modelinfo as output data
out.loadedData = modelInfo;
out.resourceUnloadFnc = Oyster::Graphics::Loading::UnloadDAN;
} }

View File

@ -9,14 +9,14 @@ namespace Oyster
{ {
namespace Model namespace Model
{ {
//struct ModelInfo; struct ModelInfo;
struct Model struct Model
{ {
//! do not Edit, linked to render data ModelInfo* info;
//ModelInfo* info;
void* info;
Oyster::Math::Float4x4 WorldMatrix; Oyster::Math::Float4x4 WorldMatrix;
bool Visible; bool Visible, LoopAnimation;
int AnimationPlaying;
float AnimationTime;
}; };
} }

View File

@ -11,12 +11,31 @@ namespace Oyster
{ {
namespace Model namespace Model
{ {
struct Bone
{
Math::Float4x4 Transform;
int Parent;
};
struct Frame
{
Bone bone;
double time;
};
struct Animation
{
std::wstring name;
int Bones;
int* Frames; //! Bone as index
Frame** Keyframes; //! @brief [Bone][Frame]
};
struct ModelInfo struct ModelInfo
{ {
std::vector<ID3D11ShaderResourceView*> Material; std::vector<ID3D11ShaderResourceView*> Material;
Core::Buffer *Vertices,*Indecies; Core::Buffer *Vertices,*Indecies;
bool Indexed; bool Indexed, Animated;
int VertexCount, IndexCount; int VertexCount, IndexCount, BoneCount, AnimationCount;
Bone* bones;
Animation* Animations;
}; };
} }
} }

View File

@ -18,16 +18,10 @@ namespace Oyster
void Basic::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights) void Basic::NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection, Definitions::Pointlight* Lights, int numLights)
{ {
Preparations::Basic::ClearBackBuffer(Oyster::Math::Float4(1,0,0,1)); Preparations::Basic::ClearBackBuffer(Oyster::Math::Float4(1,0,0,1));
Preparations::Basic::ClearRTV(Resources::Deffered::GBufferRTV,Resources::Deffered::GBufferSize,Math::Float4(1,0,0,1)); Preparations::Basic::ClearRTV(Resources::Deffered::GBufferRTV,Resources::Deffered::GBufferSize,Math::Float4(0,0,0,1));
Core::PipelineManager::SetRenderPass(Graphics::Render::Resources::Deffered::GeometryPass); Core::PipelineManager::SetRenderPass(Graphics::Render::Resources::Deffered::GeometryPass);
Definitions::VP vp; void* data;
vp.V = View;
vp.P = Projection;
void* data = Resources::Deffered::VPData.Map();
memcpy(data, &vp, sizeof(Definitions::VP));
Resources::Deffered::VPData.Unmap();
Definitions::LightConstants lc; Definitions::LightConstants lc;
lc.InvProj = Projection.GetInverse(); lc.InvProj = Projection.GetInverse();
@ -61,10 +55,73 @@ namespace Oyster
void* data = Resources::Deffered::ModelData.Map(); void* data = Resources::Deffered::ModelData.Map();
memcpy(data,&(pm),sizeof(pm)); memcpy(data,&(pm),sizeof(pm));
Resources::Deffered::ModelData.Unmap(); Resources::Deffered::ModelData.Unmap();
Model::ModelInfo* info = (Model::ModelInfo*)models[i].info; Model::ModelInfo* info = (Model::ModelInfo*)models[i].info;
Definitions::AnimationData am;
if(info->Animated && models[i].AnimationPlaying != -1)
{
Definitions::AnimationData am2;
//write default data
for (int b = 0; b < info->BoneCount; b++)
{
am2.animatedData[b] = info->bones[b].Transform;
}
//loop bones in animation
am.Animated = 1;
for(int x = 0; x < info->Animations[models[i].AnimationPlaying].Bones; ++x)
{
Model::Frame Prev, Next;
//loop frame per bone
for(int y = 0; y < info->Animations[models[i].AnimationPlaying].Frames[x]; ++y)
{
///TODO replace with binary search?
Model::Frame f = info->Animations[models[i].AnimationPlaying].Keyframes[x][y];
//if we hit frame
if(models[i].AnimationTime == f.time)
{
Prev = f;
Next = f;
break;
}
//if time is larger than frame time, store frames
if(models[i].AnimationTime < f.time)
{
Next = f;
Prev = info->Animations[models[i].AnimationPlaying].Keyframes[x][y-1];
break;
}
}
//calculate interpolated bone position
//rebase model time to between prev and next
float interpoation =(models[i].AnimationTime - Prev.time) / (Next.time - Prev.time);
//interpolate
Math::Matrix Interpolated = Prev.bone.Transform;
//write magic to animated data
am2.animatedData[Prev.bone.Parent] = Interpolated * am2.animatedData[info->bones[Prev.bone.Parent].Parent];
//sneaky write do correct data buffer
am.animatedData[x] = am2.animatedData[Prev.bone.Parent].GetInverse() * info->bones[Prev.bone.Parent].Transform;
}
}
else
am.Animated = 0;
data = Resources::Deffered::AnimationData.Map();
memcpy(data,&am,sizeof(Definitions::AnimationData));
Resources::Deffered::AnimationData.Unmap();
if(info->Material.size()) if(info->Material.size())
{ {
Core::deviceContext->PSSetShaderResources(0,(UINT)info->Material.size(),&(info->Material[0])); Core::deviceContext->PSSetShaderResources(0,(UINT)info->Material.size(),&(info->Material[0]));
@ -84,6 +141,8 @@ namespace Oyster
} }
} }
} }
void Basic::EndFrame() void Basic::EndFrame()
{ {
Core::PipelineManager::SetRenderPass(Resources::Deffered::LightPass); Core::PipelineManager::SetRenderPass(Resources::Deffered::LightPass);

View File

@ -12,7 +12,7 @@ const std::wstring PathToHLSL = L"..\\..\\Code\\OysterGraphics\\Shader\\HLSL\\De
const std::wstring PathToCSO = L"..\\Content\\Shaders\\"; const std::wstring PathToCSO = L"..\\Content\\Shaders\\";
const int KernelSize = 10; const int KernelSize = 10;
const int SampleSpread = 8; const int SampleSpread = 16;
namespace Oyster namespace Oyster
{ {
@ -34,7 +34,7 @@ namespace Oyster
Shader::RenderPass Deffered::PostPass; Shader::RenderPass Deffered::PostPass;
Buffer Deffered::ModelData = Buffer(); Buffer Deffered::ModelData = Buffer();
Buffer Deffered::VPData = Buffer(); Buffer Deffered::AnimationData = Buffer();
Buffer Deffered::LightConstantsData = Buffer(); Buffer Deffered::LightConstantsData = Buffer();
Buffer Deffered::PointLightsData = Buffer(); Buffer Deffered::PointLightsData = Buffer();
@ -74,8 +74,9 @@ namespace Oyster
ModelData.Init(desc); ModelData.Init(desc);
desc.NumElements = 2; desc.NumElements = 1;
VPData.Init(desc); desc.ElementSize = sizeof(Definitions::AnimationData);
AnimationData.Init(desc);
desc.ElementSize = sizeof(Definitions::LightConstants); desc.ElementSize = sizeof(Definitions::LightConstants);
desc.NumElements = 1; desc.NumElements = 1;
@ -156,6 +157,7 @@ namespace Oyster
Core::Init::CreateLinkedShaderResourceFromStructuredBuffer(&b,&PointLightView,NULL); Core::Init::CreateLinkedShaderResourceFromStructuredBuffer(&b,&PointLightView,NULL);
srand((unsigned int)time(0)); srand((unsigned int)time(0));
//SSAO //SSAO
Math::Vector3 kernel[KernelSize]; Math::Vector3 kernel[KernelSize];
Math::Vector3 random[SampleSpread]; Math::Vector3 random[SampleSpread];
@ -186,13 +188,12 @@ namespace Oyster
{ {
random[i] = Oyster::Math::Vector3( random[i] = Oyster::Math::Vector3(
(float)rand() / (RAND_MAX + 1) * (1 - -1)+ -1, (float)rand() / (RAND_MAX + 1) * (1 - -1)+ -1,
(float)rand() / (RAND_MAX + 1) * (1 - -1)+ -1, /*(float)rand() / (RAND_MAX + 1) * (1 - -1)+ -1,*/
1.0f,
0.0f); 0.0f);
} }
random[i].Normalize(); random[i].Normalize();
} }
//kernel[0] = Math::Vector3(0,1,1);
//kernel[0].Normalize();
D3D11_TEXTURE1D_DESC T1desc; D3D11_TEXTURE1D_DESC T1desc;
T1desc.Width = KernelSize; T1desc.Width = KernelSize;
@ -208,17 +209,32 @@ namespace Oyster
D3D11_SUBRESOURCE_DATA rnd; D3D11_SUBRESOURCE_DATA rnd;
rnd.pSysMem = random; rnd.pSysMem = random;
rnd.SysMemPitch = sqrt(SampleSpread) * sizeof(Oyster::Math::Vector3);
ID3D11Texture1D *pTexture1[2]; ID3D11Texture1D *pTexture1;
Core::device->CreateTexture1D( &T1desc, &sphere, &pTexture1[0] ); Core::device->CreateTexture1D( &T1desc, &sphere, &pTexture1 );
Core::device->CreateShaderResourceView( pTexture1[0], 0, &SSAOKernel ); Core::device->CreateShaderResourceView( pTexture1, 0, &SSAOKernel );
pTexture1[0]->Release(); pTexture1->Release();
T1desc.Width = SampleSpread; D3D11_TEXTURE2D_DESC T2desc;
Core::device->CreateTexture1D( &T1desc, &rnd, &pTexture1[1] ); T2desc.Width = KernelSize;
Core::device->CreateShaderResourceView( (pTexture1[1]), 0, &SSAORandom ); T2desc.MipLevels = T2desc.ArraySize = 1;
pTexture1[1]->Release(); T2desc.Format = DXGI_FORMAT_R32G32B32_FLOAT;
T2desc.Usage = D3D11_USAGE_DEFAULT;
T2desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
T2desc.CPUAccessFlags = 0;
T2desc.MiscFlags = 0;
T2desc.Height = sqrt(SampleSpread);
T2desc.Width = SampleSpread/sqrt(SampleSpread);
T2desc.SampleDesc.Quality = 0;
T2desc.SampleDesc.Count = 1;
ID3D11Texture2D *pTexture2;
Core::device->CreateTexture2D( &T2desc, &rnd, &pTexture2 );
Core::device->CreateShaderResourceView( (pTexture2), 0, &SSAORandom );
pTexture2->Release();
////Create ShaderEffects ////Create ShaderEffects
@ -239,7 +255,7 @@ namespace Oyster
Shader::CreateInputLayout(indesc,7,GetShader::Vertex(L"Geometry"),GeometryPass.IAStage.Layout); Shader::CreateInputLayout(indesc,7,GetShader::Vertex(L"Geometry"),GeometryPass.IAStage.Layout);
GeometryPass.IAStage.Topology = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; GeometryPass.IAStage.Topology = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
GeometryPass.CBuffers.Vertex.push_back(VPData); GeometryPass.CBuffers.Vertex.push_back(AnimationData);
GeometryPass.CBuffers.Vertex.push_back(ModelData); GeometryPass.CBuffers.Vertex.push_back(ModelData);
GeometryPass.RenderStates.Rasterizer = rs; GeometryPass.RenderStates.Rasterizer = rs;
GeometryPass.RenderStates.SampleCount = 1; GeometryPass.RenderStates.SampleCount = 1;
@ -281,7 +297,7 @@ namespace Oyster
void Deffered::Clean() void Deffered::Clean()
{ {
Resources::Deffered::ModelData.~Buffer(); Resources::Deffered::ModelData.~Buffer();
Resources::Deffered::VPData.~Buffer(); Resources::Deffered::AnimationData.~Buffer();
Resources::Deffered::LightConstantsData.~Buffer(); Resources::Deffered::LightConstantsData.~Buffer();
Resources::Deffered::PointLightsData.~Buffer(); Resources::Deffered::PointLightsData.~Buffer();
SAFE_RELEASE(Resources::Deffered::PointLightView); SAFE_RELEASE(Resources::Deffered::PointLightView);

View File

@ -18,12 +18,15 @@ namespace Oyster
static const int LBufferSize = 3; static const int LBufferSize = 3;
static const int MaxLightSize = 100; static const int MaxLightSize = 100;
//! GBuffers //! GBuffers
//! 0 = Diffuse + SpecKoeff //! 0 = Diffuse + Glow
//! 1 = Normal + Glow //! 1 = Normal + Spec
static ID3D11RenderTargetView* GBufferRTV[GBufferSize]; static ID3D11RenderTargetView* GBufferRTV[GBufferSize];
static ID3D11ShaderResourceView* GBufferSRV[GBufferSize]; static ID3D11ShaderResourceView* GBufferSRV[GBufferSize];
//! LBuffer
//! 0 = Diffuse
//! 1 = Specular
//! 2 = SSAO
static ID3D11UnorderedAccessView* LBufferUAV[LBufferSize]; static ID3D11UnorderedAccessView* LBufferUAV[LBufferSize];
static ID3D11ShaderResourceView* LBufferSRV[LBufferSize]; static ID3D11ShaderResourceView* LBufferSRV[LBufferSize];
@ -33,7 +36,7 @@ namespace Oyster
static Core::Buffer ModelData; static Core::Buffer ModelData;
static Core::Buffer VPData; static Core::Buffer AnimationData;
static Core::Buffer LightConstantsData; static Core::Buffer LightConstantsData;

View File

@ -32,10 +32,10 @@ Texture2D DepthTexture : register(t2);
StructuredBuffer<PointLight> Points : register(t3); StructuredBuffer<PointLight> Points : register(t3);
Texture1D SSAOKernel : register(t4); Texture1D SSAOKernel : register(t4);
Texture1D SSAORand : register(t5); Texture2D SSAORand : register(t5);
RWTexture2D<float4> Diffuse : register(u0); RWTexture2D<float4> Diffuse : register(u0);
RWTexture2D<float4> Specular : register(u1); RWTexture2D<float4> Specular : register(u1);
RWTexture2D<float> Ambient : register(u2); RWTexture2D<float4> Ambient : register(u2);
#endif #endif

View File

@ -30,11 +30,11 @@ Texture2D Normal : register(t1);
SamplerState S1 : register(s0); SamplerState S1 : register(s0);
cbuffer PerFrame : register(b0) cbuffer Animation : register(b0)
{ {
matrix View; int Animated;
float4x4 Projection; float3 Pad;
matrix VP; float4x4 BoneAnimation[10];
} }
cbuffer PerModel : register(b1) cbuffer PerModel : register(b1)

View File

@ -31,10 +31,10 @@ void main( uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID )
Specular[DTid.xy] = float4(Shaded.Specular, 1); Specular[DTid.xy] = float4(Shaded.Specular, 1);
if((DTid.x + DTid.y) %4 == 0 ) if(DTid.x & 1 && DTid.y & 1 )
{ {
float AmbValue = GetSSAO(ViewPos, UV, DTid.xy, GTid.xy); float AmbValue = GetSSAO(ViewPos, UV, DTid.xy, GTid.xy/2);
Ambient[DTid.xy/4] = AmbValue; Ambient[DTid.xy/2] = AmbValue;
} }
} }

View File

@ -7,6 +7,7 @@ RWTexture2D<float4> Output;
[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/4].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW //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
//Output[DTid.xy] = Diffuse[DTid.xy]; Output[DTid.xy] = Ambient[DTid.xy/2];
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy];
} }

View File

@ -1,27 +1,30 @@
#include "Defines.hlsli" #include "Defines.hlsli"
#include "PosManipulation.hlsli" #include "PosManipulation.hlsli"
static float Radius =5; static float Radius = 100;
float GetSSAO(float3 pos, float2 uv, int2 texCoord2, uint2 rndID) float GetSSAO(float3 pos, float2 uv, int2 texCoord2, uint2 rndID)
{ {
float occlusion = 0.0f; float occlusion = 0.0f;
//create sample coordinate system //create sample coordinate system
float4 rnd = float4( SSAORand[(rndID.x + rndID.y) % SSAORand.Length.x].xyz, 0.0f ); float4 rnd = float4( SSAORand[int2(rndID.x % (SSAORand.Length.x), rndID.y % (SSAORand.Length.y))].xyz, 0.0f );
rnd = normalize(rnd); rnd = normalize(rnd);
float3 normal = NormalSpec[uv].xyz; float3 normal = NormalSpec[texCoord2].xyz;
float4 tangent = float4( normalize(rnd.xyz - (normal * dot(rnd.xyz, normal))), 0.0f ); float3 tangent = float3( normalize(rnd.xyz - (normal * dot(rnd.xyz, normal))));
float4 biTangent = float4( cross(tangent.xyz, normal), 0.0f ); float3 biTangent = float3( cross(tangent.xyz, normal));
float4x4 tbn = float4x4(tangent, biTangent, float4(normal,0), float4(pos*Radius,1)); float3x3 tbn = float3x3(tangent, biTangent, normal);
for( uint i = 0; i < SSAOKernel.Length.x; ++i ) for( uint i = 0; i < SSAOKernel.Length.x; ++i )
{ {
//int i = 0;
//take sample from localspace to viewspace //take sample from localspace to viewspace
float4 sampled = mul(tbn, float4(SSAOKernel[i].xyz,1));
float3 sampled = mul(tbn, SSAOKernel[i].xyz);
sampled = sampled * Radius + pos;
//project sample to get uv.xy //project sample to get uv.xy
float4 ProjOffset = sampled; float4 ProjOffset = float4(sampled,1);
ProjOffset = mul(Proj, ProjOffset); ProjOffset = mul(Proj, ProjOffset);
float4 offset = ProjOffset; float4 offset = ProjOffset;
float2 UV = offset; float2 UV = offset;
@ -39,7 +42,7 @@ float GetSSAO(float3 pos, float2 uv, int2 texCoord2, uint2 rndID)
//compare to depth from sample //compare to depth from sample
float rangeCheck = (abs(pos.z - sampleDepth) < Radius) ? 1.0f : 0.0f; float rangeCheck = (abs(pos.z - sampleDepth) < Radius) ? 1.0f : 0.0f;
occlusion += (sampleDepth >= sampled.z ? 1.0f : 0.0f) * rangeCheck; occlusion += (sampleDepth <= sampled.z ? 1.0f : 0.0f) * rangeCheck;
} }
occlusion /= (float)(SSAOKernel.Length.x); occlusion /= (float)(SSAOKernel.Length.x);
occlusion = 1.0f - occlusion; occlusion = 1.0f - occlusion;

View File

@ -3,6 +3,10 @@
VertexOut main( VertexIn input ) VertexOut main( VertexIn input )
{ {
VertexOut output; VertexOut output;
input.pos = mul(BoneAnimation[input.boneIndex.x], input.pos) * Animated + input.pos * int(1-Animated);
//float4x4 m = matrix(float4(1,0,0,0),float4(0,1,0,0), float4(0,0,1,0), float4(0,0,0,1));
//input.pos = mul(BoneAnimation[0], float4(input.pos,1));
//input.pos = mul(m, float4(input.pos,1));
output.pos = mul(WVP, float4(input.pos,1)); output.pos = mul(WVP, float4(input.pos,1));
output.normal = mul(WV, float4(input.normal,0)).xyz; output.normal = mul(WV, float4(input.normal,0)).xyz;
output.UV = input.UV; output.UV = input.UV;

View File

@ -121,7 +121,7 @@ HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow )
// Adjust and create window // Adjust and create window
g_hInst = hInstance; g_hInst = hInstance;
RECT rc = { 0, 0, 1024, 768 }; RECT rc = { 0, 0, 1280, 720 };
AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE ); AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );
if(!(g_hWnd = CreateWindow( if(!(g_hWnd = CreateWindow(
@ -159,25 +159,27 @@ HRESULT InitDirect3D()
return E_FAIL; return E_FAIL;
} }
m = Oyster::Graphics::API::CreateModel(L"cube_tri.dan"); m = Oyster::Graphics::API::CreateModel(L"untitled.dan");
m2 = Oyster::Graphics::API::CreateModel(L"cube_tri.dan"); m2 = Oyster::Graphics::API::CreateModel(L"knee_noAnimation.dan");
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,5,0),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,5,0),Oyster::Math::Float3::null);
m3 = Oyster::Graphics::API::CreateModel(L"cube_tri.dan"); m2->AnimationPlaying = 0;
m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,5,0),Oyster::Math::Float3::null); m2->AnimationTime = 0.0f;
//m3 = Oyster::Graphics::API::CreateModel(L"box_2.dan");
//m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(0,5,0),Oyster::Math::Float3::null);
P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,100); P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1280.0f/720.0f,.1f,10000);
Oyster::Graphics::API::SetProjection(P); Oyster::Graphics::API::SetProjection(P);
V = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,0,15.4f)); V = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,200,500.4f));
V = V.GetInverse(); V = V.GetInverse();
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,5,5.4f); pl.Pos = Oyster::Math::Float3(0,-20.0f,30.4f);
pl.Radius = 15; pl.Radius = 90;
Oyster::Graphics::API::AddLight(pl); Oyster::Graphics::API::AddLight(pl);
@ -188,10 +190,15 @@ float angle = 0;
HRESULT Update(float deltaTime) HRESULT Update(float deltaTime)
{ {
angle += Oyster::Math::pi/8 * deltaTime; angle += Oyster::Math::pi/16 * deltaTime;
m->WorldMatrix = Oyster::Math3D::RotationMatrix_AxisY(angle); //m->WorldMatrix = Oyster::Math3D::RotationMatrix_AxisY(angle) * Oyster::Math3D::RotationMatrix_AxisX(-Oyster::Math::pi/2);
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(1,0,0)*-angle,Oyster::Math::Float3(0,-4,0),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0)*-Oyster::Math::pi/4,Oyster::Math::Float3(0,-4,0),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); Oyster::Math::Matrix ma = Oyster::Math::Matrix::identity;
ma *= 50;
ma.m44 = 1;
m2->WorldMatrix = m2->WorldMatrix * ma;
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);
return S_OK; return S_OK;
} }
@ -200,9 +207,9 @@ HRESULT Render(float deltaTime)
Oyster::Graphics::API::SetView(V); Oyster::Graphics::API::SetView(V);
Oyster::Graphics::API::NewFrame(); Oyster::Graphics::API::NewFrame();
Oyster::Graphics::API::RenderModel(*m); //Oyster::Graphics::API::RenderModel(*m);
Oyster::Graphics::API::RenderModel(*m2); Oyster::Graphics::API::RenderModel(*m2);
Oyster::Graphics::API::RenderModel(*m3); //Oyster::Graphics::API::RenderModel(*m3);
Oyster::Graphics::API::EndFrame(); Oyster::Graphics::API::EndFrame();

View File

@ -60,6 +60,29 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<DelayLoadDLLs>OysterGraphics_$(PlatformShortName)D.dll;</DelayLoadDLLs> <DelayLoadDLLs>OysterGraphics_$(PlatformShortName)D.dll;</DelayLoadDLLs>
</Link> </Link>
<ProjectReference>
<LinkLibraryDependencies>
</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\OysterGraphics;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>OysterGraphics_$(PlatformShortName)D.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<PreventDllBinding>true</PreventDllBinding>
<DelayLoadDLLs>OysterGraphics_$(PlatformShortName)D.dll;</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
@ -67,16 +90,45 @@
<PrecompiledHeader> <PrecompiledHeader>
</PrecompiledHeader> </PrecompiledHeader>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>false</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\OysterGraphics;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>OysterGraphics_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<PreventDllBinding>true</PreventDllBinding>
<DelayLoadDLLs>OysterGraphics_$(PlatformShortName).dll;</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\OysterGraphics;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>OysterGraphics_$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<PreventDllBinding>true</PreventDllBinding>
<DelayLoadDLLs>OysterGraphics_$(PlatformShortName).dll;</DelayLoadDLLs>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
@ -88,6 +140,11 @@
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\OysterGraphics\OysterGraphics.vcxproj"> <ProjectReference Include="..\OysterGraphics\OysterGraphics.vcxproj">
<Project>{0ec83e64-230e-48ef-b08c-6ac9651b4f82}</Project> <Project>{0ec83e64-230e-48ef-b08c-6ac9651b4f82}</Project>
<Private>false</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\OysterMath\OysterMath.vcxproj"> <ProjectReference Include="..\OysterMath\OysterMath.vcxproj">
<Project>{f10cbc03-9809-4cba-95d8-327c287b18ee}</Project> <Project>{f10cbc03-9809-4cba-95d8-327c287b18ee}</Project>