Fix Z-fighting in the flying_objects example.
This commit is contained in:
parent
10304a6164
commit
0351b05978
@ -355,15 +355,16 @@ impl SpecializedMeshPipeline for OutlinePipeline {
|
|||||||
depth_write_enabled: true,
|
depth_write_enabled: true,
|
||||||
depth_compare: CompareFunction::Greater,
|
depth_compare: CompareFunction::Greater,
|
||||||
stencil: StencilState::default(),
|
stencil: StencilState::default(),
|
||||||
bias: DepthBiasState {
|
bias: if key.depth_mode() == DepthMode::Flat && key.pass_type() == PassType::Stencil
|
||||||
constant: if key.depth_mode() == DepthMode::Flat
|
{
|
||||||
&& key.pass_type() == PassType::Stencil
|
DepthBiasState {
|
||||||
{
|
// Values determined empirically
|
||||||
2 // 1 is empirically not enough to prevent Z-fighting.
|
constant: 3,
|
||||||
} else {
|
slope_scale: 1.0,
|
||||||
0
|
..default()
|
||||||
},
|
}
|
||||||
..default()
|
} else {
|
||||||
|
default()
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
multisample: MultisampleState {
|
multisample: MultisampleState {
|
||||||
|
Loading…
Reference in New Issue
Block a user