Lightmap from Metallic map (feature request)

Hi guys, hugs @Deltakosh / @trevordev, you guys still rock !

I am getting hardcore into scene optimizations and was wondering if its possible to request a lightmap channel mapping to one of the channels of the PBR texture set, exactly like we currently have material.useAmbientOcclusionFromMetallicTextureRed, but material.useLightMapFromMetallicTextureRed.

Not sure how easy it is to implement, just throwing it out there,

Thanks !

So I understand you’re using lightmaps not as shadowmap?

If so - sorry this will be a little off topic… - can you explain a bit about what is your lightmap workflow? (on my side, until now, I always used lightmaps - direct & indirect lighting combined - using useLightmapAsShadowmap on, and I don’t really see how to render lightmaps with this mode off, hence my question :slight_smile: )

pinging @sebavan (please be patient he is oof until next week)

1 Like

Pretty much the same thing, except I don’t always bake indirect.

Since AO is already a part of the lightmap/shadowmap material.useAmbientOcclusionFromMetallicTextureRed feature is wasted and it’d be nice to have fewer textures in the project with material.useLightMapFromMetallicTextureRed

Thanks @Deltakosh !

Not sure it makes sense cause you would have only one channel for your light map, the red.

They often use colors, are associated to a different uv set and even different wrapping repeat modes.

Also as it represents light info HDR is clearly a huge plus on lightmaps.

I wonder if this would not be better as a custom modification or done through the node material ???

Sure, it would be limited to b&w and lightmaps with indirect light baked into them would not work correctly, but it would still be a nice addition.

Unless of course it would not be possible to route this to a second UV like you currently can, then it would indeed be pretty pointless.

As we are trying to only do a single fetch (packing perf reason) we won t be able to use different uv sets here else we would anyway fetch twice.

Nevertheless it would reduce memory usage which is on its own a good thing even with two fetches.

Could you use a custom PBR material to do that ? @nasimiasl and others added some special code to customize parts of the shader. I am trying to limit adding to many configuration as the material is already huge and I would prefer to allow external extensibility than supporting every single use case behind flags.

1 Like

we most focus on nodeMaterial for fix all this parts