MeshBaker
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Properties | List of all members
DigitalOpus.MB.Core.MB3_TextureCombiner Class Reference

Classes

class  MeshBakerMaterialTexture
 

Public Member Functions

bool CombineTexturesIntoAtlases (ProgressUpdateDelegate progressInfo, MB_AtlasesAndRects resultAtlasesAndRects, Material resultMaterial, List< GameObject > objsToMesh, List< Material > allowedMaterialsFilter, MB2_EditorMethodsInterface textureEditorMethods=null)
 Combines meshes and generates texture atlases. More...
 
Texture2D GetAdjustedForScaleAndOffset2 (MeshBakerMaterialTexture source)
 
void CopyScaledAndTiledToAtlas (MeshBakerMaterialTexture source, int targX, int targY, int targW, int targH, bool _fixOutOfBoundsUVs, int maxSize, Color[][] atlasPixels, int atlasWidth, bool isNormalMap, ProgressUpdateDelegate progressInfo=null)
 
void SuggestTreatment (List< GameObject > objsToMesh, Material[] resultMaterials, List< ShaderTextureProperty > _customShaderPropNames)
 

Public Attributes

MB2_LogLevel LOG_LEVEL = MB2_LogLevel.info
 

Static Public Attributes

static ShaderTextureProperty[] shaderTexPropertyNames
 

Protected Attributes

MB2_TextureBakeResults _textureBakeResults
 
int _atlasPadding = 1
 
bool _resizePowerOfTwoTextures = false
 
bool _fixOutOfBoundsUVs = false
 
int _maxTilingBakeSize = 1024
 
bool _saveAtlasesAsAssets = false
 
MB2_PackingAlgorithmEnum _packingAlgorithm = MB2_PackingAlgorithmEnum.UnitysPackTextures
 
bool _meshBakerTexturePackerForcePowerOfTwo = true
 
List< ShaderTextureProperty_customShaderPropNames = new List<ShaderTextureProperty>()
 
List< Texture2D > _temporaryTextures = new List<Texture2D>()
 

Properties

MB2_TextureBakeResults textureBakeResults [get, set]
 
int atlasPadding [get, set]
 
bool resizePowerOfTwoTextures [get, set]
 
bool fixOutOfBoundsUVs [get, set]
 
int maxTilingBakeSize [get, set]
 
bool saveAtlasesAsAssets [get, set]
 
MB2_PackingAlgorithmEnum packingAlgorithm [get, set]
 
bool meshBakerTexturePackerForcePowerOfTwo [get, set]
 
List< ShaderTexturePropertycustomShaderPropNames [get, set]
 

Member Function Documentation

bool DigitalOpus.MB.Core.MB3_TextureCombiner.CombineTexturesIntoAtlases ( ProgressUpdateDelegate  progressInfo,
MB_AtlasesAndRects  resultAtlasesAndRects,
Material  resultMaterial,
List< GameObject >  objsToMesh,
List< Material >  allowedMaterialsFilter,
MB2_EditorMethodsInterface  textureEditorMethods = null 
)

Combines meshes and generates texture atlases.

Parameters
createTextureAtlasesWhether or not texture atlases should be created. If not uvs will not be adjusted.
progressInfoA delegate function that will be called to report progress.
textureEditorMethodsIf called from the editor should be an instance of MB2_EditorMethods. If called at runtime should be null.

Combines meshes and generates texture atlases

void DigitalOpus.MB.Core.MB3_TextureCombiner.CopyScaledAndTiledToAtlas ( MeshBakerMaterialTexture  source,
int  targX,
int  targY,
int  targW,
int  targH,
bool  _fixOutOfBoundsUVs,
int  maxSize,
Color  atlasPixels[][],
int  atlasWidth,
bool  isNormalMap,
ProgressUpdateDelegate  progressInfo = null 
)
Texture2D DigitalOpus.MB.Core.MB3_TextureCombiner.GetAdjustedForScaleAndOffset2 ( MeshBakerMaterialTexture  source)
void DigitalOpus.MB.Core.MB3_TextureCombiner.SuggestTreatment ( List< GameObject >  objsToMesh,
Material[]  resultMaterials,
List< ShaderTextureProperty _customShaderPropNames 
)

