Fixed Spec coefficient

This commit is contained in:
lanariel 2014-02-12 13:53:52 +01:00
parent da5b9c7306
commit 11b6f6eddc
3 changed files with 6 additions and 4 deletions

View File

@ -45,6 +45,6 @@ PixelOut main(VertexOut input)
normal = perturb_normal( normal, normalize(-input.ViewPos), input.UV );
output.NormalSpec = float4(normal, Normal.Sample(S1,input.UV).w);
output.NormalSpec = float4(normal, Normal.Sample(S1, input.UV).w*255);
return output;
}

View File

@ -24,5 +24,7 @@ DiffSpec LightCalc(PointLight pl, float3 pos, int2 texCoord)
output.Diffuse = float3(0,0,0);
output.Specular = float3(0,0,0);
}
float SpecCo = normalSpec.w < 1 ? 0.0f : 1.0f;
output.Specular = output.Specular * SpecCo;
return output;
}

View File

@ -229,11 +229,11 @@ HRESULT Render(float deltaTime)
Oyster::Graphics::API::SetView(V);
Oyster::Graphics::API::NewFrame();
Oyster::Graphics::API::RenderModel(m);
//Oyster::Graphics::API::RenderModel(m);
Oyster::Graphics::API::RenderModel(m2);
Oyster::Graphics::API::StartGuiRender();
Oyster::Graphics::API::RenderGuiElement(t,Oyster::Math::Float2(0.5f,0.5f),Oyster::Math::Float2(1,1));
Oyster::Graphics::API::RenderGuiElement(t2,Oyster::Math::Float2(0.5f,0.1f),Oyster::Math::Float2(0.5f,0.1f),Oyster::Math::Float3(1,0,0));
//Oyster::Graphics::API::RenderGuiElement(t,Oyster::Math::Float2(0.5f,0.5f),Oyster::Math::Float2(1,1));
//Oyster::Graphics::API::RenderGuiElement(t2,Oyster::Math::Float2(0.5f,0.5f),Oyster::Math::Float2(1,1),Oyster::Math::Float3(1,0,0));
Oyster::Graphics::API::StartTextRender();
std::wstring fps;
float f = 1/deltaTime;