Small fixes
This commit is contained in:
parent
273995e204
commit
4697b85e3b
|
@ -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())
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace Oyster
|
|||
Resources::Gui::Text::Vertex.Unmap();
|
||||
|
||||
|
||||
Core::deviceContext->Draw(text.length(), 0);
|
||||
Core::deviceContext->Draw((UINT)text.length(), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -349,9 +349,6 @@ namespace Oyster
|
|||
Core::device->CreateDepthStencilView(depthstencil,NULL,&Gui::depth);
|
||||
depthstencil->Release();
|
||||
|
||||
|
||||
D3D11_DEPTH_STENCIL_DESC dDesc;
|
||||
|
||||
return Core::Init::Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue