mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.6K
active users

Nikita Lisitsa

Apparently Blender .obj importing is a bit broken for emissive objects: it imports a [10,10,10] emission value as raw color (which should be in 0..1), while leaving the emission strength at zero (meaning the object does not, in fact, emit anything)

@lisyarus is this about emission per surface area vs emission per full area conversion maybe?

@breakin Hmm, I've never seen anybody use the latter!

Anyway, it doesn't look like that in this case either.

@lisyarus some older modeling software had you set the intensity and then if you scaled the lightsource it spread it out so it became softer, not stronger. Just a random guess! Maybe more applicable to area lights.

@lisyarus Makes sense! Converting between material systems is a lossy and sometimes not fun exercise but good if it becomes better!.

@breakin @lisyarus I spotted the same issue in my own code ( avoyd.com/ ) yesterday when I added support for emissive factors > 1.0 in my non-texture based export pipeline for .obj. Many thanks for submitting an issue (you beat me to it)!

As you found, using a texture map for emission fixes this, and that's the main approach I use to export material parameters, but it's harder to edit so I still keep this option available.

avoyd.comAvoyd Voxel Editor and RendererAvoyd Voxel Editor and Renderer - Create, import, export and render large voxel worlds - 3D art and rendering tool for voxel artists, map builders, and game developers

@breakin @lisyarus As a work around I'm contemplating adding a option to my glTF exporter (based on github.com/syoyo/tinygltf/blob) to produce separate materials instead of indexed texture parameters. The glTF importer in Blender seems to work pretty well.

@dougbinks @breakin Yeah, I'm writing a glTF exporter right now for the same reason 😅

@lisyarus @breakin FYI somehow the link in the last post was wrong (bad copy), corrected now. glTF is pretty easy to write once you know it, so don't really need a library but I found it handy to help.

Did you consider exporting to .vox? If so you can render in MV or my Avoyd, though these likely aren't as ground truth as Blender, they both do volumes well and should be unbiased.

@dougbinks @breakin Yep, writing glTF is a bit verbose but basically you just follow the spec and fill out a straightforward JSON file.

I'm considering .vox, but afaik you can't really have different materials for voxels (i.e. diffuse/emissive), only colors? I can add a custom .vox chunk with material data, but it won't be interpreted by other software...

@lisyarus @breakin You can have material properties rather than just colour, these are explained in the reference github.com/ephtracy/voxel-mode though there are some gotchas so I would refer to github.com/jpaver/opengametool which has the material parameters decoded somewhat.

There's also some discussion in the issues, and I can help if you need.

@dougbinks @breakin Ohh, thank you! I didn't find this spec previously, googling "vox file format" typically gives some garbage as output :(

@lisyarus @breakin There are a few of us using the ogt_vox.h lib, I think it's the most fully featured library available, and due to some of the gotchas I'd advise using it if you want to read .vox files. Writing them is a bit easier if you stick to a subset of the features.

@lisyarus @dougbinks @breakin out of curiosity, is there any kind of agreement what color space the mtl quantities are in? is emissive linear? are Kd/Ka linear? what about textures that don't advertise their color space?

(we're currently doing lightmap baking with user-provided .objs that are usually emitted from some adobe/autodesk product and I've been struggling to get the full-pipeline srgb story straight...)

@artificialmind @lisyarus @breakin I think colour values are linear but textures are expected to be sRGB.

@artificialmind @dougbinks @breakin I also wondered about this and sadly I didn't find a satisfying anwer. MTL itself doesn't seem to document that :(

Based on what Blender exporting/importing does, it seems that all these colors are linear RGB.

@lisyarus @artificialmind @dougbinks @breakin If you look in the OpenGL 1.x spec, it’ll give you the formulas for using them. OpenGL is based on the SGI library that MTL is from.

@lisyarus open source is really nice when it's working correctly