vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.05k stars 87 forks source link

VOXEDIT: Can't get vertex colors working on UE5 #294

Closed jerobarraco closed 10 months ago

jerobarraco commented 1 year ago

i've exported some gltf assets into ue5 and i can't get the colors to show.

In the unreal mesh viewer the vertex colors shows as white. and using the same material i used for other gltfs it also shows as white.

apparently the colors are being exported.

is there any hindsight i can get from the format and values of these colors?

mgerhardy commented 1 year ago

does it work when you export with uv map and textures?

mgerhardy commented 1 year ago

also, do you need animations or something other more advanced, otherwise you can also try to import obj. just to see if vertex colors are working at all as they should in ue5. I don't have the ue5 editor running atm - I will compile it asap and try to be of better help here.

jerobarraco commented 1 year ago

I don't need animations for now so i will try objs. I will try better tomorrow.

does it work when you export with uv map and textures?

i haven't tried. but i also want to stay away from textures so it's not a solution for me. but i will try it anyway to narrow down the issue.

I will compile it asap and try to be of better help here.

I truly appreciate it, you might not need to compile the engine. just download the binary version with the epic games lancher, or if you use linux there's the EpicAssetsManager https://flathub.org/apps/io.github.achetagames.epic_asset_manager

mgerhardy commented 1 year ago

It's 21GB - and I don't have that much free space on my hard drive to install this atm.

mgerhardy commented 1 year ago

https://www.reddit.com/r/unrealengine/comments/eupiv5/vertex_colors_not_importing_from_blender/

Worth noting; Unreal import defaults to Ignoring vertex colors when reimporting models. It’s important to select ‘Replace’ if you’re reimporting, to prevent your models from losing data in the process. It’s in General Import Settings somewhere

jerobarraco commented 1 year ago

I've already checked that. thanks. :) but still not importing them. My assumption is that is something to do with the range or the format (eg using ints instead of floats or something like that). i also tried converting to and from srgb.

jerobarraco commented 1 year ago

btw, if you want to download a smaller version in the epic installer when installer if you click Options when selecting the folder you can remove a bunch of unnecessary stuff. (all of it).

jerobarraco commented 1 year ago

i can import obj assets into ue but the colors still doesn't work.

mgerhardy commented 1 year ago

vertex colors for obj is an "extension" (or abuse of the standard) - looks like unreal doesn't support it.

you could still export the colors as png file - it's just about 256 rgba colors - you can even put them into your unreal code and just use the uv data to colorize the mesh.

jerobarraco commented 11 months ago

Thanks, i know, but what i'm trying to avoid is sampling the texture, also that would mean i have to use uvs. and possibly its going to be different uvs for different models. i work with several different files. ive noticed that when exporting using textures vengi only exports the used colors, and since those differ from model to model i would need to set up a material for each, which im trying to avoid.

i tried several things but still this doesn't work. vertex colors on ue do work. when i use goxel for example they work correctly. i have reasons to believe that voxedit is not exporting the colors. if i export a gltf using vertex colors, but with uv disabled test vengigltf.gltf.txt , then load the same gltf to vengi, it doesn't display any color everything is white. so not even vengi can load it.

this si the sample gnome, exported using one of the last appimage nightly. "voxedit-1420360" test vengigltf.gltf.txt

mgerhardy commented 11 months ago

If it is float color related - i might have a compatibility fix in latest master.

The cvar voxformat_colorasfloat can be set to false to use bytes for the color.

vengi-voxconvert --input input.vox --output output.gltf -set voxformat_colorasfloat false

for voxedit the option is in the file dialog

Bildschirmfoto vom 2023-07-31 13-15-38

mgerhardy commented 11 months ago

Please let me know whether the latest changes regarding the color type fixes the issue for unreal being able to import the colors properly.

mgerhardy commented 10 months ago

Closing the ticket for now - I have no way to validate the fix. If it's still an issue, please reopen the ticket.

jerobarraco commented 10 months ago

thanks, i could not confirm this working yet since i cant import the mesh. https://github.com/mgerhardy/vengi/issues/295#issuecomment-1672441458 i will open a new ticket for that when i have time.