Free Material Layer Editing Addon - Matlayer

I watched a few videos on the new BSDF in Blender 4, it does seem like IOR plays a big part now, however the add-on should work fine as is now regarding the new shader.

IOR Level in the new BSDF shader is actually named ‘Specular IOR Level’ internally and is comparable to the old specular value. When you export ‘specular’ maps with the current version of MatLayer, it will be exporting Specular IOR level as a texture in Blender 4.0 (I’ll double check this is working as intended when 4.0 officially comes out).

Subsurface Weight, exports as a texture when subsurface maps are exported using MatLayer.

With regards to the other IOR property (default 1.450) it’s a bit trickier to export as it’s outside the 0 - 1 range. Although it’s technically possible to remap the IOR value to a 0 - 1 range so it could be baked to a texture, it would require a custom shader in whatever software you import the baked texture into, making it pretty inefficient when comparing to just setting the variable in whatever shader you are using. From my understanding you shouldn’t need to touch the IOR for the majority of materials, with only glass, water, and ice being some exceptions. With this being the case it doesn’t make sense to have the ability to export this IOR value.

Lastly the subsurface radius value could be exported, but I’m not 100% sure what it’s really doing yet and I need to do some more research into that to fully understand if it’s something you would want to export. Initially it seems very specific to the BSDF shader in Blender as I haven’t seen that properly used elsewhere, which leads me to believe it’s not too important to be able to export. I may look into supporting even more advanced shaders in the future, but for now I’m focusing on supporting more simple PBR setups. If you really need this exported, it’s still possible to manually bake it out from the shader for those rare cases where this would be necessary.

I’ll be doing a bit more research and tinkering, so I may make some updates in the future. Please let me know if you have additional thoughts.

3 Likes

Updated the kanban so it’s accurate about what’s currently in development, and what issues are present in the version available on main - https://github.com/users/LoganFairbairn/projects/1/views/1

2 Likes

So what about if you are making an atlas texture? You would need an IOR map, right? Pls just add it here:


It’s just for those who need it. It doesn’t have to be a feature that everyone uses. I usually just multiply the texture with a Math node to keep it in 0-1 range: Using IOR vaules in a texture map? - #4 by DNorman

Subsurface radius value is basically Subsurface color in 4.0. You can plug in an rgb node and it works fine.

One of the things I loved about the Principled Baker addon:

is that all the slots of the Principled Shader can be baked out into a texture. Didn’t matter which one was used more. Its better to have more options than less because somebody may need to use those slots even though its not widely used.

It gives people the freedom to bake whatever they want to a texture from the principled shader. How you use the resulting baked out texture is up to you.

Hi, I’ll need to do a bit more research into this topic that I won’t be able to do for a while. I’ve made a ticket here - https://github.com/LoganFairbairn/matlayer/issues/130 you can follow to track this issue.

I do agree adding more baking options is ideal to allow users to bake out what they need to. After looking into this a bit more, I’ll add additional properties / channels to the exporting in MatLayer if appropriate.

1 Like

Thanks a lot :+1:

Hi again,

Took me a while, but I’ve added the ability to bake all material channels in the Blender 4.0 principled bsdf shader, which includes the ability to bake IOR (index of refraction).

When IOR is baked using MatLayer, it’s remapped automatically to between a 0 and 1 range. This allows the IOR values to bake properly to a texture. To use a baked IOR value in a different shader when re-imported, you multiply the IOR value by 4.

All of this is available on the main branch, right now but is still in testing mode so there might be bugs currently.

Cheers!

4 Likes

That’s really awesome. Thanks a ton :+1: :slightly_smiling_face: