Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting clip_area is broken. #340

Open
DDR0 opened this issue Sep 3, 2022 · 5 comments
Open

Setting clip_area is broken. #340

DDR0 opened this issue Sep 3, 2022 · 5 comments
Assignees

Comments

@DDR0
Copy link
Contributor

DDR0 commented Sep 3, 2022

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:

  • The call does "apply" clip_area if you enter the editor. This is confirmed in the positive and negative case.
  • The bug has existed for more than three months or so, now.
  • In some cases, something happens which causes this bug to not reproduce on more complicated objects.
@DDR0 DDR0 assigned davewx7 and DDR0 Sep 3, 2022
DDR0 added a commit to frogatto/frogatto that referenced this issue Sep 3, 2022
…e/anura/issues/340.

	- To reproduce the bug, the exact toggle is liquid.cfg:85,
	  `end_zorder:   -91,`, vs `-90`.
@DDR0
Copy link
Contributor Author

DDR0 commented Sep 3, 2022

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
Copy link
Contributor Author

DDR0 commented Sep 3, 2022

identity_op works too.

@DDR0
Copy link
Contributor Author

DDR0 commented Sep 4, 2022

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

@DDR0
Copy link
Contributor Author

DDR0 commented Sep 4, 2022

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
Copy link
Contributor Author

DDR0 commented Sep 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants