Traditional Textures To PBR in nutshell

We all seen it, we have an old project using old textures where is implemented specular color. But what if we want to upgrade our project into more modern PBR (Physically Based Rendering) model? For example, I have an old model that was meant to be in my UDK project, it used textures like any normal model, Diffuse, Specular Color, Glossiness, Emisive, Normal Map, and masks. Now I wanted to remade my work into Unreal Engine 4. Most of the textures works fine, but the only problem is reflections.

In sake of this post, I will use Grex model from Xenoblade X.

Original textures:

grex_ds.png

3ds Max render: (notice yellow warp on its head shied, this is specular color)

grex_spec3dstd.gif

First thing is, UE4 does not support specular color scheme and glossiness. Glossiness can be solved by inverting it and it’s acting like Roughness, whinch is fine. But Specular Color is different piece of cake, I can determine metal pieces, but when I plug them in Metalic node, albedo get much darker, whinch I don’t like. Most possible would be  just recreate whole texture set, but what if I have more models using traditional scheme? It would be extremely time consuming to recreate every texture set for every model, especially when you have 100+ of them. So I had to look somewhere else.

Unreal Engine 4 grex_ue4_cls_mat.pngfast scratched Metallic workaround:

 

 

 

 

 

 

 

 

Result on model: (No specular color)

grex_ue4_cls_ren

UE 4 have this little material function called ConvertFromDiffSpec, where you just plug in diffuse and specular color and it will convert it to PBR scheme with Diffuse, Specular and Metallic on runtime. But there is main big problem. Calling this function is extremly expensive and it will eat 10 more pixel instructions, whinch is pretty much big deal, its performace eating good for nothing, I could use those 10 instructions somewhere else, right?

Function Implementation:

grex_ue4_func_mat.png

And yellow warp is back on its place:

grex_ue4_func_ren.png

So I started to look somewhere else for solution. Those textures can be baked directly outside, so we can take back those 10 instructions and save process right?

GIMP Plugin

Since I don’t own Photoshop and I’m used to GIMP interface and scripting, I saw no problem to recreate function as script.

Usage

You can run it from Easy Stuff/Spec Color to PBR

You will need 2 layers, one for diffuse and one for specular color

Both layers must have same dimensions.

Both layers mush have removed alpha channel.

Specular layer mush have _s. or _spec. or _spm. in its name, otherwise script will not find it and exit itself.

Once you’ll start script, you will be left with Roughness, Metalness and one more layer, that is Diffuse. You can compose Metalness and Rougness into one image.

Here is sample result:

grexres.png

And here is how it looks in game.

Material: (You can use Roughness texture as Specular too, you just need invert it)

grex_ue4_gplug_mat.png

And on model:grex_ue4_gplug_ren.png

As you can see, they are almost same, whinch is what I wanted to achieve. So not only we have improved pixel instructions, but we also have one more free channel (blue in this case) in our texture, we can use it for Emissive Color for example.

Installation

Copy es_speculardiff_to_pbr.py into %Gimp install folder%\lib\gimp\2.0\plug-ins\, thats all.

Current Version: BETA 4

Changelog

BETA 2

  • Script will not execute if one of layers have applied alpha channel, preventing fatal damage to both images and their alpha channels.

BETA 3

  • Tweaked script for better results

BETA 4

  • Added Specular layer in case user wants to use it.

 

Download

Advertisements

2 thoughts on “Traditional Textures To PBR in nutshell

    1. Converting between PBR and Traditional scheme is very complicated, if you’re an artist you don’t need conversion at all. You just pick scheme whinchever you want and stick with it. I think PBR is much more easy to manage. This tool is not ment to be for correct conversion, the best one is always from scratch.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s