Website powered by

How to create an Atlas of various textured assets with a non-destructive workflow

Tutorial / 26 November 2022

Hi everyone,

I would like to share with you a worfklow that i developed to create a texture atlas from textured props in a non-destructive way. The method presented can be easily adapted according to the 3d software (3dsmax, Blender...) and their available tools. 

Autodesk Maya and Substance Painter will be use for the demonstration.

When working on real time environments and props, optimization is an important part so you need to reduce the number of textures, materials, ... used. Really useful to reduce draw calls, an atlas texture map is a single texture that can contain multiple textures for multiple asset.

-----------------------------------

1. Ressources

I selected four different 3d assets made by Dekogon Studios on the Unreal Engine Marketplace. Source:  Dekogon Studios / Construction Site VOL. 2 - Tools, Parts, and Machine Props . 

Why these one? 

  • They are free and i know Dekogon Studios creating high quality assets

The main goal?

  • Get a final atlas texture map set 2048 pixels with a maximum texture size of 1024 pixels per asset
  • Get one material with unique textures maps shared across each of the selected 3d assets

After exported assets and textures from Unreal Engine, for each of them we have :

  • Base Color/Diffuse, Roughness, Metallic and Normal (OpenGL)  textures maps  
  • Texture sets 2048 pixels
  • UVs unwrapped into the 0,1 UV space

Note:
Dekogon Studios assets use packed texture for the roughness, mettalic and ambient occlusion map like _RMA ( Roughness= Red channel, Metallic= Green channel, Ambient Occlusion=Blue channel). I used Photoshop to extract the stored R,G,B channel data from the _RMA texture and get a Roughness map and a Metallic map.

--------------------------------------------------------------

2. Planning the Atlas map

Planning an atlas map is the most important part of the process, this will be your main reference to keep in mind for all next steps and will determine exactly where each asset will be placed in the final atlas (also you can draw a table on sheet of paper writing the asset name in the respective cell). Sometimes you'll be working with more assets, so make sure you're well organized.

As you know a 2048*2048 texture map can fill up with 4x 1024*1024, 16x 512*512, 64x 256*256 etc. 


Thus, from the upper left corner to the lower right corner, we define an order of filling our atlas. Keep the following in mind during the process


previz of our desired atlas

--------------------------------------------------------------

3. Atlasing UV Sets in Maya

Import your meshes in Maya and position them in an organized way . The first is on the left , then the second on its right etc.


viewport of Maya with imported props

Select the first mesh (ElectricDrill_01a) and open the UV Editor & the UV Toolkit windows. Unwrapped UVs of the selected mesh are displayed in the UV Editor window, select all UVs shells then we will focus on the Transform panel of the UV Toolkit

3.1. Configure the Transform panel

UVs Shells are selected and contained in the UVs area.
We are going to position the pivot point of the selected UVs shells on the lower left corner of our UV Area at coordinates 0,0 then apply a downscale of 0.5 (equivalent of 50% ) of our selection and move it with a value of 0.5 (a half of the UV area).


visual of the selected UVs Shells and Transform settings of the UV Toolkit

  1. Select UV Area
  2. Choose the position of the Pivot , the circle on the bottom left corner
  3. Set up the step of move at 0.5
  4. Set up the Scale at 0.5  if value <1 then Maya apply a reduce

The pivot of the selection is now at coordinate 0,0 of the UV Area.


pivot point transformation result

3.2. Reduce and move the selection


Result of the reduce and move action
  1. Click on the Scale button to apply the scale change ( be sure U, V are selected , blue cases)
  2. Click on the Up arrow of the Move panel (you can also use directional keys of your keyboard)

The UVs of the ElectricDrill_01a mesh are now at the place defined in our atlas. Without applying any changes to our values set in the Transform panel, simply repeat the previous steps for the remaining assets, taking care to respect the atlas planed. 


Final result of the UV Atlas

Before exporting, Apply a common material on all selected meshes and rename it (ex: M_atlas_ConstructionTools), doing this will define our unique Texture Set in Substance painter. Now export meshes and go to Substance Painter.

--------------------------------------------------------------------------------------------

4. Atlasing Textured in Substance Painter

