Zylann/godot_heightmap_plugin

Can't Texture Paint

Closed this issue · 5 comments

Hi. Whenever I select a texture and attempt to paint it onto the terrain I get this error: res://addons/zylann.hterrain/tools/brush/terrain_painter.gd:304 - Assertion failed.

No Idea what to do, as I am new to this type of stuff and Godot in general

I have a RTX 3060, Windows 11 x64, and GLES 3 (I think, I don't know how to check). I also have godot 4.2.2.

Any help on this would be extremely appreciated.

Thanks!!!

Is that still happening if you restart the editor? Are there other things in the logs before this one? Did you try with the latest version on this repo?

As of latest, assuming you're hitting this by using the Texture Paint tool, that error prints to signify that painting was performed, but somehow it modified none of the maps, which is very likely a bug. That would happen if:

  • You're somehow using a brush mode that doesn't exist, which would be very weird (I dont know how you'd even do that), and in this case another error would also print before this one
  • The terrain reports no splatmaps being supported, therefore the plugin is unable to paint on it, which is unexpected. This can happen if:
    • The shader of the terrain failed to compile, which is also very unexpected because it compiles fine for me, and has been for a long time (and that would also print errors before the one you got, in addition to messing up the terrain's visuals)
    • The shader compiles but somehow Godot isn't reporting the correct shader parameters (uniforms) that it contains, which would be a Godot bug, but unlikely because that feature works AFAIK
    • The shader of the terrain doesn't contain any splatmap parameters, which is unexpected by the plugin. That would happen if you modified that shader, or even renamed those parameters. I doubt it though, but if you did you should indicate that
  • Some other weird edge case that I have no idea how to reproduce (and is why I'm asking for reproduction steps and minimal reproduction project in the issue template)

I can texture paint just fine when using the latest version in the repo (and I don't think anyone reported such an error with the older version on the assetlib, and it's been there a very long time) so for me as well it's also unclear what to do, because I don't see what could be different in your very specific case.

I downloaded the latest plugin version from the asset library built in to Godot. And no error messages are printed before I begin painting. In terms of the potential issues that you have listed, none of these were the case, and the error still appears after restarting the editor. Idk any other way to reproduce other than downloading the plugin from the assetlib, loading a texture, and attempting to paint the terrain. Don't know anything else. I will say I added on a custom shader and a custom globalmap shader at some point, realized it didn't work with the terrain, and removed it. Could've caused an issue but idk.

NVM. Found the issue!!! Turns out I set the shader mode to Low Poly instead of Classic4Lite. So It works!!!

I downloaded the latest plugin version from the asset library built in to Godot

Did you try with the repo version instead? Just trying to rule out a potential issue that has been fixed since, because I still have no idea what could possibly cause this.

Turns out I set the shader mode to Low Poly instead of Classic4Lite

Ah, that's probably a bug then, but it's also expected for painting to do nothing here because this shader doesn't support texture painting, forgot about that one. So the issue is rather that the issue is not reported clearly in the UI (and then the problem was in the list I wrote earlier: The shader of the terrain doesn't contain any splatmap parameters).

Ok. Anyways, thanks for the help.