Custom Texture Channel Packing - PBR Material


Just wondering if its possible to map texture channels to specific shader inputs. I am aware of the ORM map, but if you say wanted to pack the textures differently is it possible to remap them? I was looking through the API but couldn’t see a way to access the channels of a texture.

A custom shader would work I believe, but from I can see it may need a rewrite of the PBR implementation and how it handles each channel.

Is this the correct assumption to make?


Upon further reading and investigation I can see that the most optimal channels have been chosen in the PBRMetallicRoughnessMaterial, so I guess the need to pack textures differently isn’t really needed.

That said, I could see cases where you could in theory pack say a roughness texture into the blue channel of a normal map and reconstruct the blue channel within the shader. Maybe the node based shader editor will allow for this flexibility eventually?

Yes this is correct. A custom shader or the new Node Material :slight_smile:
How To use the Node Material - Babylon.js Documentation