mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
further depth-bias fixes
This commit is contained in:
parent
cef2a5c8b2
commit
2f47cbbb17
@ -80,6 +80,13 @@ ConfigVariableBool dx_broken_depth_bias
|
||||
"to just leave this set, since the workaround seems to be "
|
||||
"sufficient for all cases."));
|
||||
|
||||
ConfigVariableDouble dx_depth_bias_scale
|
||||
("dx-depth-bias-scale", 0.000001,
|
||||
PRC_DESC("If depth bias is not directly supported by the graphics driver "
|
||||
"(or if dx-broken-depth-bias is set true), this configures the "
|
||||
"amount by which we slide the viewport back to achieve the effect "
|
||||
"of a depth bias. It should generally be a small number."));
|
||||
|
||||
#ifndef NDEBUG
|
||||
// debugging flag
|
||||
// values are same as D3DCULL enumtype, 0 - no force, 1 - force none, 2 - force CW, 3 - force CCW
|
||||
|
@ -34,6 +34,7 @@ extern ConfigVariableInt dx_multisample_antialiasing_level;
|
||||
extern ConfigVariableBool dx_use_triangle_mipgen_filter;
|
||||
extern ConfigVariableBool dx_broken_max_index;
|
||||
extern ConfigVariableBool dx_broken_depth_bias;
|
||||
extern ConfigVariableDouble dx_depth_bias_scale;
|
||||
|
||||
// debug flags we might want to use in full optimized build
|
||||
extern ConfigVariableBool dx_ignore_mipmaps;
|
||||
|
@ -3143,7 +3143,7 @@ do_issue_depth_offset() {
|
||||
// DirectX depth bias isn't directly supported by the driver.
|
||||
// Cheese a depth bias effect by sliding the viewport backward a
|
||||
// bit.
|
||||
static const float bias_scale = 0.0001;
|
||||
static const float bias_scale = dx_depth_bias_scale;
|
||||
D3DVIEWPORT9 vp = _current_viewport;
|
||||
vp.MinZ -= bias_scale * offset;
|
||||
vp.MaxZ -= bias_scale * offset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user