3

I have a very simple monocolor icon for AR that needs to emit light. How can I edit the MTL file to make it do so?

This is what I made so far but is not glowing.

newmtl #63c7b2
Kd 0.3058824 0.8470588 0.5921569
Ka 0.3882 0.780 0.6980
Ke 17 12 4
illum 2

enter image description here

Community
  • 1
  • 1
M_Maria
  • 93
  • 1
  • 8

2 Answers2

2

Even though this post is over 2 years old, it's sad it only received one wrong answer, adding this question to the billions of unanswered (or incorrectly answered) questions littering the internet. So, here's the answer to it finally to get one more unanswered question off the internet.

Emission is handled by rendering of whatever software you use to render the OBJ, just like how the software is responsible for applying the normal map.

To respond to that bluntly wrong answer above that said "MTL files offer no form of emission support and Ke is not a valid keyword", I will paraphrase Luke Skywalker: "Everything part of what you just said is wrong."

-There is an "map_Ke" keyword, although un-official like most of MTL's keywords, and MTL's do offer emission support, the software that processes the MTL file (and OBJ) just has to support it also.

example: map_Ke texture.png

or even

map_Ke -s 1 1 1 -o 0 0 0 -mm 0 1 texture.png

So basically, you can have emissions in OBJ's but the 3D software you use that loads the OBJ and MTL has to know how to apply emissions. Most 3D software can apply emissions but not many expect emission data from an OBJ file so they don't look for or process it. So solution to this question is "use 3D software that can fully process an OBJ file with emissions". Admittedly that will be hard to find.

There's probably a few out there, the old "Honorsoft OBJ Importer" does, but it's been made private.

-Maybe try Blender? Here's proof (from other people) of what I said already though:

OBJ Material using emissions

-To any still saying that emissions in OBJ aren't officially supported, that's not true. Emissions are supported and have been given a specific Ke. What people have to understand is it's not the format that is not supporting emissions, it's the 3D software you're using to process the OBJ that doesn't support emissions, or at least doesn't bother to process them from OBJ's. I have used and made OBJ software that supports emissions and can even process rig data, just like in DAE.

-Like I said, most statements in OBJ are unofficial, but that's just because the developers of Wavefront don't care much about it anymore and don't bother to update the "official" docs. ...and software that doesn't support a simple emission line is like making a video-player that doesn't support audio.

  • 1
    The only comment I would add to this answer is that `Ke` and `map_Ke` are not official/original statements in the MTL file format defined by Wavefront, but later additions. That is probably the reason why not every piece of software supports it. Still, `Ke` and `map_Ke` are widely used for emission colour/texture in MTL files. – Slav Jan 12 '22 at 11:22
  • @Slav are there any addition to accommodate metallic texture maps? I can't seem to find anything to help with this online.. – iby.helmy Feb 21 '22 at 20:18
  • 1
    @iby.helmy Unofficial `Pm` and `map_Pm` are for metalness. Unofficial `Pr` and `map_Pr` are for roughness. Standard `Ns` and `map_Ns` are actually for specular exponent. – Slav Feb 23 '22 at 10:35
-1

MTL files offer no official form of emission support and thus Ke is not a valid keyword, although some applications will unofficially understand it, and proposals for its extension have been made.

If you have the freedom to do so, switching to a software that understands it, or, preferably, another format that supports emission, might fix this issue for you. If not, the best you can do is use illum 0 to make it so that the material isn't affected by lighting.

Source1 / Source2

TUTAMKHAMON
  • 600
  • 3
  • 9