anura-engine / anura

Anura Engine
Other
384 stars 78 forks source link

Setting clip_area is broken. #340

Open DDR0 opened 2 years ago

DDR0 commented 2 years ago

To reproduce: Check out Frogatto's minimal-clip-area-bug branch. Run ./anura --level=test.cfg.

The coin on screen should turn invisible, but instead of just darkens as a result of the set(brightness, 128) call right before the set(clip_area, ...) call.

Notes:

DDR0 commented 2 years ago

And now, coming at it from the other end, we have Frogatto's maximal-clip-area-bug branch. It seems that tweaking the liquid shader's end_zorder is enough to fix or break clip_area.

DDR0 commented 2 years ago

identity_op works too.

DDR0 commented 2 years ago

In level.cpp, commenting out shaders.emplace_back(e.shader); in frameBufferEnterZorder() stops the "fix" from working.

DDR0 commented 2 years ago

I think shaders are setting something elsewhere, as as far as I can tell the critical path for them is shader->setUniformValue(shader->getPVUniform(), glm::value_ptr(pvmat)); in DeviceOGL.cpp's DisplayDeviceOpenGL::render.

DDR0 commented 1 year ago

I have applied a general hack around this for Frogatto. Search for the _add_shader_fix_for_clip_area_to_fix_anura_issue_340 in the FFL there.