4.1 Set up Layers

Start a new project using PBR - Metallic  Roughness Alpha-blend (starter _assets) template, choose 2048 as Document Resolution and import your mesh.

Viewport from Substance Painter

  • In the TEXTURE SET LIST tab, we find our common material M_atlas_ConstructionTools
  • In the LAYERS tab, it is strongly advised to create and name a folder for each corresponding mesh (001_ElectricDrill_01a, 002_JackHammer_01a, etc. ) , you can also assign a color to differentiate them.
  • To isolate the mesh that we are working on, we are going to add a black mask on each folder in which we are going to paint a mask only on the corresponding asset (see example above with the ElectricDrill_01a). Then we add a Fill Layer on which we will place our textures maps (001_InputsTextures_01a, 002_InputsTextures_01a). 


4.2. Using UV Transformations

From experience, you should proceed asset by asset whether when importing textures or integrating and transforming textures in Substance Painter.

Import ressources window from Subtance Painter



Main viewport from Subtance Painter
  1. windows ASSETS, here you will find textures map imported
  2. windows LAYERS, select the fill layer 001_ElectricDrill_01a
  3. windows PROPRETIES - FILL / MATERIAL, activate the necessary inputs (Base Color, Roughness, Metallic, Normal) and drag and drop textures imported to they relativ inputs

Currently our Fill layer Texture has a ratio of 1:1 , with UV transformations values by default.


Coordinates of the transformation cages

On the image above, coordinates of the different points forming the UV transformation cage of the fill layer (00_ElectricDrill_01a) . The pivot/origin point is in the center.


4.3. UV Transformations

To correctly position our pivot point during the transformation, it must be positioned at the X,Y coordinates equivalent to -0.25,0.25 . We are going to modify the Offset value in X and Y. In a second step, it will be necessary to apply a transformation at the UV scale, this will be done by modifying Tiling values. Since we want to achieve a 50% downscale, this is equivalent to repeating the texture by 2 (Tiling value).

  1. Change the Offset value in X to -0.25 and in Y to 0.25
  2. Change Tiling value to 2

Our input texture maps of the ElectricDrill_01a mesh are now perfectly aligned with its UVs. 


The same process will be applied to the other remaining props in their own respective folder created earlier, taking care to assign the correct Offset values according to the atlasing plan established

Final preview of texture atlasing in Substance Painter

With this substance painter project, you will be able to export textures maps in any package desired.

Thanks for reading this far, and please let me know if you try it what you think and more.

Report

How to Optimise Your Substance Painter Project

Tutorial / 03 February 2020

Hi there, I would like to share with you this great article by Felipe Vimeney.
https://discover.therookies.co/2019/08/23/how-to-optimise-your-substance-painter-project/

Report

Is there LookDev Artist who want to practise? (Educational purpose only)

Tutorial / 18 July 2019

Hi folks,

For those who are interested about LookDev, I took time unwrapping UVs of the free model "Ngun" done and shared by JM Linares.
I would like to share with you the mesh with UVs done, so if you are interested, please feel free to contact  me and I will send it to you .

Why?  I did it for practising UVs and now I would like to help people who want to improve their skills, focusing  only on the look dev part. Modeling, Unwrapping UVs take time so now enjoy it!

It's FREE ! Just Don't forget to credit artists.


Concept Artist: Heng Z  https://www.artstation.com/artwork/zKwdZ           Modeler Artist : JM Linares  https://jmlinares.com/

Here is the free model with no UV  by JM Linares : https://jmlinares.com/education/


Texel Density is uniform


Oriented UVs shells and split by color and block


One color per "block", Outliner and Layers organized in the same way.

Report

How to transfer UVs from one object to multiple similar objects in MAYA

Tutorial / 04 February 2019

Keeping in mind to save time and get more productivity I would like to share it with you

The first part of this tutorial comes from Nestor Prado, in the second part I am going to show you how to create a custom shelf button and  its customized icon in MAYA.

Here is the link from the original post by Nestor Prado:  http://nestorprado.tumblr.com/post/30271496202/multiple-uvs-maya

