Merge branch 'GameClient' of https://github.com/dean11/Danbias into GameClient
This commit is contained in:
commit
d22e736ea3
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ShowAllFiles>true</ShowAllFiles>
|
<ShowAllFiles>false</ShowAllFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
|
||||||
|
|
|
@ -16,8 +16,10 @@ C_Object::C_Object()
|
||||||
}
|
}
|
||||||
C_Object::~C_Object()
|
C_Object::~C_Object()
|
||||||
{
|
{
|
||||||
|
if( this->model )
|
||||||
|
this->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C_Object::Init(ModelInitData modelInit)
|
bool C_Object::Init(ModelInitData modelInit)
|
||||||
{
|
{
|
||||||
position = modelInit.position;
|
position = modelInit.position;
|
||||||
|
|
|
@ -136,11 +136,6 @@ void Camera_FPSV2::StrafeLeft( Float distance )
|
||||||
|
|
||||||
void Camera_FPSV2::PitchUp( Float radian )
|
void Camera_FPSV2::PitchUp( Float radian )
|
||||||
{
|
{
|
||||||
if( radian >= 0.5f )
|
|
||||||
{ // HACK: debugging
|
|
||||||
const char *breakPoint = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
|
this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
|
||||||
this->pitchHaveChanged = true;
|
this->pitchHaveChanged = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ bool GameState::Init( SharedStateContent &shared )
|
||||||
Float aspectRatio = gfxOp.Resolution.x / gfxOp.Resolution.y;
|
Float aspectRatio = gfxOp.Resolution.x / gfxOp.Resolution.y;
|
||||||
this->privData->camera.SetPerspectiveProjection( Utility::Value::Radian(90.0f), aspectRatio, 0.1f, 1000.0f );
|
this->privData->camera.SetPerspectiveProjection( Utility::Value::Radian(90.0f), aspectRatio, 0.1f, 1000.0f );
|
||||||
Graphics::API::SetProjection( this->privData->camera.GetProjectionMatrix() );
|
Graphics::API::SetProjection( this->privData->camera.GetProjectionMatrix() );
|
||||||
gfxOp.AmbientValue = 2.0f;
|
gfxOp.AmbientValue = 1.0f;
|
||||||
Graphics::API::SetOptions(gfxOp);
|
Graphics::API::SetOptions(gfxOp);
|
||||||
|
|
||||||
//tell server ready
|
//tell server ready
|
||||||
|
@ -489,7 +489,7 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
|
||||||
if( !Within(position.Dot(position), 2500.0f, 90000.0f) )
|
if( !Within(position.Dot(position), 2500.0f, 90000.0f) )
|
||||||
{ // HACK: bug trap
|
{ // HACK: bug trap
|
||||||
const char *breakPoint = "Something is wrong.";
|
const char *breakPoint = "Something is wrong.";
|
||||||
//position = Float3( 0.0f, 160.0f, 0.0f );
|
position = Float3( 0.0f, 160.0f, 0.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
this->privData->camera.SetPosition( position );
|
this->privData->camera.SetPosition( position );
|
||||||
|
|
|
@ -83,7 +83,13 @@ public:
|
||||||
, broadcastTime(1.0f, 0.0f)
|
, broadcastTime(1.0f, 0.0f)
|
||||||
{ }
|
{ }
|
||||||
~PrivateData()
|
~PrivateData()
|
||||||
{ }
|
{
|
||||||
|
if(listener)
|
||||||
|
{
|
||||||
|
delete listener;
|
||||||
|
listener = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool DoWork();
|
bool DoWork();
|
||||||
|
|
||||||
|
|
|
@ -221,6 +221,26 @@ namespace Oyster
|
||||||
sphere->WorldMatrix = world;
|
sphere->WorldMatrix = world;
|
||||||
Render::DefaultRenderer::RenderScene(sphere,1,View,Projection);
|
Render::DefaultRenderer::RenderScene(sphere,1,View,Projection);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
API::State API::ReloadShaders()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void API::StartRenderWireFrame()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void API::RenderDebugCube(Math::Matrix world)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void API::RenderDebugSphere(Math::Matrix world)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
API::Option API::GetOption()
|
API::Option API::GetOption()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "Defines.hlsli"
|
#include "Defines.hlsli"
|
||||||
#include "PosManipulation.hlsli"
|
#include "PosManipulation.hlsli"
|
||||||
|
|
||||||
static float Radius = 100;
|
static float Radius = 10;
|
||||||
|
|
||||||
float GetSSAO(float3 pos, float2 uv, int2 texCoord2, uint2 rndID)
|
float GetSSAO(float3 pos, float2 uv, int2 texCoord2, uint2 rndID)
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ float GetSSAO(float3 pos, float2 uv, int2 texCoord2, uint2 rndID)
|
||||||
float sampleDepth = ViewPos.z;
|
float sampleDepth = ViewPos.z;
|
||||||
|
|
||||||
//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);
|
||||||
|
|
Loading…
Reference in New Issue