planetis-m / naylib

Yet another raylib Nim wrapper
MIT License
233 stars 10 forks source link

Vertex colors? #108

Closed insomniacUNDERSCORElemon closed 4 months ago

insomniacUNDERSCORElemon commented 7 months ago

From what I gather this is an issue with Raylib itself and code exists to read+display vertex colors from 3D models but between the language difference and time (plus my place at square 0 and no other reliable place to ask, particularly specific to Naylib) it is beyond me.

For some background, I generally want my art without textures (vertex color only).

Example:

planter_low

but in the model display example yaw_pitch_roll.nim I swap my model in (~manually scaled up by x100, exported to .glb~ exported to .obj) and get this:

Screenshot_2024-04-16_19-32-02

EDIT: I just noticed this too for the .glb Color attribute data format not supported. Using .obj does not give this message but still does not have color (though the scaling during exporting actually gives a normal size unlike the .glb export). Exporting without a material makes no difference other than making it white rather than gray.

Also my exports do have vertex colors, visible by importing into Godot 3.X or re-importing back into Blender.

I don't want every object using a unique material (this is something to note with Godot and vertex colors), though it would be nice to have the ability to have objects that contain a matte and reflective material (and maybe glass too). Unshaded is not out of the question, 1 material only (+vertex lighting) is a step better.

Note: I am on Kbin, I often seem to have federation issues just talking about Nim (also for the threads I posted w/the art itself and asking questions), I'm not sure if there's somewhere better on the fediverse that might be more conducive for discussion of things like this. Forgive me if this is out-of-place.

planetis-m commented 7 months ago

Sorry I can't answer the question, but you can ask at the raylib discord, probably the feature request channel.

insomniacUNDERSCORElemon commented 7 months ago

Sorry I can't answer the question, but you can ask at the raylib discord, probably the feature request channel.

I do not use Discord.

That and I would expect this to not work out directly when it comes to Nim/Naylib. It would probably be more likely if someone who understands both C and Nim could convert the code others have posted (assuming it can work here, and that it isn't too outdated).

EDIT: Although maybe it should just be working? I see https://github.com/raysan5/raylib/pull/1790 but I am not sure if it needed additional code to work. ~But I did see the color format error with .glb, too~ ( https://github.com/raysan5/raylib/issues/3890 ).

planetis-m commented 7 months ago

I should clarify I am not knowledgeable enough to answer your question. But if you use https://chat.lmsys.org/ (opus is the best one with less rate-limit exceeded errors) you can translate your code to any language. And then maybe create a new raylib issue, if that's what it is or get some help in the nim matrix server.

insomniacUNDERSCORElemon commented 4 months ago

This is working now at least for .glb

Meta note I had some trouble earlier with updating, I guess you need to uninstall before installing again to properly update.