mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
Adjust magic number to prevent z-fighting.
This commit is contained in:
parent
08c9bf88e9
commit
08b449f149
@ -126,7 +126,7 @@ struct Shader : public IShader {
|
||||
int index_x = b3Max(0, b3Min(m_width-1, int(p[0])));
|
||||
int index_y = b3Max(0, b3Min(m_height-1, int(p[1])));
|
||||
int idx = index_x + index_y*m_width; // index in the shadowbuffer array
|
||||
float shadow = 0.8+0.2*(m_shadowBuffer->at(idx)<-depth+0.2); // magic coeff to avoid z-fighting
|
||||
float shadow = 0.8+0.2*(m_shadowBuffer->at(idx)<-depth+0.05); // magic coeff to avoid z-fighting
|
||||
|
||||
Vec3f bn = (varying_nrm*bar).normalize();
|
||||
Vec2f uv = varying_uv*bar;
|
||||
|
Loading…
Reference in New Issue
Block a user