diff --git a/Code/Game/GameClient/DanBiasGame_Impl.cpp b/Code/Game/GameClient/DanBiasGame_Impl.cpp index 15918adf..b0107a17 100644 --- a/Code/Game/GameClient/DanBiasGame_Impl.cpp +++ b/Code/Game/GameClient/DanBiasGame_Impl.cpp @@ -106,7 +106,7 @@ namespace DanBias Graphics::API::Update( dt ); data.capFrame += dt; - if(data.capFrame > 0.03) + if(data.capFrame > 0.03f) { switch( Update(data.capFrame) ) { @@ -117,7 +117,7 @@ namespace DanBias } if(Render() != S_OK) return DanBiasClientReturn_Error; - data.capFrame -= 0.03; + data.capFrame -= 0.03f; } if(data.networkClient.IsConnected()) diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index 7ab0aeac..3dd547ba 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -89,6 +89,8 @@ bool GameState::Init( SharedStateContent &shared ) Float aspectRatio = gfxOp.Resolution.x / gfxOp.Resolution.y; this->privData->camera.SetPerspectiveProjection( Utility::Value::Radian(90.0f), aspectRatio, 0.1f, 1000.0f ); Graphics::API::SetProjection( this->privData->camera.GetProjectionMatrix() ); + gfxOp.AmbientValue = 2.0f; + Graphics::API::SetOptions(gfxOp); //tell server ready this->privData->nwClient->Send( Protocol_General_Status(Protocol_General_Status::States_ready) ); @@ -105,6 +107,7 @@ bool GameState::Init( SharedStateContent &shared ) light->second->Render(); } + return true; } @@ -237,6 +240,7 @@ bool GameState::Render() bool GameState::Release() { + Graphics::API::Option o = Graphics::API::GetOption(); if( privData ) { auto staticObject = this->privData->staticObjects->begin(); diff --git a/Code/Game/GameLogic/Game.cpp b/Code/Game/GameLogic/Game.cpp index aee57be8..f1053482 100644 --- a/Code/Game/GameLogic/Game.cpp +++ b/Code/Game/GameLogic/Game.cpp @@ -77,7 +77,7 @@ Game::PlayerData* Game::CreatePlayer() found = true; freeID = i; - for(int j = 0; j < players.Size(); j++) + for(int j = 0; j < (int)players.Size(); j++) { if(this->players[j] && this->players[j]->GetID() == freeID) diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index b3a8b101..0a207d2b 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -209,7 +209,7 @@ bool Level::InitiateLevel(std::wstring levelPath) //Convert from wstring to string typedef std::codecvt_utf8 convert_typeX; - std::wstring_convert converterX; + std::wstring_convert converterX; std::string convertedLevelPath = converterX.to_bytes(levelPath); objects = ll.LoadLevel(convertedLevelPath); @@ -220,7 +220,7 @@ bool Level::InitiateLevel(std::wstring levelPath) API::Instance().SetGravityPoint(Oyster::Math3D::Float3(0,0,0)); API::Instance().SetGravity(200); - int objCount = objects.size(); + int objCount = (int)objects.size(); for (int i = 0; i < objCount; i++) { diff --git a/Code/Misc/Utilities/Resource/OResource.h b/Code/Misc/Utilities/Resource/OResource.h index 83ed474f..6af78781 100644 --- a/Code/Misc/Utilities/Resource/OResource.h +++ b/Code/Misc/Utilities/Resource/OResource.h @@ -40,15 +40,15 @@ namespace Oyster } inline unsigned int GetResourceSize() const { - return this->resourceSize; + return (unsigned int)this->resourceSize; } inline unsigned int GetResourceElementSize() const { - return this->resourceElementSize; + return (unsigned int)this->resourceElementSize; } inline unsigned int GetResourceID() const { - return this->resourceID; + return (unsigned int)this->resourceID; } inline void SetResourceID(int id) { diff --git a/Code/Network/NetworkAPI/NetworkServer.cpp b/Code/Network/NetworkAPI/NetworkServer.cpp index 3e840dd8..028ca58e 100644 --- a/Code/Network/NetworkAPI/NetworkServer.cpp +++ b/Code/Network/NetworkAPI/NetworkServer.cpp @@ -58,7 +58,7 @@ void Broadcast() addr.append(buff); dest.sin_addr.s_addr = inet_addr( addr.c_str() ); // send the pkt - int ret = sendto( s, pkt, pkt_length, 0, (sockaddr *)&dest, sizeof(dest) ); + int ret = sendto( s, pkt, pkt_length, 0, (sockaddr *)&dest, (int)sizeof(dest) ); } } diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp index ccb811c1..89849f03 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp @@ -205,9 +205,9 @@ namespace Oyster void API::StartRenderWireFrame() { - Core::deviceContext->OMSetRenderTargets(Render::Resources::Gather::Pass.RTV.size(),&Render::Resources::Gather::Pass.RTV[0],NULL); + Core::deviceContext->OMSetRenderTargets((UINT)Render::Resources::Gather::Pass.RTV.size(),&Render::Resources::Gather::Pass.RTV[0],NULL); Core::deviceContext->RSSetState(wire); - Core::deviceContext->OMSetRenderTargets(Render::Resources::Gather::Pass.RTV.size(),&Render::Resources::Gather::Pass.RTV[0],NULL); + Core::deviceContext->OMSetRenderTargets((UINT)Render::Resources::Gather::Pass.RTV.size(),&Render::Resources::Gather::Pass.RTV[0],NULL); } void API::RenderDebugCube(Math::Matrix world) diff --git a/Code/OysterGraphics/FileLoader/ShaderLoader.cpp b/Code/OysterGraphics/FileLoader/ShaderLoader.cpp index 033be403..a5f207f3 100644 --- a/Code/OysterGraphics/FileLoader/ShaderLoader.cpp +++ b/Code/OysterGraphics/FileLoader/ShaderLoader.cpp @@ -146,7 +146,7 @@ namespace Oyster return NULL; } #endif - Core::UsedMem += data.size; + Core::UsedMem += (int)data.size; return Core::PipelineManager::CreateShader(data, Core::PipelineManager::ShaderType(type)); } } diff --git a/Code/OysterGraphics/Render/GuiRenderer.cpp b/Code/OysterGraphics/Render/GuiRenderer.cpp index 02e202e4..b71be6d7 100644 --- a/Code/OysterGraphics/Render/GuiRenderer.cpp +++ b/Code/OysterGraphics/Render/GuiRenderer.cpp @@ -103,7 +103,7 @@ namespace Oyster Resources::Gui::Text::Vertex.Unmap(); - Core::deviceContext->Draw(text.length(), 0); + Core::deviceContext->Draw((UINT)text.length(), 0); } } } diff --git a/Code/OysterGraphics/Render/Resources.cpp b/Code/OysterGraphics/Render/Resources.cpp index 124b1bf1..1de7d4ce 100644 --- a/Code/OysterGraphics/Render/Resources.cpp +++ b/Code/OysterGraphics/Render/Resources.cpp @@ -349,9 +349,6 @@ namespace Oyster Core::device->CreateDepthStencilView(depthstencil,NULL,&Gui::depth); depthstencil->Release(); - - D3D11_DEPTH_STENCIL_DESC dDesc; - return Core::Init::Success; } diff --git a/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl b/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl index 4135bdcb..258d0f25 100644 --- a/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl +++ b/Code/OysterGraphics/Shader/Passes/Post/PostPass.hlsl @@ -14,18 +14,30 @@ cbuffer Size : register(b0) [numthreads(16, 16, 1)] void main( uint3 DTid : SV_DispatchThreadID ) { + float SSAO = 0; + for(int x = 0; x < 4; ++x) + { + for(int y = 0; y < 4; ++y) + { + SSAO += Ambient[DTid.xy/2 + uint2(-2+x,-2+y)].w; + } + } + + SSAO = SSAO / 16; + float4 Light = Diffuse[DTid.xy] + saturate(Specular[DTid.xy]); - float3 Amb = Ambient[DTid.xy/2].xyz /* * Ambient[DTid.xy/2].w */; + float3 Amb = Ambient[DTid.xy/2].xyz * SSAO; + float3 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)].xyz; float4 GUI; uint2 index = DTid.xy/2 + uint2((uint)Output.Length.x/(uint)2,0); - float3 PostLight = Amb.xyz * AmbFactor; + float3 PostLight = Amb * AmbFactor; PostLight = PostLight + Light.xyz + Glow; GUI = float4(Ambient[index]); PostLight = PostLight * (1 - GUI.w); Output[DTid.xy] = float4((GUI.xyz * GUI.w) + PostLight, 1); //Output[DTid.xy] = float4(Ambient[DTid.xy/2 + uint2(Output.Length*0.5f)].xyz,1); - //Output[DTid.xy] = Ambient[DTid.xy]; + //Output[DTid.xy] = SSAO * float4(1,1,1,1); } \ No newline at end of file