mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -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 "
|
"to just leave this set, since the workaround seems to be "
|
||||||
"sufficient for all cases."));
|
"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
|
#ifndef NDEBUG
|
||||||
// debugging flag
|
// debugging flag
|
||||||
// values are same as D3DCULL enumtype, 0 - no force, 1 - force none, 2 - force CW, 3 - force CCW
|
// 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_use_triangle_mipgen_filter;
|
||||||
extern ConfigVariableBool dx_broken_max_index;
|
extern ConfigVariableBool dx_broken_max_index;
|
||||||
extern ConfigVariableBool dx_broken_depth_bias;
|
extern ConfigVariableBool dx_broken_depth_bias;
|
||||||
|
extern ConfigVariableDouble dx_depth_bias_scale;
|
||||||
|
|
||||||
// debug flags we might want to use in full optimized build
|
// debug flags we might want to use in full optimized build
|
||||||
extern ConfigVariableBool dx_ignore_mipmaps;
|
extern ConfigVariableBool dx_ignore_mipmaps;
|
||||||
|
@ -3143,7 +3143,7 @@ do_issue_depth_offset() {
|
|||||||
// DirectX depth bias isn't directly supported by the driver.
|
// DirectX depth bias isn't directly supported by the driver.
|
||||||
// Cheese a depth bias effect by sliding the viewport backward a
|
// Cheese a depth bias effect by sliding the viewport backward a
|
||||||
// bit.
|
// bit.
|
||||||
static const float bias_scale = 0.0001;
|
static const float bias_scale = dx_depth_bias_scale;
|
||||||
D3DVIEWPORT9 vp = _current_viewport;
|
D3DVIEWPORT9 vp = _current_viewport;
|
||||||
vp.MinZ -= bias_scale * offset;
|
vp.MinZ -= bias_scale * offset;
|
||||||
vp.MaxZ -= bias_scale * offset;
|
vp.MaxZ -= bias_scale * offset;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user