예제 #1
0
 public CubemapModifier()
 {
     anisoLevel = 1;
     filterMode = FilterMode.Bilinear;
     mipMapBias = 0;
     wrapMode = TextureWrapMode.Clamp;
 }
예제 #2
0
        public void OnInspectorGUI(Action onValueChanged)
        {
            // wrapMode
            var newWrapMode = (UnityEngine.TextureWrapMode)EditorGUILayout.Popup("Wrap Mode", (int)this.wrapMode, Enum.GetNames(typeof(UnityEngine.TextureWrapMode)), new GUILayoutOption[0]);

            if (newWrapMode != this.wrapMode)
            {
                this.wrapMode = newWrapMode;
                onValueChanged();
            }

            // filterMode
            var newFilterMode = (UnityEngine.FilterMode)EditorGUILayout.Popup("Filter Mode", (int)this.filterMode, Enum.GetNames(typeof(UnityEngine.FilterMode)), new GUILayoutOption[0]);

            if (newFilterMode != this.filterMode)
            {
                this.filterMode = newFilterMode;
                onValueChanged();
            }

            // anisoLevel
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Aniso Level");

                var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16);
                if (changedVal != this.anisoLevel)
                {
                    this.anisoLevel = changedVal;
                    onValueChanged();
                }
            }
            EditorGUILayout.HelpBox("Aniso Level can be set only when RenderTexture does not have depth buffer.", MessageType.Info);
        }
예제 #3
0
        public override void DrawInspector(Action changed)
        {
            // wrapMode
            var newWrapMode = (UnityEngine.TextureWrapMode)EditorGUILayout.Popup("Wrap Mode", (int)this.wrapMode, Enum.GetNames(typeof(UnityEngine.TextureWrapMode)), new GUILayoutOption[0]);

            if (newWrapMode != this.wrapMode)
            {
                this.wrapMode = newWrapMode;
                changed();
            }

            // filterMode
            var newFilterMode = (UnityEngine.FilterMode)EditorGUILayout.Popup("Filter Mode", (int)this.filterMode, Enum.GetNames(typeof(UnityEngine.FilterMode)), new GUILayoutOption[0]);

            if (newFilterMode != this.filterMode)
            {
                this.filterMode = newFilterMode;
                changed();
            }

            // anisoLevel
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Aniso Level");

                var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16);
                if (changedVal != this.anisoLevel)
                {
                    this.anisoLevel = changedVal;
                    changed();
                }
            }
            EditorGUILayout.HelpBox("Aniso Level can be set if target Asset(RenderTexture)'s Depth Buffer is No depth buffer. ", MessageType.Info);
        }
예제 #4
0
 public CubemapModifier()
 {
     anisoLevel = 1;
     filterMode = FilterMode.Bilinear;
     mipMapBias = 0;
     wrapMode   = TextureWrapMode.Clamp;
 }
예제 #5
0
 private CubemapOperator(
     string operatorType,
     int anisoLevel,
     FilterMode filterMode,
     float mipMapBias,
     TextureWrapMode wrapMode
     )
 {
     this.operatorType = operatorType;
     this.anisoLevel   = anisoLevel;
     this.filterMode   = filterMode;
     this.mipMapBias   = mipMapBias;
     this.wrapMode     = wrapMode;
 }
 // Parameter Attributes are applied below in Stop()
 public void In(
     [FriendlyName("Target", "The target Texture2D variable.")]
     Texture2D target,
     [FriendlyName("Width", "The width of the texture as an int variable.")]
     out int width,
     [FriendlyName("Height", "The height of the texture as an int variable.")]
     out int height,
     [FriendlyName("Size", "The size of the texture as a Vector2 variable (width, height).")]
     [SocketState(false, false)]
     out Vector2 size,
     [FriendlyName("Filter Mode", "The current filter mode of the texture.")]
     [SocketState(false, false)]
     out UnityEngine.FilterMode filterMode,
     [FriendlyName("Anisotropic Level", "The current anisotropic filtering level of the texture.")]
     [SocketState(false, false)]
     out int anisoLevel,
     [FriendlyName("Wrap Mode", "The current wrap mode setting of the texture (Repeat or Clamp).")]
     [SocketState(false, false)]
     out UnityEngine.TextureWrapMode wrapMode,
     [FriendlyName("Mip Map Bias", "The current mip map bias of the texture.")]
     [SocketState(false, false)]
     out float mipMapBias,
     [FriendlyName("Texture Name", "The current name of the Texture2D as a string variable.")]
     [SocketState(false, false)]
     out string name
     )
 {
     if (null != target)
     {
         size       = new Vector2(target.width, target.height);
         width      = target.width;
         height     = target.height;
         filterMode = target.filterMode;
         anisoLevel = target.anisoLevel;
         wrapMode   = target.wrapMode;
         mipMapBias = target.mipMapBias;
         name       = target.name;
     }
     else
     {
         size       = new Vector2(0, 0);
         width      = 0;
         height     = 0;
         filterMode = UnityEngine.FilterMode.Point;
         anisoLevel = 0;
         wrapMode   = UnityEngine.TextureWrapMode.Clamp;
         mipMapBias = 0f;
         name       = "null";
     }
 }
