|
AsImpL 1.0
Asynchronous Importer and run-time Loader for Unity
|
Utility class for model import More...
Public Types | |
| enum | MtlBlendMode { OPAQUE , CUTOUT , FADE , TRANSPARENT } |
| Blend mode for Unity Material More... | |
Static Public Member Functions | |
| static void | SetupMaterialWithBlendMode (Material mtl, MtlBlendMode mode) |
| Set up a Material for the given mode. More... | |
| static bool | ScanTransparentPixels (Texture2D texture, ref MtlBlendMode mode) |
| Scan a texture looking for transparent pixels and trying to guess the correct blend mode needed. More... | |
| static void | DetectMtlBlendFadeOrCutout (float alpha, ref MtlBlendMode mode, ref bool noDoubt) |
| Detect if the blend mode must be set to FADE or CUTOUT according to the given alpha value and the current value of mode. More... | |
| static Texture2D | HeightToNormalMap (Texture2D bumpMap, float amount=1f) |
| Convert a bump map to a normal map More... | |
Utility class for model import
|
static |
Detect if the blend mode must be set to FADE or CUTOUT according to the given alpha value and the current value of mode.
| alpha | input alpha value |
| mode | blend mode set to FADE or CUTOUT |
| noDoubt | flag set to true if the mode is finally detected (it can be used to break from a scan loop) |
|
static |
Convert a bump map to a normal map
| bumpMap | input bump map |
| amount | optionally adjust the bump effect with the normal map |
Get depth component
|
static |
Scan a texture looking for transparent pixels and trying to guess the correct blend mode needed.
| texture | input rexture (it must be set to readable) |
| mode | blend mode set to FADE or CUTOUT if transparent pixels are found. |
|
static |
Set up a Material for the given mode.
Here is replicated what is done when choosing a blend mode from Inspector.
| mtl | material to be changed |
| mode | mode to be set |