Difference between revisions of "ColorDNA"

From UMAWiki
Jump to: navigation, search
 
Line 20: Line 20:
  
 
2) Next, edit it's "Dna Type Hash", delete the value, hit "save", then unselect and reselect the DNA asset.  It should now have generated a new hash value.
 
2) Next, edit it's "Dna Type Hash", delete the value, hit "save", then unselect and reselect the DNA asset.  It should now have generated a new hash value.
 +
 +
[[File:ColorNamesDna01.jpg]]
  
 
3) Create a new empty GameObject and make a prefab out of it.  This will be the "ColorDNAConverter".  Add "ColorDnaConverterBehaviour" script to it and add the DNA hash value from step 2.
 
3) Create a new empty GameObject and make a prefab out of it.  This will be the "ColorDNAConverter".  Add "ColorDnaConverterBehaviour" script to it and add the DNA hash value from step 2.
 +
 +
[[File:ColorDnaConverter01.jpg]]
  
 
4) Create a Color DNA asset.  Right click in the project view, Create->UMA->DNA->Color DNA.  Name it "MuscularityColorDnaAsset"
 
4) Create a Color DNA asset.  Right click in the project view, Create->UMA->DNA->Color DNA.  Name it "MuscularityColorDnaAsset"
 +
 +
[[File:MuscularityColorDnaAsset01.jpg]]
  
 
5) Assign the DynamicUMADnaAsset and the ColorDnaAsset to their corresponding fields in the ColorDnaConverter.
 
5) Assign the DynamicUMADnaAsset and the ColorDnaAsset to their corresponding fields in the ColorDnaConverter.
Line 34: Line 40:
  
 
9) For the new normal shader to work we need to change the texture format on the UMA Material.  For example, if you use "UMA_Diffuse_Normal_Metallic", then change "Channel 1: _Bump Map"'s Texture format to "ARGB Half".
 
9) For the new normal shader to work we need to change the texture format on the UMA Material.  For example, if you use "UMA_Diffuse_Normal_Metallic", then change "Channel 1: _Bump Map"'s Texture format to "ARGB Half".
 +
 +
[[File:NormalTextureFormat01.jpg]]
  
 
10) Finally, find your race's base recipe and add a second overlay over your skin overlay.  Set it so this new overlay has color channel 0 and color channel 2 set to (0,0,0,0).  One of the overlays should have the smooth normal texture and one should have the muscled normal texture.
 
10) Finally, find your race's base recipe and add a second overlay over your skin overlay.  Set it so this new overlay has color channel 0 and color channel 2 set to (0,0,0,0).  One of the overlays should have the smooth normal texture and one should have the muscled normal texture.
 +
 +
[[File:Muscularity01.jpg]]

Latest revision as of 23:35, 20 February 2018

ColorDNA is an experimental work in progress feature for UMA. On Github there is a branch for it with the new feature files.


New or modified files are:

"Assets/UMA/Core/StandardAssets/UMA/Atlas/AtlasNormalShader.shader" - new texture normal merging shader

"Assets/UMA/Core/StandardAssets/UMA/Scripts/ColorDnaAsset.cs"

"Assets/UMA/Core/StandardAssets/UMA/Scripts/ColorDnaConverterBehaviour.cs"

"Assets/UMA/Core/StandardAssets/UMA/Scripts/Editor/ColorDnaAssetEditor.cs"


Muscularity Example

In this example we will set up an UMA to blend between two normal maps (one smooth and one muscled) to be able to make the appearance of the UMA transition between smooth and muscled.

1) First, we will need a new DynamicUMADnaAsset. Currently, there is no menu item to make just one. Either create a DynamicDNAConverterBehaviour or copy an existing DynamicUMADnaAsset and rename it to "ColorNamesDynamicDNA".

2) Next, edit it's "Dna Type Hash", delete the value, hit "save", then unselect and reselect the DNA asset. It should now have generated a new hash value.

ColorNamesDna01.jpg

3) Create a new empty GameObject and make a prefab out of it. This will be the "ColorDNAConverter". Add "ColorDnaConverterBehaviour" script to it and add the DNA hash value from step 2.

ColorDnaConverter01.jpg

4) Create a Color DNA asset. Right click in the project view, Create->UMA->DNA->Color DNA. Name it "MuscularityColorDnaAsset"

MuscularityColorDnaAsset01.jpg

5) Assign the DynamicUMADnaAsset and the ColorDnaAsset to their corresponding fields in the ColorDnaConverter.

6) On the DynamicUMADnaAsset, let's add a DNA Name called "Muscularity"

7) On the ColorDnaAsset, let's add a new color set entry. DNA Entry Name = "Muscularity", Overlay Entry Name = "MuscularityOverlay", Color Channel = 1, Min Color = (1,1,1,0), Max Color = (1,1,1,1)

8) Now, find your UMA's RaceData and add the "ColorDNAConverter" to it's DNA converter list.

9) For the new normal shader to work we need to change the texture format on the UMA Material. For example, if you use "UMA_Diffuse_Normal_Metallic", then change "Channel 1: _Bump Map"'s Texture format to "ARGB Half".

NormalTextureFormat01.jpg

10) Finally, find your race's base recipe and add a second overlay over your skin overlay. Set it so this new overlay has color channel 0 and color channel 2 set to (0,0,0,0). One of the overlays should have the smooth normal texture and one should have the muscled normal texture.

Muscularity01.jpg