You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ TECNICALLY YES] I tested it on latest raylib version from master branch
Issue description
I was experimenting a bit with GenMeshHeightmap and noticed that it simply refused to work for Images with the pixelformat PIXELFORMAT_UNCOMPRESSED_R32. Long story short, I tracked it down:
LoadImageDataNormalized in rtextures.c is broken for both PIXELFORMAT_UNCOMPRESSED_R32 and PIXELFORMAT_UNCOMPRESSED_R16 due to k not being incremented for each pixel. See snippet below:
I made these changes to the source of raylib 5.0* and tested it with my own little raylib project. It seemed to produce the result I expected. However, with the latest version of raylib (master), I was unable to get my program to run even without the changes. My program would segfault when calling DrawMesh. I don't know what that is about. I'll leave that one for someone else to figure out.
I might make a pull request if I can make the latest version of raylib work, but if anyone else is tempted to do so before me please go ahead.
* I also had fix LoadImageColors, which had the same problem. It seems to be fixed in the latest version (master).
The text was updated successfully, but these errors were encountered:
henrikglass
changed the title
[rtextures] LoadImageDataNormalized broken for some pixelformats due to missing increment of k
[rtextures] LoadImageDataNormalized broken for some pixel formats due to missing increment
Jan 29, 2025
I did a very quick test. 53ea275 still causes my program to crash. I'm about to leave my computer, but I'll see if I can reproduce the problem later on a different machine, and, if so, produce a minimal example.
raysan5
changed the title
[rtextures] LoadImageDataNormalized broken for some pixel formats due to missing increment
[rtextures] LoadImageDataNormalized() broken for some pixel formats due to missing increment
Jan 30, 2025
Issue description
I was experimenting a bit with
GenMeshHeightmap
and noticed that it simply refused to work for Images with the pixelformatPIXELFORMAT_UNCOMPRESSED_R32
. Long story short, I tracked it down:LoadImageDataNormalized
inrtextures.c
is broken for bothPIXELFORMAT_UNCOMPRESSED_R32
andPIXELFORMAT_UNCOMPRESSED_R16
due tok
not being incremented for each pixel. See snippet below:This should be:
I made these changes to the source of raylib 5.0* and tested it with my own little raylib project. It seemed to produce the result I expected. However, with the latest version of raylib (master), I was unable to get my program to run even without the changes. My program would segfault when calling
DrawMesh
. I don't know what that is about. I'll leave that one for someone else to figure out.I might make a pull request if I can make the latest version of raylib work, but if anyone else is tempted to do so before me please go ahead.
* I also had fix
LoadImageColors
, which had the same problem. It seems to be fixed in the latest version (master).The text was updated successfully, but these errors were encountered: