fix canvas issues from previous commit

This commit is contained in:
Erwin Coumans
2017-11-18 17:20:21 -08:00
parent c88132b80f
commit 88289c032e
5 changed files with 11 additions and 10 deletions

View File

@@ -2138,7 +2138,7 @@ void PhysicsServerExample::updateGraphics()
btScalar maxDepthValue = frustumZFar;
float depth = depthValue;
double linearDepth = 255.*(2.0 * frustumZNear) / (frustumZFar + frustumZNear - depth * (frustumZFar - frustumZNear));
btScalar linearDepth = 255.*(2.0 * frustumZNear) / (frustumZFar + frustumZNear - depth * (frustumZFar - frustumZNear));
btClamp(linearDepth, btScalar(0),btScalar(255));
rgb = linearDepth;