Graphics fix
This commit is contained in:
parent
fc19938f1b
commit
f9f4d55123
|
@ -36,6 +36,8 @@ struct GameState::MyData
|
||||||
bool key_Shoot;
|
bool key_Shoot;
|
||||||
bool key_Jump;
|
bool key_Jump;
|
||||||
|
|
||||||
|
bool key_Reload_Shaders;
|
||||||
|
|
||||||
C_Player player;
|
C_Player player;
|
||||||
Camera_FPS camera;
|
Camera_FPS camera;
|
||||||
|
|
||||||
|
@ -236,6 +238,20 @@ void GameState::ReadKeyInput()
|
||||||
else
|
else
|
||||||
this->privData->key_strafeRight = false;
|
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
|
//send delta mouse movement
|
||||||
{
|
{
|
||||||
|
|
|
@ -160,7 +160,7 @@ namespace Oyster
|
||||||
D3D11_RASTERIZER_DESC rdesc;
|
D3D11_RASTERIZER_DESC rdesc;
|
||||||
rdesc.CullMode = D3D11_CULL_BACK;
|
rdesc.CullMode = D3D11_CULL_BACK;
|
||||||
rdesc.FillMode = D3D11_FILL_SOLID;
|
rdesc.FillMode = D3D11_FILL_SOLID;
|
||||||
rdesc.FrontCounterClockwise = false;
|
rdesc.FrontCounterClockwise = true;
|
||||||
rdesc.DepthBias = 0;
|
rdesc.DepthBias = 0;
|
||||||
rdesc.DepthBiasClamp = 0;
|
rdesc.DepthBiasClamp = 0;
|
||||||
rdesc.DepthClipEnable = true;
|
rdesc.DepthClipEnable = true;
|
||||||
|
|
|
@ -27,7 +27,7 @@ void main(int3 ThreadID : SV_DispatchThreadID, int3 gThreadID : SV_GroupThreadID
|
||||||
blurCol +=Weights[i + blurRadius] * gCache[k];
|
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];
|
//outTex[ThreadID.xy + Start] = inTex[ThreadID.xy + Start];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ void main(int3 ThreadID : SV_DispatchThreadID, int3 gThreadID : SV_GroupThreadID
|
||||||
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+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();
|
GroupMemoryBarrierWithGroupSync();
|
||||||
|
|
||||||
|
@ -27,6 +27,6 @@ void main(int3 ThreadID : SV_DispatchThreadID, int3 gThreadID : SV_GroupThreadID
|
||||||
blurCol +=Weights[i + blurRadius] * gCache[k];
|
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];
|
//outTex[ThreadID.xy + Start] = inTex[ThreadID.xy+ Start];
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ float4 SuperSample(float4 Glow, uint3 DTid)
|
||||||
index += float2(0,Output.Length.y/2);
|
index += float2(0,Output.Length.y/2);
|
||||||
index = index / Output.Length;
|
index = index / Output.Length;
|
||||||
Glow = Ambient.SampleLevel(S1, index,1);
|
Glow = Ambient.SampleLevel(S1, index,1);
|
||||||
Glow = Glow * Glow.w*10;
|
Glow = Glow;
|
||||||
|
|
||||||
return Glow;
|
return Glow;
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,8 @@ void main( uint3 DTid : SV_DispatchThreadID )
|
||||||
{
|
{
|
||||||
float4 Light = Diffuse[DTid.xy] + saturate(Specular[DTid.xy]);
|
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)];
|
float4 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)];
|
||||||
|
|
||||||
Glow = SuperSample(Glow,DTid);
|
|
||||||
|
|
||||||
float4 GUI;
|
float4 GUI;
|
||||||
uint2 index = DTid.xy/2 + uint2((uint)Output.Length.x/(uint)2,0);
|
uint2 index = DTid.xy/2 + uint2((uint)Output.Length.x/(uint)2,0);
|
||||||
float3 PostLight = Amb.xyz * AmbFactor;
|
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((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] = float4(Ambient[DTid.xy/2 + uint2(0,Output.Length.y*0.5f)].xyz,1);
|
||||||
|
//Output[DTid.xy] = Ambient[DTid.xy];
|
||||||
}
|
}
|
Loading…
Reference in New Issue