Exemple #1
0
        public static TextureGenerationOutput GenerateTextureDefault(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                                     TextureAlphaSettings alphaSettings = null, TextureMipmapSettings mipmapSettings = null, TextureCubemapSettings cubemapSettings = null, TextureWrapSettings wrapSettings = null)
        {
            if (mipmapSettings == null)
            {
                mipmapSettings = new TextureMipmapSettings(TextureImporterMipFilter.BoxFilter, false, false, false, 1, 3);
            }

            return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.Default, platformSettings, settings, alphaSettings, mipmapSettings, cubemapSettings, wrapSettings));
        }
Exemple #2
0
        static public TextureMipmapSettings ExtractTextureMipmapSettings(this TextureImporterSettings settings)
        {
            if (!settings.mipmapEnabled)
            {
                return(null);
            }

            var ts = new TextureMipmapSettings();

            ts.filter            = settings.mipmapFilter;
            ts.borderMipmap      = settings.borderMipmap;
            ts.fadeout           = settings.fadeOut;
            ts.fadeDistanceStart = settings.mipmapFadeDistanceStart;
            ts.fadeDistanceEnd   = settings.mipmapFadeDistanceEnd;
            ts.preserveCoverage  = settings.mipMapsPreserveCoverage;
            return(ts);
        }
Exemple #3
0
        public static TextureGenerationOutput GenerateTextureCursor(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                                    TextureAlphaSettings alphaSettings = null, TextureMipmapSettings mipmapSettings = null, TextureWrapSettings wrapSettings = null)
        {
            if (alphaSettings == null)
            {
                alphaSettings = new TextureAlphaSettings(TextureImporterAlphaSource.FromInput, 0.5f);
            }
            if (wrapSettings == null)
            {
                wrapSettings = new TextureWrapSettings(TextureWrapMode.Clamp, TextureWrapMode.Clamp, TextureWrapMode.Clamp, TextureWrapMode.Clamp);
            }

            return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.Cursor, platformSettings, settings, alphaSettings, mipmapSettings, wrapSettings));
        }
Exemple #4
0
 public static TextureGenerationOutput GenerateTextureSingleChannel(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                                    TextureAlphaSettings alphaSettings = null, TextureMipmapSettings mipmapSettings = null, TextureCubemapSettings cubemapSettings = null, TextureWrapSettings wrapSettings = null)
 {
     settings.colorTexture = false;
     return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.SingleChannel, platformSettings, settings, alphaSettings, mipmapSettings, cubemapSettings, wrapSettings));
 }
Exemple #5
0
 public static TextureGenerationOutput GenerateTextureGUI(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                          TextureAlphaSettings alphaSettings = null, TextureMipmapSettings mipmapSettings = null, TextureWrapSettings wrapSettings = null)
 {
     settings.colorTexture = false;
     if (wrapSettings == null)
     {
         wrapSettings = new TextureWrapSettings(TextureWrapMode.Clamp, TextureWrapMode.Clamp, TextureWrapMode.Clamp, TextureWrapMode.Clamp);
     }
     return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.GUI, platformSettings, settings, alphaSettings, mipmapSettings, wrapSettings));
 }
Exemple #6
0
 public static TextureGenerationOutput GenerateNormalMap(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                         TextureNormalSettings normalSettings, TextureMipmapSettings mipmapSettings = null, TextureCubemapSettings cubemapSettings = null, TextureWrapSettings wrapSettings = null)
 {
     settings.colorTexture = false;
     return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.NormalMap, platformSettings, settings, normalSettings, mipmapSettings, cubemapSettings, wrapSettings));
 }
Exemple #7
0
 public static TextureGenerationOutput GenerateLightmap(NativeArray <Color32> buffer, int bufferWidth, int bufferHeight, TextureSettings settings, TextureImporterPlatformSettings platformSettings,
                                                        TextureMipmapSettings mipmapSettings = null, TextureWrapSettings wrapSettings = null)
 {
     settings.colorTexture = true;
     return(GenerateTexture(buffer, bufferWidth, bufferHeight, TextureImporterType.Lightmap, platformSettings, settings, mipmapSettings, wrapSettings));
 }