" One thing I found is that having a lot of repeated objects (for example buttons) transfering the UVs from one to the other was easy enough. Just go to Mesh > Transfer Attributes > Option Box and with the default options just change Sample space to Component in the Attribute Settings Tab and your set to go." Nestor Prado


"The problem comes when you have a million objects. You can’t do it in one go… You have to go object by object and do the same steps over and over again. " Nestor Prado

"Luckily with the magic of python I wrote this trivial script that will do this for you. Just select the first object that has the correct UVs an then select all the other ones that you want to transfer the UVs to. "  Nestor Prado

You’ll turn this:

into this: 


CREATE YOUR CUSTOM SHELF BUTTON


In the script editor you will need to clear the history or clear all. Edit > Clear All This gives you a clean area to work with and there will be no script present when you go to make your custom button.



Copy / Past the script wrote by Nestor Prado and put it into the script editor "Python".

import maya.cmds as cm

#grab all the selected objects

selectedObjects = cm.ls(sl=True)

#save first one into variable

#pop first one out of the selected objects list

driver = selectedObjects.pop(0)

#for each object in the selected objects list

for object in selectedObjects:

    cm.select([driver,object])

    #transfer attributes

    cm.transferAttributes(sampleSpace=4,transferUVs=2, transferColors=2 )


Highlight the script that you just put into the script editor, Middle mouse button click on the script and drag the code onto the shelf module and release the middle mouse button.



This will create the standard Python icon in the shelf for that script. Now all that you need to do to run the script is click that icon in the shelf. 

Right click on our new button and click Edit Popup that will open the Shelf Editor
In the Shelves section we are going to define some specific information for our button.

       Icon Name           

Displays the name of the current image assigned as the selected shelf item’s icon. You can choose an image for an icon by clicking the folder icon next to the Icon Name field and navigating to the file you want to use. Alternatively, you can choose from existing Maya icons by clicking the Maya icon and choosing from the list of available files. 

       Tooltip      

Specify a brief description of the tool. This description appears with the icon in the icon or text modes, as well as in the tooltip (the pop-up description when the mouse hovers over the icon).

      

CREATE YOUR CUSTOM ICON:

You can use any software (Photoshop,GIMP,Paint...) to create your icon but there is some recommendation:

-PNG is the recommended format ( it will be transparent if you have no background)
-The standard size for a shelf icon is 32 x 32 pixels at 72 DPI. If your image does not conform to this size, Maya scales it to fit.


if you want to use a high resolution custom icon for a shelf item take a look here:
 https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Maya-Customizing/files/GUID-F2900709-59D3-4E67-A217-4FECC84053BE-htm.html

You need to make an icon that relates to your custom function.

For this function, I did a screenshot of the Maya window and I cropped it to keep "UVs icons".

here is the final customize icon created in Photoshop.

Go back to Maya and open the Shelf Editor of the new button. In the Icon Name field chose the new icon and Voilà!

I hope this little tutorials has been helpful to some people.



  

Report

Quick Tutorial: How to tie 3D shoe lace in 3ds Max & Zbrush.

Tutorial / 04 October 2018

I would like to share with you a tutorial I did a while ago.







Report

How to create "Wireframe on shaded" hotkey shortcut in Maya

Tutorial / 02 October 2018

Hey there! 

Something usefull for those want to save time in Maya ;) The script is not from me but I would like to share it

Let's start !

Open the Hotkey editor ( Windows/ Settings/Preferences/ Hotkey Editor), and click on the "Runtime Command Editor" tab on the right side of the window.



  1. Click the "New" button.
  2. Type a name for your command in the "Name" field.
  3. Copy the script below and Paste it in the script window.
    string $selectedPanel = `getPanel -wf`;
    int $shadedWireState = `modelEditor -q -wos $selectedPanel`;if(`modelEditor -ex $selectedPanel`)
    {
        setWireframeOnShadedOption (!$shadedWireState) $selectedPanel;
    }
  4. Click the "Save Runtime Command" button.
  5. Select  the " Edit Hotkeys for" option and select "Custom Scripts". Then click on the command and enter your Hotkey shorcut.
  6. Click the "Save" or "Save and Close" button


Hope that helps you, Cheers!


Report