예제 #7
0
 static void Texture_wrapMode(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Texture _this = (UnityEngine.Texture)vc.csObj;
         var result = _this.wrapMode;
         JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
     }
     else
     {
         UnityEngine.TextureWrapMode arg0  = (UnityEngine.TextureWrapMode)JSApi.getEnum((int)JSApi.GetType.Arg);
         UnityEngine.Texture         _this = (UnityEngine.Texture)vc.csObj;
         _this.wrapMode = arg0;
     }
 }
예제 #8
0
        private RenderTextureOperator(
            // Int32 width, Int32 height,
            // AntiAliasing antiAliasing,
            // UnityEngine.RenderTextureFormat colorFormat,
            // DepthBuffer depthBuffer,
            UnityEngine.TextureWrapMode wrapMode,
            UnityEngine.FilterMode filterMode,
            Int32 anisoLevel
            )
        {
            this.dataType = "UnityEngine.RenderTexture";

            this.wrapMode   = wrapMode;
            this.filterMode = filterMode;
            this.anisoLevel = anisoLevel;
        }
예제 #9
0
        public override void DrawInspector(Action changed)
        {
            // anisoLevel
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Aniso Level");

                var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16);                // actually, max is not defined.
                if (changedVal != this.anisoLevel)
                {
                    this.anisoLevel = changedVal;
                    changed();
                }
            }

            // filterMode
            var newFilterMode = (UnityEngine.FilterMode)EditorGUILayout.Popup("Filter Mode", (int)this.filterMode, Enum.GetNames(typeof(UnityEngine.FilterMode)), new GUILayoutOption[0]);

            if (newFilterMode != this.filterMode)
            {
                this.filterMode = newFilterMode;
                changed();
            }

            // mipMapBias
            var newMipMapBias = EditorGUILayout.TextField("MipMap Bias", this.mipMapBias.ToString());

            if (newMipMapBias != this.mipMapBias.ToString())
            {
                this.mipMapBias = float.Parse(newMipMapBias, CultureInfo.InvariantCulture.NumberFormat);
                changed();
            }

            // wrapMode
            var newWrapMode = (UnityEngine.TextureWrapMode)EditorGUILayout.Popup("Wrap Mode", (int)this.wrapMode, Enum.GetNames(typeof(UnityEngine.TextureWrapMode)), new GUILayoutOption[0]);

            if (newWrapMode != this.wrapMode)
            {
                this.wrapMode = newWrapMode;
                changed();
            }
        }
예제 #10
0
        [SerializeField] public int anisoLevel;        // limit to 16.



        public RenderTextureModifier()
        {
            wrapMode   = TextureWrapMode.Clamp;
            filterMode = FilterMode.Bilinear;
            anisoLevel = 0;
        }
예제 #11
0
        public void OnInspectorGUI(Action onValueChanged)
        {
            // anisoLevel
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Aniso Level");

                var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16);// actually, max is not defined.
                if (changedVal != this.anisoLevel) {
                    this.anisoLevel = changedVal;
                    onValueChanged();
                }
            }

            // filterMode
            var newFilterMode = (UnityEngine.FilterMode)EditorGUILayout.Popup("Filter Mode", (int)this.filterMode, Enum.GetNames(typeof(UnityEngine.FilterMode)), new GUILayoutOption[0]);
            if (newFilterMode != this.filterMode) {
                this.filterMode = newFilterMode;
                onValueChanged();
            }

            // mipMapBias
            var newMipMapBias = EditorGUILayout.TextField("MipMap Bias", this.mipMapBias.ToString());
            if (newMipMapBias != this.mipMapBias.ToString()) {
                this.mipMapBias = float.Parse(newMipMapBias, CultureInfo.InvariantCulture.NumberFormat);
                onValueChanged();
            }

            // wrapMode
            var newWrapMode = (UnityEngine.TextureWrapMode)EditorGUILayout.Popup("Wrap Mode", (int)this.wrapMode, Enum.GetNames(typeof(UnityEngine.TextureWrapMode)), new GUILayoutOption[0]);
            if (newWrapMode != this.wrapMode) {
                this.wrapMode = newWrapMode;
                onValueChanged();
            }
        }
