PBR in Photoshop

Spent a couple of hours today testing out a PBR workflow using just photoshop.

The Model

I wanted to make something hard surface, but very simple and quick, so opted for a simple table.

MODEL

MODEL23

PBR In Photoshop

I used the values from this quixel chart, matching up median luminosity values to the ones in the chart. I used photoshop’s hypergraph to grab this information.

PBR Values

Here’s the albedo, reflective and metalness maps I made using this technique. The photo was grabbed from textures.com. In order to remove lighting information from the photo, I duplicated it, desaturated the duplicate, inverted it, then set its layer mode to soft light.

maps

(Thanks to this awesome tutorial! https://forums.unrealengine.com/showthread.php?52529-PBR-Tutorial-Series)

Material Set Up

I also made a detail normal map, which I added to the material using a DetailTexturing node, something new to me.

MATERIAL

End Result

I’m happy with the end result – its pretty boring as there’s not much you can do with a generic pine table – but I think the workflow turned out  well. My only gripe was that I couldn’t import multiple UV sets into Unreal, which meant in order to use AO I had to make all my UVs unique – not how I intended to set up my maps.

HighresScreenshot00002

HighresScreenshot00007

As a wee bonus – here’s the difference between this and a similar table I made for my first ever game project!

comparison

Maya Can’t Read (Exporter V0.1)

The script is still structured horribly, but I fixed my import issue. Turns out that the import command in maya only imports the first function it sees…useful! Instead I used the from command to force it to read all of my functions.

from Exporter import *
reload(Exporter)
Exporter.main()

Anyway, with that the first super simple version of this exporter is ready to go! It can be downloaded here. Instructions in the readme file, so give it a read!

Its untested, so there might be issues. If you have any problems, feel free to drop me a line at amystevens1@btinternet.com.

Screencap 3

Unreal Static Mesh Exporter Tool

Been a while since I posted on here! Seems like keeping up regular blogging is something I need to work on.

Recently, I’ve been working on an exporter tool for UE4. When I was working at Five Pixels, we had a few issues with artists being a little forgetful or being used to different engines, which led to some import problems and crashes that were time consuming and annoying. I wanted to create something that would alleviate issues like this, whilst also creating a tool that is probably pretty fundamental for my tech art education!

Screencap 2

Tool Design

The most important bits of functionality for this tool were using the correct FBX export settings for UE4, and moving the object to the origin. The placement of the object was one of our largest issues with importing at Five Pixels, as it was easy to forget, especially if you work with multiple assets in one maya file, and failing to correct it made level propping a nightmare – having your pivot miles from your object is not cool!

Export settings were a pretty easy one – I just grabbed the recommended settings from the UE4 Documentation (which is fantastically written – great resource for UE4 devs, if you’re not using it already). These settings turn on use of smoothing groups and smooth mesh, so you don’t lose any of that nice normals work. Most people will also turn on triangulate, but I’ve made this optional. There are three ways to triangulate a mesh for UE4; manually, on export and on import, and the topology of the model is going to determine which to use. Triangulating on export is generally the easiest method with the best results, so that is my default option.

The other option that the user is given is for a custom file path. Leaving this unticked will create the file with the same name and in the same place as the maya file. I was reluctant to include this option at first, as the idea of keeping a ridgid file structure is pretty appealing to me, but talking to others about their file structures reveled that a fair few people like to keep a separate folder for final exports.

On export, the tool moves the model to the origin, erases the history, and then undos these two actions. This is so that no data is lost from the maya file, and so that users are not inconvenienced by having to move their model back where they want it.

This is the very basic design – there are lots of other possibilities, like optional dummy nodes, generating collision meshes or working with material exports, but for now I’m keeping things simple.

Interesting Commands

I learned two very interesting bits of maya python with this script. These were use of mel commands and use of chunks in undo.

Accessing FBX settings seemed to be quite difficult with python, but a simple task in MEL, so I imported maya.mel and used the eval command to have my line evaluated in MEL and then converted to a python datatype.

maya.mel.eval("FBXExportSmoothingGroups -v true;")
maya.mel.eval("FBXExportSmoothMesh -v true;")

Using undo chunks made reverting erasing the history and moving the object to 0,0,0 very easy. I opened the chunk, performed some actions and then closed it. Everything inside of the chunk then acted as one undo step – a slightly more elegant solution than undo-ing five times.

cmds.undoInfo(openChunk = True)
pivot_to_origin()
maya.mel.eval("FBXExportSmoothingGroups -v true;")
maya.mel.eval("FBXExportSmoothMesh -v true;")
cmds.file(fbx_path, force=True, es=True, type="FBX export")
cmds.delete(constructionHistory = True)
cmds.undoInfo(closeChunk=True)
cmds.undo()

Script Structure

Structure was by far the most difficult part of this script. I’m still making changes to this, as my current solution is – for lack for a better word – totally gross, and may not work correctly when distributed.

The current issue is that in order to make the text box update with the new file name that the user chooses, the textfield has to be in the browse function. If its left in the UI function, it only updates when the window is first made. This doesn’t work however, as once it is in the browse function, the field being edited either needs to exist in the function, or be global. Another issue to add to this is that the parent window needs to exist in the same scope as the field. Right now, my whole UI has been moved into the global space, which is beyond bad. It works, but it is such bad practice and really limits how this tool can be edited.

But everything else is working well, so once this is fixed I can think about adding more functionality, support for skinned meshes and maybe other engine support.