Hello dear Nim community,
I'm getting started with Nim after realizing that gdscript is way too slow and
C++ way too complicated in many situations.
I'm having the following issue:
In gdscript I write:
var mat = get_surface_material(0)
var tex = ImageTexture.new()
tex.create_from_image(image)
mat.set_shader_param("texture_map", tex)
Run
where the material has a custom shader with a uniform sampler2D texture_map;.
Doing the same in nim:
var mat: ShaderMaterial = getSurfaceMaterial(0) as ShaderMaterial
var texture = gdnew[ImageTexture]()
texture.createFromImage(image)
mat.setShaderParam("texture_map", texture)
Run
Gives me an error about texture not being Variant. It doesn't work with texture
as Variant, but maybe I missed something? Also, I'm not sure if the as
ShaderMaterial works as hoped. Unfortunately a clear documentation on how to
use materials is ... not existent?