Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 2 files). Show all
Unified · Split
| @@ -2194,7 +2194,6 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) { · 2193 unmodified lines | ||
| 2194 | 2194 | void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bool transparent, bool forward) { |
| 2195 | 2195 | if (_gridPipelines.empty()) { |
| 2196 | 2196 | using namespace shader::render_utils::program; |
| 2197 | − const float DEPTH_BIAS = 0.001f; | |
| 2198 | 2197 | |
| 2199 | 2198 | static const std::vector<std::tuple<bool, bool, uint32_t>> keys = { |
| 2200 | 2199 | std::make_tuple(false, false, grid), std::make_tuple(false, true, grid_forward), std::make_tuple(true, false, grid_translucent), std::make_tuple(true, true, grid_translucent_forward) |
| @@ -2212,7 +2211,8 @@ void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bo · 11 unmodified lines | ||
| 2212 | 2211 | gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA, |
| 2213 | 2212 | gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE); |
| 2214 | 2213 | state->setCullMode(gpu::State::CULL_NONE); |
| 2215 | − state->setDepthBias(DEPTH_BIAS); | |
| 2214 | + state->setDepthBias(-1.0f); | |
| 2215 | + state->setDepthBiasSlopeScale(-1.0f); | |
| 2216 | 2216 | |
| 2217 | 2217 | _gridPipelines[{std::get<0>(key), std::get<1>(key)}] = gpu::Pipeline::create(gpu::Shader::createProgram(std::get<2>(key)), state); |
| 2218 | 2218 | } |
| @@ -2357,8 +2357,8 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp · 138 unmodified lines | ||
| 2357 | 2357 | } |
| 2358 | 2358 | state->setDepthTest(true, !config.isTransparent(), ComparisonFunction::LESS_EQUAL); |
| 2359 | 2359 | if (config.hasDepthBias()) { |
| 2360 | − state->setDepthBias(1.0f); | |
| 2361 | − state->setDepthBiasSlopeScale(1.0f); | |
| 2360 | + state->setDepthBias(-1.0f); | |
| 2361 | + state->setDepthBiasSlopeScale(-1.0f); | |
| 2362 | 2362 | } |
| 2363 | 2363 | state->setBlendFunction(config.isTransparent(), |
| 2364 | 2364 | gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA, |