raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
21.41k stars 2.17k forks source link

[rmodels] Support non-normalized GLTF vertex colors #3890

Closed ssoher closed 4 months ago

ssoher commented 5 months ago

Issue description

Blender exported gltf files have a different attribute format for vertex colors, thus they are not imported in Raylib. Instead a warning is given WARNING: MODEL: [./asset/cube.glb] Color attribute data format not supported.

Please use the attached archived glb file exported from Blender with default settings.

How it's supposed to look:

image gltf_cube_vertex_color.zip

raysan5 commented 4 months ago

Implemented support for all glTF supported color vertex attribute data (vec3/vec4, u8, u16, f32)

insomniacUNDERSCORElemon commented 1 month ago

@raysan5 is loading vertex colors broken still on .obj files or is there something extra that needs to be done?

It fails both with a material (displays gray) and no material (displays white), though I'd prefer no material if there was some way to make the default material load vertex colors properly (global glass/metal materials would be nice too, but that seems tricky).

ssoher commented 1 month ago

@raysan5 is loading vertex colors broken still on .obj files or is there something extra that needs to be done?

It fails both with a material (displays gray) and no material (displays white), though I'd prefer no material if there was some way to make the default material load vertex colors properly (global glass/metal materials would be nice too, but that seems tricky).

obj specification does not include vertex colors, there are some obj flavors that support the vc tag but it's not a part of the standard, you'd be better off using a file format that includes it.

insomniacUNDERSCORElemon commented 1 month ago

The exports definitely have vertex color, but alright. The main reason I didn't want to use GLTF was the lack of scale factor in the Blender export that the OBJ exporter offers.