Text Culling Fix

This commit is contained in:
lanariel 2014-02-14 15:31:38 +01:00
parent 655f48017c
commit 9096e548a1
3 changed files with 17 additions and 8 deletions

View File

@ -92,7 +92,7 @@ namespace Oyster
tmpInst.coff=(1.0f/TEXT_NR_LETTERS); tmpInst.coff=(1.0f/TEXT_NR_LETTERS);
tmpInst.offset=text[i]-32; tmpInst.offset=text[i]-32;
tmpInst.pos=i*(FontSize * 0.7f * TEXT_SPACING); tmpInst.pos=i*(FontSize * 0.7f * TEXT_SPACING);
if(tmpInst.pos > size.x) if(tmpInst.pos > size.x*2)
{ {
text = text.substr(0,i-1); text = text.substr(0,i-1);
break; break;

View File

@ -21,12 +21,6 @@ float4 SuperSample(float4 Glow, uint3 DTid)
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 * Glow.w*10;
//Line Y+1
//Glow += Ambient[DTid.xy/2 + uint2(1,(Output.Length.y/2)+1)] + Ambient[DTid.xy/2 + uint2(0,(Output.Length.y/2)+1)] + Ambient[DTid.xy/2 + uint2(-1,(Output.Length.y/2)+1)];
//Line Y-1
//Glow += Ambient[DTid.xy/2 + uint2(1,(Output.Length.y/2)-1)] + Ambient[DTid.xy/2 + uint2(0,(Output.Length.y/2)-1)] + Ambient[DTid.xy/2 + uint2(-1,(Output.Length.y/2)-1)];
//Glow = Glow/9;
return Glow; return Glow;
} }

View File

@ -213,9 +213,10 @@ HRESULT InitDirect3D()
return S_OK; return S_OK;
} }
float angle = 0; float angle = 0;
float z=0;
HRESULT Update(float deltaTime) HRESULT Update(float deltaTime)
{ {
m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,0),Oyster::Math::Float3::null); m->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(0,0,z),Oyster::Math::Float3::null);
m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null); m2->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * angle,Oyster::Math::Float3(4,0,0),Oyster::Math::Float3::null);
m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * -angle,Oyster::Math::Float3(-4,0,0),Oyster::Math::Float3::null); m3->WorldMatrix = Oyster::Math3D::OrientationMatrix(Oyster::Math::Float3(0,1,0) * -angle,Oyster::Math::Float3(-4,0,0),Oyster::Math::Float3::null);
Oyster::Graphics::API::Update(deltaTime); Oyster::Graphics::API::Update(deltaTime);
@ -285,6 +286,20 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
case 0x58: case 0x58:
angle -= Oyster::Math::pi / 16; angle -= Oyster::Math::pi / 16;
break; break;
//A
case 0x41:
break;
//D
case 0x44:
break;
//W
case 0x57:
z-=0.5f;
break;
//S
case 0x53:
z+=0.5f;
break;
} }
break; break;