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

Godot4: applying generated terrain has no effect #371

Closed
ian-h-chamberlain opened this issue May 18, 2023 · 4 comments
Closed

Godot4: applying generated terrain has no effect #371

ian-h-chamberlain opened this issue May 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ian-h-chamberlain
Copy link

Describe the bug
Hi, trying to use this plugin for the first time and I can't seem to get the generated terrain to take effect in the 3D editor. Painting terrain works, but I can't seem to get the generated changes to stick.

Opening a bug as requested in #316 (comment)

To Reproduce
Steps to reproduce the behavior:

  1. Create an HTerrain
  2. Select a data directory for the terrain
  3. Open Terrain > Generate... dialog
  4. Click Apply

I see this in the output panel:

  core/io/image.cpp:2775 - Condition "format != p_src->format" is true.
  core/io/image.cpp:2775 - Condition "format != p_src->format" is true.
Generate terrain

I also tried running godot -d and got slightly more info which might help debug:

ERROR: Condition "format != p_src->format" is true.
   at: blit_rect (core/io/image.cpp:2775)
ERROR: Condition "format != p_src->format" is true.
   at: blit_rect (core/io/image.cpp:2775)

Expected behavior
Clicking the Apply button actually modifies the terrain in the scene editor.

Screenshots
Not much to show, since there's no terrain, but I can record a screen capture if that's helpful.

Environment

  • OS: Linux steamdeck 5.13.0-valve36-1-neptune #1 SMP PREEMPT Mon, 19 Dec 2022 23:39:41 +0000 x86_64 GNU/Linux
  • OpenGL API 4.6 (Core Profile) Mesa 23.0.2 (git-4d5e73870e) - Compatibility - Using Device: AMD - AMD Custom GPU 0405 (vangogh, LLVM 15.0.7, DRM 3.45, 5.13.0-valve36-1-neptune)
  • Godot v4.0.2.stable.flathub [7a0977ce2]
  • Plugin version baeaba8 (godot4 branch)
  • Renderer used: not 100% sure - I'm using gl_compatibility in Godot and didn't change any default settings in the addon, so I guess OpenGL?
@Zylann
Copy link
Owner

Zylann commented May 29, 2023

Are you able to reproduce this with the Vulkan renderer? (the non-"compatibility" one?) From the logs, it could be that Godot is using a different format than the plugin is expecting for viewport textures.
I tested in Forward+ and it worked.
The fact you did not even get a script line in the error when running with godot -d is concerning... like, even with the command line debugger (if functional anymore...) Godot gives no info where the error happens in the plugin...

(Also, I don't have a steamdeck to reproduce this, in case it only occurs there)

@Zylann
Copy link
Owner

Zylann commented May 29, 2023

Apparently, in Forward+, the SubViewport created by the generator provides texture images as RGB8 (the expected format), but for some reason in Compatibility it returns RGBA8, even though the viewport isn't transparent... so the conversion routine has to be added back to make sure it ends up as RGB8. I don't know if that's expected or a Godot bug.

@Zylann
Copy link
Owner

Zylann commented May 29, 2023

Should be fixed in 5273707

@Zylann Zylann added the bug Something isn't working label May 29, 2023
@ian-h-chamberlain
Copy link
Author

@Zylann thanks! Confirmed I can apply the terrain now after using the latest version of the godot4 branch and Compatibility renderer. I think this issue can be closed. Cheers!

@Zylann Zylann closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants