MarginallyClever / Robot-Overlord-App

Simulation and control software for robots
https://www.marginallyclever.com/
GNU General Public License v2.0
157 stars 48 forks source link

more attempt to fix 151 #166

Closed i-make-robots closed 1 year ago

i-make-robots commented 1 year ago

@Jackymancs4 does this help at all? I think the problem is related to vertex array object (VAOs).

Jackymancs4 commented 1 year ago

I'm afraid not.

i-make-robots commented 1 year ago

Wait, what? Did test 3 work before this PR?

Jackymancs4 commented 1 year ago

With master:

Jackymancs4 commented 1 year ago

I'm afraid not.

I was wrong. A clean build actually fixed it.

Renderer never becomes unresponsive.

i-make-robots commented 1 year ago

Huzzah! Does that mean a clean build of Robot Overlord works?!

Jackymancs4 commented 1 year ago

Nope, tried that. But I also did a bisect, and whatever you did in "more attempt to fix 151" (70db3cfd94acc6fbf42f3d0404ac235a1560558f) made all the difference for for OpenGLTestOrthographic.

Running RobotOverlord on that commit still gets me black background.

i-make-robots commented 1 year ago

What about OpenGLTestPerspective?

Jackymancs4 commented 1 year ago

Once again, my fault. On https://github.com/MarginallyClever/Robot-Overlord-App/commit/70db3cfd94acc6fbf42f3d0404ac235a1560558f everything works, both and OpenGLTestPerspective and RobotOverlord (congrats!).

On 7c23a1b3d43e705034f7ba60206df7eb895d9a69 RobotOverlord has the black background issue, and tests from 2 to 5 don't pass.

i-make-robots commented 1 year ago

Huh. the change in 7c23a1b is technically more correct...

Jackymancs4 commented 1 year ago

This time I'm confident in my assessment, as reverting https://github.com/MarginallyClever/Robot-Overlord-App/commit/7c23a1b3d43e705034f7ba60206df7eb895d9a69 fixes both tests and main app.

Jackymancs4 commented 1 year ago

Huh. the change in https://github.com/MarginallyClever/Robot-Overlord-App/commit/7c23a1b3d43e705034f7ba60206df7eb895d9a69 is technically more correct...

Do you really need to unbind the VAOs? E.g. https://stackoverflow.com/questions/25412767/opengl-glbindbuffer0-outside-vao

Because commenting https://github.com/MarginallyClever/Robot-Overlord-App/blob/f9fb5396caf675a78a05f3325ebf56d2acbfaac0/src/main/java/com/marginallyclever/robotoverlord/systems/render/mesh/Mesh.java#L186 and https://github.com/MarginallyClever/Robot-Overlord-App/blob/f9fb5396caf675a78a05f3325ebf56d2acbfaac0/src/main/java/com/marginallyclever/robotoverlord/renderpanel/OpenGLTestOrthographic.java#L166 seems to fix my problem.

i-make-robots commented 1 year ago

in Compass3d, cube.getModel().setDirty(true); needs to be called before cube.render(); or the cube disappears after a preferences change. I don't know why this happens, it shouldn't disappear. it gets completely rebuilt when the OpenglRenderPanel is created.

Jackymancs4 commented 1 year ago

I confirm that building on the last commit fixes the issues with the renderer. I suggest merging as this closes #151 now.

Jackymancs4 commented 1 year ago

Last commit fixes #167

i-make-robots commented 1 year ago

If that's the case then we can consider #151 and #167 closed.