Member Data Documentation

int DigitalOpus.MB.Core.MB3_TextureCombiner._atlasPadding = 1
protected
List<ShaderTextureProperty> DigitalOpus.MB.Core.MB3_TextureCombiner._customShaderPropNames = new List<ShaderTextureProperty>()
protected
bool DigitalOpus.MB.Core.MB3_TextureCombiner._fixOutOfBoundsUVs = false
protected
int DigitalOpus.MB.Core.MB3_TextureCombiner._maxTilingBakeSize = 1024
protected
bool DigitalOpus.MB.Core.MB3_TextureCombiner._meshBakerTexturePackerForcePowerOfTwo = true
protected
MB2_PackingAlgorithmEnum DigitalOpus.MB.Core.MB3_TextureCombiner._packingAlgorithm = MB2_PackingAlgorithmEnum.UnitysPackTextures
protected
bool DigitalOpus.MB.Core.MB3_TextureCombiner._resizePowerOfTwoTextures = false
protected
bool DigitalOpus.MB.Core.MB3_TextureCombiner._saveAtlasesAsAssets = false
protected
List<Texture2D> DigitalOpus.MB.Core.MB3_TextureCombiner._temporaryTextures = new List<Texture2D>()
protected
MB2_TextureBakeResults DigitalOpus.MB.Core.MB3_TextureCombiner._textureBakeResults
protected
MB2_LogLevel DigitalOpus.MB.Core.MB3_TextureCombiner.LOG_LEVEL = MB2_LogLevel.info
ShaderTextureProperty [] DigitalOpus.MB.Core.MB3_TextureCombiner.shaderTexPropertyNames
static
Initial value:
= new ShaderTextureProperty[] {
new ShaderTextureProperty("_MainTex",false),
new ShaderTextureProperty("_BumpMap",true),
new ShaderTextureProperty("_Normal",true),
new ShaderTextureProperty("_BumpSpecMap",false),
new ShaderTextureProperty("_DecalTex",false),
new ShaderTextureProperty("_Detail",false),
new ShaderTextureProperty("_GlossMap",false),
new ShaderTextureProperty("_Illum",false),
new ShaderTextureProperty("_LightTextureB0",false),
new ShaderTextureProperty("_ParallaxMap",false),
new ShaderTextureProperty("_ShadowOffset",false),
new ShaderTextureProperty("_TranslucencyMap",false),
new ShaderTextureProperty("_SpecMap",false),
new ShaderTextureProperty("_SpecGlossMap",false),
new ShaderTextureProperty("_TranspMap",false),
new ShaderTextureProperty("_MetallicGlossMap",false),
new ShaderTextureProperty("_OcclusionMap",false),
new ShaderTextureProperty("_EmissionMap",false),
new ShaderTextureProperty("_DetailMask",false),
}

Property Documentation

int DigitalOpus.MB.Core.MB3_TextureCombiner.atlasPadding
getset
List<ShaderTextureProperty> DigitalOpus.MB.Core.MB3_TextureCombiner.customShaderPropNames
getset
bool DigitalOpus.MB.Core.MB3_TextureCombiner.fixOutOfBoundsUVs
getset
int DigitalOpus.MB.Core.MB3_TextureCombiner.maxTilingBakeSize
getset
bool DigitalOpus.MB.Core.MB3_TextureCombiner.meshBakerTexturePackerForcePowerOfTwo
getset
MB2_PackingAlgorithmEnum DigitalOpus.MB.Core.MB3_TextureCombiner.packingAlgorithm
getset
bool DigitalOpus.MB.Core.MB3_TextureCombiner.resizePowerOfTwoTextures
getset
bool DigitalOpus.MB.Core.MB3_TextureCombiner.saveAtlasesAsAssets
getset
MB2_TextureBakeResults DigitalOpus.MB.Core.MB3_TextureCombiner.textureBakeResults
getset

The documentation for this class was generated from the following file: