Class for handling Cubemap arrays.

Inheritance: Texture
コード例 #1
0
        public override void OnPreviewGUI(Rect r, GUIStyle background)
        {
            if (!SystemInfo.supportsCubemapArrayTextures || (m_Material != null && !m_Material.shader.isSupported))
            {
                if (Event.current.type == EventType.Repaint)
                {
                    EditorGUI.DropShadowLabel(new Rect(r.x, r.y, r.width, 40), "Cubemap array preview is not supported");
                }
                return;
            }

            CubemapArray t = (CubemapArray)target;

            m_Material.mainTexture = t;

            m_PreviewUtility.BeginPreview(r, background);
            const float previewDistance = 6.0f;

            m_PreviewDir = PreviewGUI.Drag2D(m_PreviewDir, r);

            m_PreviewUtility.camera.transform.position = -Vector3.forward * previewDistance;
            m_PreviewUtility.camera.transform.rotation = Quaternion.identity;
            Quaternion rot = Quaternion.Euler(m_PreviewDir.y, 0, 0) * Quaternion.Euler(0, m_PreviewDir.x, 0);

            m_PreviewUtility.DrawMesh(m_Mesh, Vector3.zero, rot, m_Material, 0);
            m_PreviewUtility.Render();
            Texture renderedTexture = m_PreviewUtility.EndPreview();

            GUI.DrawTexture(r, renderedTexture, ScaleMode.StretchToFill, false);

            EditorGUI.DropShadowLabel(new Rect(r.x, r.y + 10, r.width, 30),
                                      "Slice " + m_Slice + "\nMip " + m_Mip);
        }
コード例 #2
0
 private static void Internal_Create([Writable] CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags)
 {
     if (!Internal_CreateImpl(mono, ext, count, mipCount, format, flags))
     {
         throw new UnityException("Failed to create cubemap array texture because of invalid parameters.");
     }
 }
コード例 #3
0
 static public int get_isReadable(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.isReadable);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #4
0
ファイル: CubemapArray.cs プロジェクト: yaoya/UnityDecompiled
 private static void Internal_Create([Writable] CubemapArray mono, int ext, int count, TextureFormat format, bool mipmap, bool linear)
 {
     if (!CubemapArray.Internal_CreateImpl(mono, ext, count, format, mipmap, linear))
     {
         throw new UnityException("Failed to create cubemap array texture because of invalid parameters.");
     }
 }
コード例 #5
0
 static public int SetPixels32(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 4)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             UnityEngine.Color32[]    a1;
             checkArray(l, 2, out a1);
             UnityEngine.CubemapFace a2;
             a2 = (UnityEngine.CubemapFace)LuaDLL.luaL_checkinteger(l, 3);
             System.Int32 a3;
             checkType(l, 4, out a3);
             self.SetPixels32(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             UnityEngine.Color32[]    a1;
             checkArray(l, 2, out a1);
             UnityEngine.CubemapFace a2;
             a2 = (UnityEngine.CubemapFace)LuaDLL.luaL_checkinteger(l, 3);
             System.Int32 a3;
             checkType(l, 4, out a3);
             System.Int32 a4;
             checkType(l, 5, out a4);
             self.SetPixels32(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function SetPixels32 to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #6
0
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.CubemapArray o;
         if (argc == 7)
         {
             System.Int32 a1;
             checkType(l, 3, out a1);
             System.Int32 a2;
             checkType(l, 4, out a2);
             UnityEngine.TextureFormat a3;
             checkEnum(l, 5, out a3);
             System.Boolean a4;
             checkType(l, 6, out a4);
             System.Boolean a5;
             checkType(l, 7, out a5);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4, a5);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, "ctor__Int32__Int32__GraphicsFormat__TextureCreationFlags", argc, 2, typeof(int), typeof(int), typeof(UnityEngine.Experimental.Rendering.GraphicsFormat), typeof(UnityEngine.Experimental.Rendering.TextureCreationFlags)))
         {
             System.Int32 a1;
             checkType(l, 3, out a1);
             System.Int32 a2;
             checkType(l, 4, out a2);
             UnityEngine.Experimental.Rendering.GraphicsFormat a3;
             checkEnum(l, 5, out a3);
             UnityEngine.Experimental.Rendering.TextureCreationFlags a4;
             checkEnum(l, 6, out a4);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, "ctor__Int32__Int32__TextureFormat__Boolean", argc, 2, typeof(int), typeof(int), typeof(UnityEngine.TextureFormat), typeof(bool)))
         {
             System.Int32 a1;
             checkType(l, 3, out a1);
             System.Int32 a2;
             checkType(l, 4, out a2);
             UnityEngine.TextureFormat a3;
             checkEnum(l, 5, out a3);
             System.Boolean a4;
             checkType(l, 6, out a4);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #7
0
 static public int Apply(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             self.Apply();
             pushValue(l, true);
             return(1);
         }
         else if (argc == 2)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             System.Boolean           a1;
             checkType(l, 2, out a1);
             self.Apply(a1);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 3)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             System.Boolean           a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             self.Apply(a1, a2);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Apply to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #8
0
        public CubemapArray(int width, int cubemapCount, GraphicsFormat format, TextureCreationFlags flags, int mipCount)
        {
            bool flag = !base.ValidateFormat(format, FormatUsage.Sample);

            if (!flag)
            {
                CubemapArray.ValidateIsNotCrunched(flags);
                CubemapArray.Internal_Create(this, width, cubemapCount, mipCount, format, flags);
            }
        }
コード例 #9
0
 static public int get_format(IntPtr l)
 {
     try {
         UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
         pushValue(l, true);
         pushEnum(l, (int)self.format);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #10
0
 static public int get_isReadable(IntPtr l)
 {
     try {
         UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.isReadable);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #11
0
        public CubemapArray(int width, int cubemapCount, TextureFormat textureFormat, int mipCount, [DefaultValue("true")] bool linear)
        {
            bool flag = !base.ValidateFormat(textureFormat);

            if (!flag)
            {
                GraphicsFormat       graphicsFormat       = GraphicsFormatUtility.GetGraphicsFormat(textureFormat, !linear);
                TextureCreationFlags textureCreationFlags = (mipCount != 1) ? TextureCreationFlags.MipChain : TextureCreationFlags.None;
                bool flag2 = GraphicsFormatUtility.IsCrunchFormat(textureFormat);
                if (flag2)
                {
                    textureCreationFlags |= TextureCreationFlags.Crunch;
                }
                CubemapArray.ValidateIsNotCrunched(textureCreationFlags);
                CubemapArray.Internal_Create(this, width, cubemapCount, mipCount, graphicsFormat, textureCreationFlags);
            }
        }
コード例 #12
0
        public override void OnPreviewSettings()
        {
            CubemapArray t = (CubemapArray)target;

            EditorGUI.BeginDisabledGroup(t.cubemapCount <= 1);
            EditorGUILayout.LabelField(Styles.slice, GUILayout.Width(40));
            m_Slice = EditorGUILayout.IntSlider(m_Slice, 0, t.cubemapCount - 1, GUILayout.Width(120));
            EditorGUI.EndDisabledGroup();
            m_Material.SetInt("_SliceIndex", m_Slice);

            EditorGUI.BeginDisabledGroup(m_MipCount == 0);
            GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapLow"), Styles.toolbarLabel);
            m_Mip = Mathf.RoundToInt(GUILayout.HorizontalSlider(m_Mip, m_MipCount - 1, 0, GUILayout.Width(64)));
            GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapHigh"), Styles.toolbarLabel);
            EditorGUI.EndDisabledGroup();
            m_Material.SetFloat("_Mip", m_Mip);
        }
コード例 #13
0
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.CubemapArray o;
         if (argc == 5)
         {
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             UnityEngine.TextureFormat a3;
             checkEnum(l, 4, out a3);
             System.Boolean a4;
             checkType(l, 5, out a4);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 6)
         {
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             UnityEngine.TextureFormat a3;
             checkEnum(l, 4, out a3);
             System.Boolean a4;
             checkType(l, 5, out a4);
             System.Boolean a5;
             checkType(l, 6, out a5);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4, a5);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #14
0
 static public int SetPixels32(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 6)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             UnityEngine.Color32[]    a1;
             checkArray(l, 3, out a1);
             UnityEngine.CubemapFace a2;
             checkEnum(l, 4, out a2);
             System.Int32 a3;
             checkType(l, 5, out a3);
             System.Int32 a4;
             checkType(l, 6, out a4);
             self.SetPixels32(a1, a2, a3, a4);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 5)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             UnityEngine.Color32[]    a1;
             checkArray(l, 3, out a1);
             UnityEngine.CubemapFace a2;
             checkEnum(l, 4, out a2);
             System.Int32 a3;
             checkType(l, 5, out a3);
             self.SetPixels32(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #15
0
        public override void OnPreviewSettings()
        {
            CubemapArray t = (CubemapArray)target;

            EditorGUI.BeginDisabledGroup(t.cubemapCount <= 1);
            EditorGUILayout.LabelField(Styles.slice, GUILayout.Width(40));
            m_Slice = EditorGUILayout.IntSlider(m_Slice, 0, t.cubemapCount - 1, GUILayout.Width(120));
            EditorGUI.EndDisabledGroup();
            m_Material.SetFloat("_SliceIndex", (float)m_Slice);

            EditorGUI.BeginDisabledGroup(!TextureUtil.NeedsExposureControl(t));
            m_ExposureSliderValue = EditorGUIInternal.ExposureSlider(m_ExposureSliderValue, ref m_ExposureSliderMax, EditorStyles.toolbarSlider);
            EditorGUI.EndDisabledGroup();
            m_Material.SetFloat("_Exposure", GetExposureValueForTexture(t));

            EditorGUI.BeginDisabledGroup(m_MipCount == 0);
            GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapLow"), Styles.toolbarLabel);
            m_Mip = Mathf.RoundToInt(GUILayout.HorizontalSlider(m_Mip, m_MipCount - 1, 0, GUILayout.Width(64)));
            GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapHigh"), Styles.toolbarLabel);
            EditorGUI.EndDisabledGroup();
            m_Material.SetFloat("_Mip", m_Mip);
        }
コード例 #16
0
 static public int Apply(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 4)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             System.Boolean           a1;
             checkType(l, 3, out a1);
             System.Boolean a2;
             checkType(l, 4, out a2);
             self.Apply(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 3)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             System.Boolean           a1;
             checkType(l, 3, out a1);
             self.Apply(a1);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 2)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             self.Apply();
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #17
0
 static public int GetPixels32(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 3)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             UnityEngine.CubemapFace  a1;
             checkEnum(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             var ret = self.GetPixels32(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l);
             UnityEngine.CubemapFace  a1;
             checkEnum(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Int32 a3;
             checkType(l, 4, out a3);
             var ret = self.GetPixels32(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #18
0
ファイル: CubemapArray.cs プロジェクト: yaoya/UnityDecompiled
 public CubemapArray(int faceSize, int cubemapCount, TextureFormat format, bool mipmap, [DefaultValue("false")] bool linear)
 {
     CubemapArray.Internal_Create(this, faceSize, cubemapCount, format, mipmap, linear);
 }
コード例 #19
0
 extern private static bool Internal_CreateImpl([Writable] CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags);
コード例 #20
0
        private static bool Internal_CreateImpl([Writable] /* 0x00000001800D4E50-0x00000001800D4E60 */ CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags) => default; // 0x0000000180965BE0-0x0000000180965C40

        private static void Internal_Create([Writable] /* 0x00000001800D4E50-0x00000001800D4E60 */ CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags)
        {
        }                                                                                                                                                                                                             // 0x0000000180965C40-0x0000000180965D00
コード例 #21
0
 [FreeFunction]                                                                                                                                                                                                     // 0x00000001800E2830-0x00000001800E2860
 private static bool Internal_CreateImpl([Writable] /* 0x00000001800D4E50-0x00000001800D4E60 */ CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags) => default; // 0x0000000180965BE0-0x0000000180965C40
コード例 #22
0
 private static extern void Internal_Create([Writable] CubemapArray mono, int faceSize, int cubemapCount, TextureFormat format, bool mipmap, bool linear);
コード例 #23
0
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.CubemapArray o;
         if (matchType(l, argc, 2, typeof(int), typeof(int), typeof(UnityEngine.Experimental.Rendering.GraphicsFormat), typeof(UnityEngine.Experimental.Rendering.TextureCreationFlags)))
         {
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             UnityEngine.Experimental.Rendering.GraphicsFormat a3;
             a3 = (UnityEngine.Experimental.Rendering.GraphicsFormat)LuaDLL.luaL_checkinteger(l, 4);
             UnityEngine.Experimental.Rendering.TextureCreationFlags a4;
             a4 = (UnityEngine.Experimental.Rendering.TextureCreationFlags)LuaDLL.luaL_checkinteger(l, 5);
             o  = new UnityEngine.CubemapArray(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 6)
         {
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             UnityEngine.TextureFormat a3;
             a3 = (UnityEngine.TextureFormat)LuaDLL.luaL_checkinteger(l, 4);
             System.Boolean a4;
             checkType(l, 5, out a4);
             System.Boolean a5;
             checkType(l, 6, out a5);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4, a5);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(int), typeof(int), typeof(UnityEngine.TextureFormat), typeof(bool)))
         {
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             UnityEngine.TextureFormat a3;
             a3 = (UnityEngine.TextureFormat)LuaDLL.luaL_checkinteger(l, 4);
             System.Boolean a4;
             checkType(l, 5, out a4);
             o = new UnityEngine.CubemapArray(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #24
0
 public CubemapArray(int faceSize, int cubemapCount, TextureFormat format, bool mipmap)
 {
     CubemapArray.Internal_Create(this, faceSize, cubemapCount, format, mipmap, false);
 }
コード例 #25
0
ファイル: CubemapArray.cs プロジェクト: yaoya/UnityDecompiled
 private static extern bool Internal_CreateImpl([Writable] CubemapArray mono, int ext, int count, TextureFormat format, bool mipmap, bool linear);