Closed Pebaz closed 1 year ago
I have searched through the Raylib-Py source and as far as I can tell, all of the bindings are correctly structured. Functions that work are structured the exact same as the functions pertaining to this rendering bug. Not sure why a model using the same example code as Raylib-C would not show it's texture.
I will dig more into this. If you have thoughts on this please share them! 😄
Are your two builds of raylib using the same version? Maybe something was changed in the model drawing system to account for this.
Thanks for the idea!
I checked it out and found:
raylib_shared.dll
My best guess is that the Raylib 2.0 MSVC pre-compiled binary is somehow flawed if DllExportViewer cannot even see functions exposed within it.
I will try to compile Raylib on MSVC from source and see if I can get Python/DllExportViewer to see it.
-Sam
I compiled and tested the x64 MSVC version to to avail. Not sure where to go from here.
Hi, @Pebaz! Sorry for the delay, didn't have much time lately to answer.
Oh, I don't have enough knowledge on compilers, build systems and stuff like this, and I have no idea if this might be the cause but the dll shipped with raylib-py is a custom one. I built it in my computer to add a few extra draw functions, wich will be officially available in the 2.5 release.
@SolarLune Thanks for the info! It is always good to have people who know better around. :sweat_smile:
No worries!
Has anyone gotten this particular example (examples/models/models_heightmap.py
) to texture properly?
If someone has, maybe we can go from there (find out library, Python, and system architecture, what compiler, etc.).
Not sure but this issue seems related to library versions mixing... latest raylib manages texturing in a different way than raylib 2.0...
I just did some investigating. I traced the OpenGL calls of the program with the following line both commented and uncommented.
model.material.maps[MAP_DIFFUSE].texture = texture
I rendered it for a single frame and diffed the two traces, no difference.
So that line seems to have no effect on raylib's rendering whatsoever. Not sure how much this helps but it's more information.
Is there any version of raylib-py (or raylib dll) I can use that is able to texture models? I don't need the latest advanced features but not having textures is something of a showstopper to my game development.
@electronstudio I was not able to get any version of the DLL to work. As far as I am concerned, I cannot continue to use Raylib-Py without being able to texture a 3D model. If anyone has been able to get this example to work, it would be helpful to hear from them.
Good news: I got it working.
Bad news: I had to rewrite everything from scratch.
Will post it when I've cleaned up it.
Here: https://github.com/electronstudio/raylib-python-cffi
It works on my Mac and I've included the Mac binary but I don't have build systems setup for Windows and Linux.
Fantastic work!
Problem Statement:
examples/models/models_heightmap.py
shows that textures are not applied when rendering models.Raylib-C Equivalent Example (Shows darkened edges of the model due to texture used):
Raylib-Py Example of Issue (Shows that the model is completely red instead of using the texture):