Open nitanmarcel opened 5 months ago
Hey @nitanmarcel! I'll port the example over sometime soon. For now I have noticed a few issues. The first is rl.setShaderValue
expects the uniformType
to be a ShaderUniformDataType
not an i32. This can be fixed by converting it to an enum before using it in your function call (this can be done with @enumFromInt
)
The other issue is how you create your light. Based on the example they use a custom Light
struct. In your code you do not do this. You also aren't calling rl.beginMode3D
in your code (which they do in the example code).
I also get errors from how you choose to unload a bunch of stuff. This doesn't actually seem to be required and only adds more errors in my case (zig 0.12.0). So you only need to make sure to free transforms
.
One more thing. On the latest version of raylib-zig: raylib-math
and rlgl
are now rl.math
and rl.gl
. I'll be sure to message you once I try to port the example!
Hey @nitanmarcel! I'll port the example over sometime soon. For now I have noticed a few issues. The first is
rl.setShaderValue
expects theuniformType
to be aShaderUniformDataType
not an i32. This can be fixed by converting it to an enum before using it in your function call (this can be done with@enumFromInt
)The other issue is how you create your light. Based on the example they use a custom
Light
struct. In your code you do not do this. You also aren't callingrl.beginMode3D
in your code (which they do in the example code).I also get errors from how you choose to unload a bunch of stuff. This doesn't actually seem to be required and only adds more errors in my case (zig 0.12.0). So you only need to make sure to free
transforms
.One more thing. On the latest version of raylib-zig:
raylib-math
andrlgl
are nowrl.math
andrl.gl
. I'll be sure to message you once I try to port the example!
camera.begin() calls rl.beginMode3D.
rl.ShaderUniformDataType.shader_uniform_vec3
should have actually been c_uint (it's a cast because some methods don't accept yet structs/enums as their arguments unfortunately). You might be right also about the light, no idea if that's needed tho.
Ah nvm, the parameter for setShaderValue
has been already fixed. Anyway the code is before the latest versions xD
https://github.com/Not-Nik/raylib-zig/commit/674e5ada11c116e1eb0313c9121ba1d44797eab7
Can someone check shaders_mesh_instancing example works from zig? I have the following code based on the example above that should draw 10000 cubes at the center of the world, but it doesn't seem to work at all