Commit 9beaef9a authored by chili's avatar chili
Browse files

fixed spec on helmut

parent 51c06840
...@@ -311,8 +311,8 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a ...@@ -311,8 +311,8 @@ std::unique_ptr<Mesh> Model::ParseMesh( Graphics& gfx,const aiMesh& mesh,const a
struct PSMaterialConstant struct PSMaterialConstant
{ {
float specularIntensity = 1.6f; float specularIntensity = 0.8f;
float specularPower = 50.0f; float specularPower = 40.0f;
float padding[2]; float padding[2];
} pmc; } pmc;
bindablePtrs.push_back( std::make_unique<Bind::PixelConstantBuffer<PSMaterialConstant>>( gfx,pmc,1u ) ); bindablePtrs.push_back( std::make_unique<Bind::PixelConstantBuffer<PSMaterialConstant>>( gfx,pmc,1u ) );
......
...@@ -37,5 +37,5 @@ float4 main(float3 worldPos : Position, float3 n : Normal, float2 tc : Texcoord) ...@@ -37,5 +37,5 @@ float4 main(float3 worldPos : Position, float3 n : Normal, float2 tc : Texcoord)
// calculate specular intensity based on angle between viewing vector and reflection vector, narrow with power function // calculate specular intensity based on angle between viewing vector and reflection vector, narrow with power function
const float3 specular = att * (diffuseColor * diffuseIntensity) * specularIntensity * pow(max(0.0f, dot(normalize(-r), normalize(worldPos))), specularPower); const float3 specular = att * (diffuseColor * diffuseIntensity) * specularIntensity * pow(max(0.0f, dot(normalize(-r), normalize(worldPos))), specularPower);
// final color // final color
return float4(saturate(diffuse + ambient + specular), 1.0f) * tex.Sample(splr, tc); return float4(saturate((diffuse + ambient) * tex.Sample(splr, tc).rgb + specular), 1.0f);
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment