Mapping of gLTF emissive texture

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
User avatar
spookyboo
Silver Sponsor
Silver Sponsor
Posts: 1141
Joined: Tue Jul 06, 2004 5:57 am
x 151
Contact:

Mapping of gLTF emissive texture

Post by spookyboo »

Does anybody know how a gLTF emissive texture maps to an Ogre Pbs material?
The emissive map controls the color and intensity of the light being emitted by the material. This texture contains RGB components in sRGB color space. If a fourth component (A) is present, it is ignored.
Not sure whether it is the same as PBSM_METALLIC. gLTF (without extensions) only supports metallic workflow. Maybe I have to 'apply' it offline to the baseColor (diffuse) texture or just ignore it for now.
User avatar
devxkh
Halfling
Posts: 84
Joined: Tue Aug 02, 2016 6:07 pm
Location: Germany
x 12

Re: Mapping of gLTF emissive texture

Post by devxkh »

good to know i'm not the only one playing around with gltf! :)

such a basic feature like emissive texture/factor should be supported per default and should be easy to set. No hacks. :?
My little OGRE engine -> FrankE WIP
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Mapping of gLTF emissive texture

Post by xrgo »

I agree
+1
upvote
like
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Mapping of gLTF emissive texture

Post by dark_sylinc »

The default Hlms PBS implementation doesn't support emissive, as it isn't very "PBS".

Emission means it creates light rather than absorving, which is what Unlit does.

However if there's enough demand for this feature I suppose I could reconsider it.
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Mapping of gLTF emissive texture

Post by xrgo »

yes please :P, I think Ogre's PBS default implementation should follow the industry "standards", so If everyone has it.. why don't we =D?!
besides.. its a really important feature, I use it a lot for example in a truck cabin some tiny buttons/panels/lights should emit... I can't use unlit because I can't separate tiny polygons so I can assign another datablock (there is no tiny polygons..) all the information is in the texture

thanks!!
User avatar
miki3d
Halfling
Posts: 56
Joined: Wed Jul 18, 2012 1:30 pm
Location: Italy
x 4

Re: Mapping of gLTF emissive texture

Post by miki3d »

+1
:D
Image
Co-Founder and Design Director at VaeVictis
Current project Racecraft
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: Mapping of gLTF emissive texture

Post by al2950 »

I have to admit I use a separate renderable for my emmisive bits, eg lights, and use an unlit texture. However it would make life easier for me if it was part of the PBS, and if its the direction/standard that industry follows we should probably follow suit.
User avatar
Zonder
Ogre Magi
Posts: 1168
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 73

Re: Mapping of gLTF emissive texture

Post by Zonder »

+1
There are 10 types of people in the world: Those who understand binary, and those who don't...
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: Mapping of gLTF emissive texture

Post by 123iamking »

xrgo wrote:yes please :P, I think Ogre's PBS default implementation should follow the industry "standards", so If everyone has it.. why don't we =D?!
I think following the standard is always the best idea, remember Firefox vs MS IE (Internet Explorer), Firefox did follow the standard and MS IE didn't - soon both web developers & web user hate MS IE (dev think it hard to develop and user think it slow).
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Mapping of gLTF emissive texture

Post by dark_sylinc »

Yesterday I added emissive materials to Ogre 2.2.

The pro: emissive colour!
The con: Normal detail maps no longer have separate offset and scale settings. They assume they're the same setting as the diffuse detail map.

This shouldn't be much of a con to most people. The main reason for this is that it was rarely needed (since often detail diffuse and normal map offset/scale are tied together) and maintaining 256 bytes per material in GPU is important for some cards (it's just faster, I guess it must be a bank conflict thing).

We're adopting Microsoft strategy to have new features in newer versions in order to force people to upgrade. Nah, just kidding. I will be porting these changes back to 2.1 today.
I just hope I don't piss off too many people with the removal of detail normal map's individual offset and scaling.
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Mapping of gLTF emissive texture

Post by xrgo »

dark_sylinc wrote: Sun Nov 19, 2017 5:30 pm emissive colour!
Yay! Thank you!
You could add an emissive sphere to the GI sample room, that would look awesome
dark_sylinc wrote: Sun Nov 19, 2017 5:30 pm I just hope I don't piss off too many people with the removal of detail normal map's individual offset and scaling.
It's fine for me :)

Thank you so much!
User avatar
spookyboo
Silver Sponsor
Silver Sponsor
Posts: 1141
Joined: Tue Jul 06, 2004 5:57 am
x 151
Contact:

Re: Mapping of gLTF emissive texture

Post by spookyboo »

Great!! :D :D
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Mapping of gLTF emissive texture

Post by dark_sylinc »

User avatar
devxkh
Halfling
Posts: 84
Joined: Tue Aug 02, 2016 6:07 pm
Location: Germany
x 12

Re: Mapping of gLTF emissive texture

Post by devxkh »

cool, thx for adding it. I'm the only one, getting a shader compile error?
OgreLog:GLSL compile log: 537002112PixelShader_ps
0(764) : error C1008: undefined variable "emissiveIdx"
My little OGRE engine -> FrankE WIP
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Mapping of gLTF emissive texture

Post by dark_sylinc »

devxkh wrote: Sun Nov 19, 2017 10:02 pm cool, thx for adding it. I'm the only one, getting a shader compile error?
OgreLog:GLSL compile log: 537002112PixelShader_ps
0(764) : error C1008: undefined variable "emissiveIdx"
Fixed. Sorry about that.
User avatar
devxkh
Halfling
Posts: 84
Joined: Tue Aug 02, 2016 6:07 pm
Location: Germany
x 12

Re: Mapping of gLTF emissive texture

Post by devxkh »

Thx! looks like emissive now! :D

Image

Next nice addition would be the texture channel selection. 8)
viewtopic.php?f=25&t=93570&p=539555#p539555
My little OGRE engine -> FrankE WIP
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Mapping of gLTF emissive texture

Post by xrgo »

devxkh wrote: Sun Nov 19, 2017 10:26 pm Thx! looks like emissive now! :D

Image
Looks amazing :)
devxkh wrote: Sun Nov 19, 2017 10:26 pm Next nice addition would be the texture channel selection.
viewtopic.php?f=25&t=93570&p=539555#p539555
Or at least the option to use the standard used by gltf
User avatar
spookyboo
Silver Sponsor
Silver Sponsor
Posts: 1141
Joined: Tue Jul 06, 2004 5:57 am
x 151
Contact:

Re: Mapping of gLTF emissive texture

Post by spookyboo »

Concerning Emissive: PbsAllSettings.json refers to the emissive 'value' as an integer, while setEmissive is a Vector3
Post Reply