예제 #12
0
        public override void DrawInspector(Action changed)
        {
            // wrapMode
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Wrap Mode");

                var currentMode = this.wrapMode.ToString();

                if (GUILayout.Button(currentMode, "Popup"))
                {
                    var menu = new GenericMenu();
                    foreach (var item in Enum.GetValues(typeof(UnityEngine.TextureWrapMode)).Cast <UnityEngine.TextureWrapMode>().ToList())
                    {
                        var isCurrentChoose = false;
                        if (item == this.wrapMode)
                        {
                            isCurrentChoose = true;
                        }
                        var currentItem = item;

                        menu.AddItem(
                            new GUIContent(item.ToString()),
                            isCurrentChoose,
                            () => {
                            if (this.wrapMode != currentItem)
                            {
                                this.wrapMode = currentItem;
                                changed();
                            }
                        }
                            );
                    }
                    menu.ShowAsContext();
                }
            }

            // filterMode
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Filter Mode");

                var currentMode = this.filterMode.ToString();

                if (GUILayout.Button(currentMode, "Popup"))
                {
                    var menu = new GenericMenu();
                    foreach (var item in Enum.GetValues(typeof(UnityEngine.FilterMode)).Cast <UnityEngine.FilterMode>().ToList())
                    {
                        var isCurrentChoose = false;
                        if (item == this.filterMode)
                        {
                            isCurrentChoose = true;
                        }
                        var currentItem = item;

                        menu.AddItem(
                            new GUIContent(item.ToString()),
                            isCurrentChoose,
                            () => {
                            if (this.filterMode != currentItem)
                            {
                                this.filterMode = currentItem;
                                changed();
                            }
                        }
                            );
                    }
                    menu.ShowAsContext();
                }
            }

            // anisoLevel
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Aniso Level");

                var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16);
                if (changedVal != this.anisoLevel)
                {
                    this.anisoLevel = changedVal;
                    changed();
                }
            }
            EditorGUILayout.HelpBox("Aniso Level can be set if target Asset(RenderTexture)'s Depth Buffer is No depth buffer. ", MessageType.Info);
        }
예제 #13
0
        public void OnInspectorGUI(Action onValueChanged)
        {
            // wrapMode
            var newWrapMode = (UnityEngine.TextureWrapMode)EditorGUILayout.Popup("Wrap Mode", (int)this.wrapMode, Enum.GetNames(typeof(UnityEngine.TextureWrapMode)), new GUILayoutOption[0]);
            if (newWrapMode != this.wrapMode) {
                this.wrapMode = newWrapMode;
                onValueChanged();
            }

            // filterMode
            var newFilterMode = (UnityEngine.FilterMode)EditorGUILayout.Popup("Filter Mode", (int)this.filterMode, Enum.GetNames(typeof(UnityEngine.FilterMode)), new GUILayoutOption[0]);
            if (newFilterMode != this.filterMode) {
                this.filterMode = newFilterMode;
                onValueChanged();
            }

            // anisoLevel
            using (new GUILayout.HorizontalScope()) {
                GUILayout.Label("Aniso Level");

                var changedVal = (int)EditorGUILayout.Slider(this.anisoLevel, 0, 16);
                if (changedVal != this.anisoLevel) {
                    this.anisoLevel = changedVal;
                    onValueChanged();
                }
            }
            EditorGUILayout.HelpBox("Aniso Level can be set only when RenderTexture does not have depth buffer.", MessageType.Info);
        }
예제 #14
0
 public RenderTextureModifier()
 {
     wrapMode = TextureWrapMode.Clamp;
     filterMode = FilterMode.Bilinear;
     anisoLevel = 0;
 }