From adcac0ec129880ccd42f7cf28a0d07f4e69c84ff Mon Sep 17 00:00:00 2001 From: lanariel Date: Fri, 14 Feb 2014 14:27:38 +0100 Subject: [PATCH 1/3] Random Updates --- Code/OysterGraphics/Core/PipelineManager.cpp | 1 + Code/OysterGraphics/DllInterfaces/GFXAPI.cpp | 4 ++++ Code/OysterGraphics/FileLoader/DanLoader.cpp | 7 ++++-- .../OysterGraphics/FileLoader/ModelLoader.cpp | 1 + .../Shader/Passes/2D/2DGeometry.hlsl | 8 +++---- .../Shader/Passes/2D/Text/2DTextGeometry.hlsl | 8 +++---- .../Shader/Passes/Light/LightPass.hlsl | 3 ++- .../Shader/Passes/Post/PostPass.hlsl | 5 ++-- Code/Tester/MainTest.cpp | 24 +++++++++---------- 9 files changed, 36 insertions(+), 25 deletions(-) diff --git a/Code/OysterGraphics/Core/PipelineManager.cpp b/Code/OysterGraphics/Core/PipelineManager.cpp index d60c1641..9004ec3d 100644 --- a/Code/OysterGraphics/Core/PipelineManager.cpp +++ b/Code/OysterGraphics/Core/PipelineManager.cpp @@ -362,6 +362,7 @@ namespace Oyster } Core::deviceContext->RSSetState(se.RenderStates.Rasterizer); Core::deviceContext->PSSetSamplers(0,se.RenderStates.SampleCount,se.RenderStates.SampleState); + Core::deviceContext->CSSetSamplers(0,se.RenderStates.SampleCount,se.RenderStates.SampleState); Core::deviceContext->OMSetDepthStencilState(se.RenderStates.DepthStencil,0); float test[4] = {0}; Core::deviceContext->OMSetBlendState(se.RenderStates.BlendState,test,-1); diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp index 381b12cf..537ed63d 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp @@ -94,6 +94,8 @@ namespace Oyster if(!mi || mi->Vertices->GetBufferPointer() == NULL) { delete m; + Core::loader.ReleaseResource(mi); + delete mi; return NULL; } @@ -176,6 +178,8 @@ namespace Oyster float API::PlayAnimation(Model::Model* m, std::wstring name,bool looping) { + if(m==NULL) + return 0; m->Animation.AnimationPlaying = &(*m->info->Animations.find(name)).second; m->Animation.AnimationTime=0; m->Animation.LoopAnimation = looping; diff --git a/Code/OysterGraphics/FileLoader/DanLoader.cpp b/Code/OysterGraphics/FileLoader/DanLoader.cpp index 69af2158..b6d8ed28 100644 --- a/Code/OysterGraphics/FileLoader/DanLoader.cpp +++ b/Code/OysterGraphics/FileLoader/DanLoader.cpp @@ -175,7 +175,6 @@ static void ReadData(void* Destination, std::ifstream& file, int size) /// void* Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[]) { - // Oyster::Graphics::Model::ModelInfo* modelInfo = new Oyster::Graphics::Model::ModelInfo(); modelInfo->Indexed = false; modelInfo->Animated = false; @@ -184,7 +183,10 @@ void* Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[]) std::ifstream danFile; danFile.open(filename, std::ios::binary); if (!danFile.is_open()) + { + delete modelInfo; return NULL; + } // Read file header char* buffer = new char[sizeof(FileHeader)]; @@ -195,6 +197,7 @@ void* Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[]) // If problem with compatability then close file and return from method if (fileHeader.versionMajor != DANFILEVERSIONMAJOR) { + delete modelInfo; danFile.close(); return NULL; } @@ -290,7 +293,7 @@ void* Oyster::Graphics::Loading::LoadDAN(const wchar_t filename[]) //read normal map name length ReadData(&materialHeader.normalMapPathLength,danFile,4); - //read difuse map name + //read normal map name materialHeader.normalMapPath = new char[materialHeader.normalMapPathLength + 1]; ReadData(materialHeader.normalMapPath,danFile,materialHeader.normalMapPathLength); materialHeader.normalMapPath[materialHeader.normalMapPathLength] = 0; diff --git a/Code/OysterGraphics/FileLoader/ModelLoader.cpp b/Code/OysterGraphics/FileLoader/ModelLoader.cpp index 96fa0362..ba0928cc 100644 --- a/Code/OysterGraphics/FileLoader/ModelLoader.cpp +++ b/Code/OysterGraphics/FileLoader/ModelLoader.cpp @@ -645,6 +645,7 @@ static HRESULT CreateTextureFromWIC( _In_ ID3D11Device* d3dDevice, if ( SUCCEEDED(hr) && ( fmtSupport & D3D11_FORMAT_SUPPORT_MIP_AUTOGEN ) ) { autogen = true; + autogen = false; } } diff --git a/Code/OysterGraphics/Shader/Passes/2D/2DGeometry.hlsl b/Code/OysterGraphics/Shader/Passes/2D/2DGeometry.hlsl index 56b6294f..86fea579 100644 --- a/Code/OysterGraphics/Shader/Passes/2D/2DGeometry.hlsl +++ b/Code/OysterGraphics/Shader/Passes/2D/2DGeometry.hlsl @@ -4,19 +4,19 @@ void main(point Vertex2DIn input[1],inout TriangleStream Quads) { Pixel2DIn output; - output.Pos = mul(float4(-1,-1,0,1) ,Translation); + output.Pos = mul(float4(-1,-1,1,1) ,Translation); output.Uv = float2(0,1); Quads.Append(output); - output.Pos = mul(float4(-1,1,0,1), Translation); + output.Pos = mul(float4(-1,1,1,1), Translation); output.Uv = float2(0,0); Quads.Append(output); - output.Pos = mul(float4(1,-1,0,1), Translation); + output.Pos = mul(float4(1,-1,1,1), Translation); output.Uv = float2(1,1); Quads.Append(output); - output.Pos = mul(float4(1,1,0,1), Translation); + output.Pos = mul(float4(1,1,1,1), Translation); output.Uv = float2(1,0); Quads.Append(output); } \ No newline at end of file diff --git a/Code/OysterGraphics/Shader/Passes/2D/Text/2DTextGeometry.hlsl b/Code/OysterGraphics/Shader/Passes/2D/Text/2DTextGeometry.hlsl index feefbed7..4e0bed02 100644 --- a/Code/OysterGraphics/Shader/Passes/2D/Text/2DTextGeometry.hlsl +++ b/Code/OysterGraphics/Shader/Passes/2D/Text/2DTextGeometry.hlsl @@ -7,22 +7,22 @@ void main(point Text2DIn input[1],inout TriangleStream Quads) float endoff=startoff+input[0].coff; Pixel2DIn output; - output.Pos = mul(float4(-1,-1,0,1), Translation); + output.Pos = mul(float4(-1,-1,1,1), Translation); output.Pos.x += input[0].Pos; output.Uv = float2(startoff,1); Quads.Append(output); - output.Pos = mul(float4(-1,1,0,1), Translation); + output.Pos = mul(float4(-1,1,1,1), Translation); output.Pos.x += input[0].Pos; output.Uv = float2(startoff,0); Quads.Append(output); - output.Pos = mul(float4(1,-1,0,1), Translation); + output.Pos = mul(float4(1,-1,1,1), Translation); output.Pos.x += input[0].Pos; output.Uv = float2(endoff,1); Quads.Append(output); - output.Pos = mul(float4(1,1,0,1), Translation); + output.Pos = mul(float4(1,1,1,1), Translation); output.Pos.x += input[0].Pos; output.Uv = float2(endoff,0); Quads.Append(output); diff --git a/Code/OysterGraphics/Shader/Passes/Light/LightPass.hlsl b/Code/OysterGraphics/Shader/Passes/Light/LightPass.hlsl index 8e303455..3504a6a8 100644 --- a/Code/OysterGraphics/Shader/Passes/Light/LightPass.hlsl +++ b/Code/OysterGraphics/Shader/Passes/Light/LightPass.hlsl @@ -36,7 +36,8 @@ void main( uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID ) float AmbValue = GetSSAO(ViewPos, UV, DTid.xy, GTid.xy/2); Ambient[DTid.xy/2] = float4(DiffuseGlow[DTid.xy].xyz, AmbValue); Ambient[DTid.xy/2 + float2(Pixels.x/2, 0)] = GUI[DTid.xy]; - Ambient[DTid.xy/2 + float2(0, Pixels.y/2)] = float4(DiffuseGlow[DTid.xy].xyz * DiffuseGlow[DTid.xy].w*10,1); + Ambient[DTid.xy/2 + float2(0, Pixels.y/2)] = float4(DiffuseGlow[DTid.xy].xyz * DiffuseGlow[DTid.xy].w,1); + Ambient[DTid.xy/2 + Pixels/2] = float4(NormalSpec[DTid.xy].xyz,1); } } \ No newline at end of file diff --git a/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl b/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl index 85c74fb7..ba835e18 100644 --- a/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl +++ b/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl @@ -20,6 +20,7 @@ float4 SuperSample(float4 Glow, uint3 DTid) index += float2(0,Output.Length.y/2); index = index / Output.Length; Glow = Ambient.SampleLevel(S1, index,1); + Glow = Glow * Glow.w*10; //Line Y+1 //Glow += Ambient[DTid.xy/2 + uint2(1,(Output.Length.y/2)+1)] + Ambient[DTid.xy/2 + uint2(0,(Output.Length.y/2)+1)] + Ambient[DTid.xy/2 + uint2(-1,(Output.Length.y/2)+1)]; //Line Y-1 @@ -34,7 +35,7 @@ float4 SuperSample(float4 Glow, uint3 DTid) void main( uint3 DTid : SV_DispatchThreadID ) { float4 Light = Diffuse[DTid.xy] + saturate(Specular[DTid.xy]); - float4 Amb = float4(Ambient[DTid.xy/2].xyz * Ambient[DTid.xy/2].w, 0); + float4 Amb = float4(Ambient[DTid.xy/2].xyz /* * Ambient[DTid.xy/2].w*/, 0); //float4 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)]; float4 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)]; @@ -48,5 +49,5 @@ void main( uint3 DTid : SV_DispatchThreadID ) PostLight = PostLight * (1 - GUI.w); Output[DTid.xy] = float4((GUI.xyz * GUI.w) + PostLight, 1); - //Output[DTid.xy] = Glow; + //Output[DTid.xy] = Ambient[DTid.xy]; } \ No newline at end of file diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index c6956971..d30529a8 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -170,19 +170,19 @@ HRESULT InitDirect3D() return E_FAIL; } - m = Oyster::Graphics::API::CreateModel(L"building_corporation.dan"); - m->WorldMatrix.m[0][0] = 0.0002f; - m->WorldMatrix.m[1][1] = 0.0002f; - m->WorldMatrix.m[2][2] = 0.0002f; - m2 = Oyster::Graphics::API::CreateModel(L"char_temporary.dan"); + m = Oyster::Graphics::API::CreateModel(L"crate_colonists.dan"); + //m->WorldMatrix.m[0][0] = 0.0002f; + //m->WorldMatrix.m[1][1] = 0.0002f; + //m->WorldMatrix.m[2][2] = 0.0002f; + m2 = Oyster::Graphics::API::CreateModel(L"char_orca.dan"); m2->Tint = Oyster::Math::Float3(0.1f,0.1f,1); - m3 = Oyster::Graphics::API::CreateModel(L"char_temporary.dan"); - m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); + m3 = Oyster::Graphics::API::CreateModel(L"char_orca.dan"); + //m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); Oyster::Graphics::API::PlayAnimation(m2, L"movement", true); Oyster::Graphics::API::PlayAnimation(m3, L"movement", true); t = Oyster::Graphics::API::CreateTexture(L"structure_corp_mdg.png"); - t2 = Oyster::Graphics::API::CreateTexture(L"whiteGui.png"); + t2 = Oyster::Graphics::API::CreateTexture(L"color_white.png"); P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1280.0f/720.0f,.1f,10000); Oyster::Graphics::API::SetProjection(P); @@ -220,14 +220,14 @@ float angle = 0; HRESULT Update(float deltaTime) { //angle += Oyster::Math::pi/16 * deltaTime; - m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(1,0,0) * angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null); + m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * -angle,Oyster::Math::Float3(-4,0,0),Oyster::Math::Float3::null); Oyster::Math::Matrix ma = Oyster::Math::Matrix::identity; ma.m[0][0] = 0.2f; ma.m[1][1] = 0.2f; ma.m[2][2] = 0.2f; - m->WorldMatrix = m->WorldMatrix * ma; + //m->WorldMatrix = m->WorldMatrix * ma; Oyster::Graphics::API::Update(deltaTime); //m2->Animation.data.AnimationTime += deltaTime;// * 0.5f; return S_OK; @@ -242,7 +242,7 @@ HRESULT Render(float deltaTime) Oyster::Graphics::API::RenderModel(m2); Oyster::Graphics::API::RenderModel(m3); Oyster::Graphics::API::StartGuiRender(); - //Oyster::Graphics::API::RenderGuiElement(t,Oyster::Math::Float2(0.5f,0.5f),Oyster::Math::Float2(1,1), Oyster::Math::Float3(0,0,1)); + Oyster::Graphics::API::RenderGuiElement(t2,Oyster::Math::Float3(0.5f,0.7f,0.1f),Oyster::Math::Float2(0.2f,0.2f), Oyster::Math::Float3(1,1,1)); //Oyster::Graphics::API::RenderGuiElement(t2,Oyster::Math::Float2(0.5f,0.5f),Oyster::Math::Float2(1,1),Oyster::Math::Float3(1,0,0)); Oyster::Graphics::API::StartTextRender(); std::wstring fps; @@ -250,7 +250,7 @@ HRESULT Render(float deltaTime) fps = std::to_wstring(f); //Oyster::Graphics::API::RenderText(L"Lanariel",Oyster::Math::Float2(0.5f,0.1f),Oyster::Math::Float2(0.5f,0.1f)); //Oyster::Graphics::API::RenderText(L"Lanariel WAS HERE",Oyster::Math::Float2(0.5f,0.1f),Oyster::Math::Float2(0.5f,0.1f)); - Oyster::Graphics::API::RenderText(fps,Oyster::Math::Float3(0.5f,0.1f,1.0f),Oyster::Math::Float2(0.5f,0.1f), 0.08f, Oyster::Math::Float3(0,1,0)); + Oyster::Graphics::API::RenderText(fps,Oyster::Math::Float3(0.5f,0.1f,0.1f),Oyster::Math::Float2(0.5f,0.1f), 0.08f, Oyster::Math::Float3(0,1,0)); Oyster::Graphics::API::EndFrame(); return S_OK; From 655f48017c7beaf610fe65ff98af36d84d2fcffb Mon Sep 17 00:00:00 2001 From: lanariel Date: Fri, 14 Feb 2014 15:11:12 +0100 Subject: [PATCH 2/3] Anim Fix --- Code/OysterGraphics/Render/Resources.cpp | 4 ++-- .../Shader/Passes/Gather/Header.hlsli | 2 -- Code/Tester/MainTest.cpp | 17 +---------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Code/OysterGraphics/Render/Resources.cpp b/Code/OysterGraphics/Render/Resources.cpp index 696ee6f1..0c5bf592 100644 --- a/Code/OysterGraphics/Render/Resources.cpp +++ b/Code/OysterGraphics/Render/Resources.cpp @@ -340,8 +340,8 @@ namespace Oyster { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0 }, - { "BONEINDEX", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 56, D3D11_INPUT_PER_VERTEX_DATA, 0 }, - { "BONEWEIGHT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 72, D3D11_INPUT_PER_VERTEX_DATA, 0 } + { "BONEINDEX", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + { "BONEWEIGHT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 48, D3D11_INPUT_PER_VERTEX_DATA, 0 } }; Shader::CreateInputLayout(indesc,5,GetShader::Vertex(L"Gather"),Gather::Pass.IAStage.Layout); diff --git a/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli b/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli index 8747e46d..7584fcd3 100644 --- a/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli +++ b/Code/OysterGraphics/Shader/Passes/Gather/Header.hlsli @@ -13,8 +13,6 @@ struct VertexOut float4 ViewPos : POSITION; float2 UV : TEXCOORD; float3 normal : NORMAL; - //float3 tangent : TANGENT; - //float3 biTangent : BITANGENT; }; struct PixelOut diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index d30529a8..c3d19f29 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -171,14 +171,10 @@ HRESULT InitDirect3D() } m = Oyster::Graphics::API::CreateModel(L"crate_colonists.dan"); - //m->WorldMatrix.m[0][0] = 0.0002f; - //m->WorldMatrix.m[1][1] = 0.0002f; - //m->WorldMatrix.m[2][2] = 0.0002f; m2 = Oyster::Graphics::API::CreateModel(L"char_orca.dan"); m2->Tint = Oyster::Math::Float3(0.1f,0.1f,1); m3 = Oyster::Graphics::API::CreateModel(L"char_orca.dan"); - //m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3::null,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); - Oyster::Graphics::API::PlayAnimation(m2, L"movement", true); + //Oyster::Graphics::API::PlayAnimation(m2, L"movement", true); Oyster::Graphics::API::PlayAnimation(m3, L"movement", true); t = Oyster::Graphics::API::CreateTexture(L"structure_corp_mdg.png"); @@ -219,17 +215,10 @@ HRESULT InitDirect3D() float angle = 0; HRESULT Update(float deltaTime) { - //angle += Oyster::Math::pi/16 * deltaTime; m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * -angle,Oyster::Math::Float3(-4,0,0),Oyster::Math::Float3::null); - Oyster::Math::Matrix ma = Oyster::Math::Matrix::identity; - ma.m[0][0] = 0.2f; - ma.m[1][1] = 0.2f; - ma.m[2][2] = 0.2f; - //m->WorldMatrix = m->WorldMatrix * ma; Oyster::Graphics::API::Update(deltaTime); - //m2->Animation.data.AnimationTime += deltaTime;// * 0.5f; return S_OK; } @@ -290,14 +279,10 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam break; //Z - case 0x5A: - //m2->AnimationTime -= 0.1f; - //if(m2->AnimationTime < 0) - //m2->AnimationTime = 0; angle += Oyster::Math::pi / 16; break; //X + case 0x58: - //m2->AnimationTime += 0.1f; angle -= Oyster::Math::pi / 16; break; From 9096e548a1da729bdedba462fdd4e87b71105d53 Mon Sep 17 00:00:00 2001 From: lanariel Date: Fri, 14 Feb 2014 15:31:38 +0100 Subject: [PATCH 3/3] Text Culling Fix --- Code/OysterGraphics/Render/GuiRenderer.cpp | 2 +- .../Shader/Passes/Post/PostPass.hlsl | 6 ------ Code/Tester/MainTest.cpp | 17 ++++++++++++++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Code/OysterGraphics/Render/GuiRenderer.cpp b/Code/OysterGraphics/Render/GuiRenderer.cpp index 86f6fe0e..8eda0bf5 100644 --- a/Code/OysterGraphics/Render/GuiRenderer.cpp +++ b/Code/OysterGraphics/Render/GuiRenderer.cpp @@ -92,7 +92,7 @@ namespace Oyster tmpInst.coff=(1.0f/TEXT_NR_LETTERS); tmpInst.offset=text[i]-32; tmpInst.pos=i*(FontSize * 0.7f * TEXT_SPACING); - if(tmpInst.pos > size.x) + if(tmpInst.pos > size.x*2) { text = text.substr(0,i-1); break; diff --git a/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl b/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl index ba835e18..26c9e941 100644 --- a/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl +++ b/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl @@ -21,12 +21,6 @@ float4 SuperSample(float4 Glow, uint3 DTid) index = index / Output.Length; Glow = Ambient.SampleLevel(S1, index,1); Glow = Glow * Glow.w*10; - //Line Y+1 - //Glow += Ambient[DTid.xy/2 + uint2(1,(Output.Length.y/2)+1)] + Ambient[DTid.xy/2 + uint2(0,(Output.Length.y/2)+1)] + Ambient[DTid.xy/2 + uint2(-1,(Output.Length.y/2)+1)]; - //Line Y-1 - //Glow += Ambient[DTid.xy/2 + uint2(1,(Output.Length.y/2)-1)] + Ambient[DTid.xy/2 + uint2(0,(Output.Length.y/2)-1)] + Ambient[DTid.xy/2 + uint2(-1,(Output.Length.y/2)-1)]; - - //Glow = Glow/9; return Glow; } diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index c3d19f29..e854e1f9 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -213,9 +213,10 @@ HRESULT InitDirect3D() return S_OK; } float angle = 0; +float z=0; HRESULT Update(float deltaTime) { - m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null); + m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,z),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * -angle,Oyster::Math::Float3(-4,0,0),Oyster::Math::Float3::null); Oyster::Graphics::API::Update(deltaTime); @@ -285,6 +286,20 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam case 0x58: angle -= Oyster::Math::pi / 16; break; + //A + case 0x41: + break; + //D + case 0x44: + break; + //W + case 0x57: + z-=0.5f; + break; + //S + case 0x53: + z+=0.5f; + break; } break;