Merge commit '0a70839211c9b1d87f2313817cb5a1000fe34ef0' into GameClient

This commit is contained in:
lindaandersson 2014-02-18 13:32:32 +01:00
commit c583543d36
7 changed files with 29 additions and 18 deletions

View File

@ -112,8 +112,7 @@ void Camera_FPS::StrafeLeft( Float distance )
void Camera_FPS::PitchUp( Float radian )
{
//this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
this->pitchUp = this->pitchUp + radian; // debug hack
this->pitchUp = Clamp( this->pitchUp + radian, -0.48f * pi, 0.48f * pi );
this->head.SetAngular( this->body.angularAxis + this->pitchUp * this->body.direction.v[0] );
}

View File

@ -36,6 +36,8 @@ struct GameState::MyData
bool key_Shoot;
bool key_Jump;
bool key_Reload_Shaders;
C_Player player;
Camera_FPS camera;
@ -87,12 +89,6 @@ bool GameState::Init( SharedStateContent &shared )
// Debugg hack
this->InitiatePlayer( 0, "crate_generic.dan",Float3( 0,132, 10), Quaternion::identity, Float3(1), true );
Graphics::Definitions::Pointlight light;
light.Pos = Float3( 0,132,0);
light.Color = Float3( 1.0f );
light.Bright = 1.0f;
light.Radius = 1000.0f;
Graphics::API::AddLight( light );
// end debug hack
return true;
@ -283,6 +279,20 @@ void GameState::ReadKeyInput()
else
this->privData->key_strafeRight = false;
if( this->privData->input->IsKeyPressed(DIK_R) )
{
if( !this->privData->key_Reload_Shaders )
{
//this->privData->nwClient->Send( Protocol_PlayerMovementRight() );
#ifdef _DEBUG
Graphics::API::ReloadShaders();
#endif
this->privData->key_Reload_Shaders = true;
}
}
else
this->privData->key_Reload_Shaders = false;
//send delta mouse movement
{

View File

@ -337,7 +337,11 @@ namespace Utility
template<typename ValueType>
inline ValueType Clamp( const ValueType &value, const ValueType &min, const ValueType &max )
{ return value < min ? Max( value, max ) : min; }
{
if( value < min ) return min;
if( value > max ) return max;
return value;
}
template<typename ValueType>
inline ValueType Average( const ValueType &valueA, const ValueType &valueB )

View File

@ -160,7 +160,7 @@ namespace Oyster
D3D11_RASTERIZER_DESC rdesc;
rdesc.CullMode = D3D11_CULL_BACK;
rdesc.FillMode = D3D11_FILL_SOLID;
rdesc.FrontCounterClockwise = false;
rdesc.FrontCounterClockwise = true;
rdesc.DepthBias = 0;
rdesc.DepthBiasClamp = 0;
rdesc.DepthClipEnable = true;

View File

@ -27,7 +27,7 @@ void main(int3 ThreadID : SV_DispatchThreadID, int3 gThreadID : SV_GroupThreadID
blurCol +=Weights[i + blurRadius] * gCache[k];
}
outTex[ThreadID.xy + Start] = blurCol * BlurMask + inTex[ThreadID.xy + Start] * ( float4(1,1,1,1) - BlurMask);
outTex[min(ThreadID.xy + Start, Stop-1)] = blurCol * BlurMask + inTex[min(ThreadID.xy + Start, Stop-1)] * ( float4(1,1,1,1) - BlurMask);
//outTex[ThreadID.xy + Start] = inTex[ThreadID.xy + Start];
}

View File

@ -11,10 +11,10 @@ void main(int3 ThreadID : SV_DispatchThreadID, int3 gThreadID : SV_GroupThreadID
}
if(gThreadID.y >= N-blurRadius)
{
int y = min(ThreadID.y+blurRadius, Stop.y-1);
int y = min(ThreadID.y +blurRadius, Stop.y-1);
gCache[gThreadID.y+2*blurRadius] = inTex[int2(ThreadID.x,y) + Start];
}
gCache[gThreadID.y+blurRadius] = inTex[min(ThreadID.xy + Start, Stop.xy-1)];
gCache[gThreadID.y+blurRadius] = inTex[min(ThreadID.xy + Start, Stop-1)];
GroupMemoryBarrierWithGroupSync();
@ -27,6 +27,6 @@ void main(int3 ThreadID : SV_DispatchThreadID, int3 gThreadID : SV_GroupThreadID
blurCol +=Weights[i + blurRadius] * gCache[k];
}
outTex[ThreadID.xy + Start] = blurCol + inTex[ThreadID.xy + Start] * ( float4(1,1,1,1) - BlurMask);;
outTex[min(ThreadID.xy + Start, Stop-1)] = blurCol * BlurMask + inTex[min(ThreadID.xy + Start, Stop-1)] * ( float4(1,1,1,1) - BlurMask);;
//outTex[ThreadID.xy + Start] = inTex[ThreadID.xy+ Start];
}

View File

@ -18,7 +18,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;
Glow = Glow;
return Glow;
}
@ -28,11 +28,8 @@ 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 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)];
float4 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)];
Glow = SuperSample(Glow,DTid);
float4 GUI;
uint2 index = DTid.xy/2 + uint2((uint)Output.Length.x/(uint)2,0);
float3 PostLight = Amb.xyz * AmbFactor;
@ -42,4 +39,5 @@ void main( uint3 DTid : SV_DispatchThreadID )
Output[DTid.xy] = float4((GUI.xyz * GUI.w) + PostLight, 1);
//Output[DTid.xy] = float4(Ambient[DTid.xy/2 + uint2(0,Output.Length.y*0.5f)].xyz,1);
//Output[DTid.xy] = Ambient[DTid.xy];
}