コード例 #1
0
        public void CreateAndDeleteVideoTrack()
        {
            var context = Context.Create();
            var width   = 256;
            var height  = 256;
            var format  = WebRTC.GetSupportedRenderTextureFormat(UnityEngine.SystemInfo.graphicsDeviceType);
            var rt      = new UnityEngine.RenderTexture(width, height, 0, format);

            rt.Create();
            var source = context.CreateVideoTrackSource();
            var track  = context.CreateVideoTrack("video", source);

            context.DeleteRefPtr(track);
            context.DeleteRefPtr(source);
            context.Dispose();
            UnityEngine.Object.DestroyImmediate(rt);
        }
コード例 #2
0
        static StackObject *set_useMipMap_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @value = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.RenderTexture instance_of_this_method = (UnityEngine.RenderTexture) typeof(UnityEngine.RenderTexture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.useMipMap = value;

            return(__ret);
        }
コード例 #3
0
 public override object WriteTo(object obj, System.Collections.Generic.Dictionary <long, UnityEngine.Object> objects)
 {
     obj = base.WriteTo(obj, objects);
     if (obj == null)
     {
         return(null);
     }
     UnityEngine.RenderTexture o = (UnityEngine.RenderTexture)obj;
     o.depth             = depth;
     o.isPowerOfTwo      = isPowerOfTwo;
     o.format            = (UnityEngine.RenderTextureFormat)format;
     o.useMipMap         = useMipMap;
     o.autoGenerateMips  = autoGenerateMips;
     o.volumeDepth       = volumeDepth;
     o.antiAliasing      = antiAliasing;
     o.enableRandomWrite = enableRandomWrite;
     return(o);
 }
コード例 #4
0
        static StackObject *set_targetTexture_9(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.RenderTexture @value = (UnityEngine.RenderTexture) typeof(UnityEngine.RenderTexture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Camera instance_of_this_method = (UnityEngine.Camera) typeof(UnityEngine.Camera).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.targetTexture = value;

            return(__ret);
        }
コード例 #5
0
        static StackObject *Invoke_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.RenderTexture @obj = (UnityEngine.RenderTexture) typeof(UnityEngine.RenderTexture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Action <UnityEngine.RenderTexture> instance_of_this_method = (System.Action <UnityEngine.RenderTexture>) typeof(System.Action <UnityEngine.RenderTexture>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Invoke(@obj);

            return(__ret);
        }
コード例 #6
0
        void OnEnable()
        {
            if (image == null)
            {
                return;
            }

            renderTexture = new UnityEngine.RenderTexture(UnityEngine.Screen.width, UnityEngine.Screen.height, 0);

            image.texture = renderTexture;

            var imageTransform = image.transform;

            imageTransform.localPosition    = new UnityEngine.Vector3(0, 0, -3.7f);
            imageTransform.localEulerAngles = new UnityEngine.Vector3(10, 180, 180);

            StartCoroutine(DoTheFunny());
        }
コード例 #7
0
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 6 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <UnityEngine.RenderTextureFormat>(L, 5) && translator.Assignable <UnityEngine.RenderTextureReadWrite>(L, 6))
                {
                    int width  = LuaAPI.xlua_tointeger(L, 2);
                    int height = LuaAPI.xlua_tointeger(L, 3);
                    int depth  = LuaAPI.xlua_tointeger(L, 4);
                    UnityEngine.RenderTextureFormat    format; translator.Get(L, 5, out format);
                    UnityEngine.RenderTextureReadWrite readWrite; translator.Get(L, 6, out readWrite);

                    UnityEngine.RenderTexture __cl_gen_ret = new UnityEngine.RenderTexture(width, height, depth, format, readWrite);
                    translator.Push(L, __cl_gen_ret);
                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && translator.Assignable <UnityEngine.RenderTextureFormat>(L, 5))
                {
                    int width  = LuaAPI.xlua_tointeger(L, 2);
                    int height = LuaAPI.xlua_tointeger(L, 3);
                    int depth  = LuaAPI.xlua_tointeger(L, 4);
                    UnityEngine.RenderTextureFormat format; translator.Get(L, 5, out format);

                    UnityEngine.RenderTexture __cl_gen_ret = new UnityEngine.RenderTexture(width, height, depth, format);
                    translator.Push(L, __cl_gen_ret);
                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
                {
                    int width  = LuaAPI.xlua_tointeger(L, 2);
                    int height = LuaAPI.xlua_tointeger(L, 3);
                    int depth  = LuaAPI.xlua_tointeger(L, 4);

                    UnityEngine.RenderTexture __cl_gen_ret = new UnityEngine.RenderTexture(width, height, depth);
                    translator.Push(L, __cl_gen_ret);
                    return(1);
                }
            }
            catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.RenderTexture constructor!"));
        }
コード例 #8
0
        /** OnRenderImage
         */
        private void OnRenderImage(UnityEngine.RenderTexture a_source, UnityEngine.RenderTexture a_dest)
        {
            try{
                this.material_depth_view.SetFloat("rate_blend", this.rate_blend);

                if (this.rendertexture_depth != null)
                {
                    this.material_depth_view.SetInt("camera_depth_flag", 0);
                    this.material_depth_view.SetTexture("texture_depth", this.rendertexture_depth);
                }
                else
                {
                    this.material_depth_view.SetInt("camera_depth_flag", 1);
                }
                UnityEngine.Graphics.Blit(a_source, a_dest, this.material_depth_view);
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }
        }
コード例 #9
0
        static StackObject *Ctor_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @depth = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @height = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Int32 @width = ptr_of_this_method->Value;


            var result_of_this_method = new UnityEngine.RenderTexture(@width, @height, @depth);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #10
0
        private UnityEngine.Texture2D RenderCameraToTexture(UnityEngine.Camera camera)
        {
            // The Render Texture in RenderTexture.active is the one
            // that will be read by ReadPixels.
            UnityEngine.RenderTexture currentRT = UnityEngine.RenderTexture.active;
            UnityEngine.RenderTexture.active = camera.targetTexture;

            // Render the camera's view.
            camera.Render();

            // Make a new texture and read the active Render Texture into it.
            UnityEngine.Texture2D image = new UnityEngine.Texture2D(camera.targetTexture.width, camera.targetTexture.height);
            image.ReadPixels(new UnityEngine.Rect(0, 0, camera.targetTexture.width, camera.targetTexture.height), 0, 0);
            image.Apply();

            // Replace the original active Render Texture.
            UnityEngine.RenderTexture.active = currentRT;

            return(image);
        }
コード例 #11
0
        static int _m_CaptureScreenshotIntoRenderTexture_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    UnityEngine.RenderTexture _renderTexture = (UnityEngine.RenderTexture)translator.GetObject(L, 1, typeof(UnityEngine.RenderTexture));

                    UnityEngine.ScreenCapture.CaptureScreenshotIntoRenderTexture(_renderTexture);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #12
0
        static int _m_MarkRestoreExpected(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.RenderTexture __cl_gen_to_be_invoked = (UnityEngine.RenderTexture)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.MarkRestoreExpected(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #13
0
        static int _m_ReleaseTemporary_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    UnityEngine.RenderTexture temp = (UnityEngine.RenderTexture)translator.GetObject(L, 1, typeof(UnityEngine.RenderTexture));

                    UnityEngine.RenderTexture.ReleaseTemporary(temp);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #14
0
        static int _m_SupportsStencil_xlua_st_(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



            try {
                {
                    UnityEngine.RenderTexture rt = (UnityEngine.RenderTexture)translator.GetObject(L, 1, typeof(UnityEngine.RenderTexture));

                    bool __cl_gen_ret = UnityEngine.RenderTexture.SupportsStencil(rt);
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #15
0
        static int _m_GetTexelOffset(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.RenderTexture __cl_gen_to_be_invoked = (UnityEngine.RenderTexture)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Vector2 __cl_gen_ret = __cl_gen_to_be_invoked.GetTexelOffset(  );
                    translator.PushUnityEngineVector2(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #16
0
        static int _m_IsCreated(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.RenderTexture __cl_gen_to_be_invoked = (UnityEngine.RenderTexture)translator.FastGetCSObj(L, 1);


            try {
                {
                    bool __cl_gen_ret = __cl_gen_to_be_invoked.IsCreated(  );
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #17
0
        private static IntPtr EnsureNativePointer(UnityEngine.Texture tex)
        {
            IntPtr nativeTexturePtr = tex.GetNativeTexturePtr();

            if (nativeTexturePtr == IntPtr.Zero)
            {
                UnityEngine.RenderTexture renderTexture = tex as UnityEngine.RenderTexture;
                if (renderTexture != null)
                {
                    renderTexture.Create();
                }

                nativeTexturePtr = tex.GetNativeTexturePtr();
                if (nativeTexturePtr == IntPtr.Zero)
                {
                    throw new System.Exception("Can't create TextureSource, texture native pointer is null");
                }
            }

            return(nativeTexturePtr);
        }
コード例 #18
0
        static int _m_GetNativeDepthBufferPtr(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.RenderTexture __cl_gen_to_be_invoked = (UnityEngine.RenderTexture)translator.FastGetCSObj(L, 1);


            try {
                {
                    System.IntPtr __cl_gen_ret = __cl_gen_to_be_invoked.GetNativeDepthBufferPtr(  );
                    LuaAPI.lua_pushlightuserdata(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #19
0
        static int _m_SetGlobalShaderProperty(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.RenderTexture __cl_gen_to_be_invoked = (UnityEngine.RenderTexture)translator.FastGetCSObj(L, 1);


            try {
                {
                    string propertyName = LuaAPI.lua_tostring(L, 2);

                    __cl_gen_to_be_invoked.SetGlobalShaderProperty(propertyName);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #20
0
        /** 初期化。
         */
        public void Initialize()
        {
            //カメラ取得。
            this.mycamera = this.GetComponent <UnityEngine.Camera>();

            //マテリアル読み込み。
            this.material_blur_x = new UnityEngine.Material(UnityEngine.Resources.Load <UnityEngine.Material>(Config.MATERIAL_NAME_BLURX));
            this.material_blur_y = new UnityEngine.Material(UnityEngine.Resources.Load <UnityEngine.Material>(Config.MATERIAL_NAME_BLURY));

            //比率。
            this.rate_blend = 1.0f;

            //レンダーテクスチャ。
            this.work_rendertexture = null;

                        #if (UNITY_EDITOR)
            {
                float[] t_table      = new float[8];
                float   t_total      = 0.0f;
                float   t_dispersion = 1.0f;
                for (int ii = 0; ii < t_table.Length; ii++)
                {
                    t_table[ii] = UnityEngine.Mathf.Exp(-0.5f * ((float)(ii * ii)) / t_dispersion);
                    t_total    += t_table[ii] * 2;
                }

                float t_check = 0.0f;

                for (int ii = 0; ii < t_table.Length; ii++)
                {
                    t_table[ii] /= t_total;
                    t_check     += t_table[ii];
                    Tool.Log("Blur", "param = " + (t_table[ii] * 10000).ToString());
                }

                Tool.Log("Blur", "0.5f check = " + t_check.ToString());
            }
                        #endif
        }
コード例 #21
0
        static int _m_Capture_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    FairyGUI.DisplayObject    _target  = (FairyGUI.DisplayObject)translator.GetObject(L, 1, typeof(FairyGUI.DisplayObject));
                    UnityEngine.RenderTexture _texture = (UnityEngine.RenderTexture)translator.GetObject(L, 2, typeof(UnityEngine.RenderTexture));
                    UnityEngine.Vector2       _offset; translator.Get(L, 3, out _offset);

                    FairyGUI.CaptureCamera.Capture(_target, _texture, _offset);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #22
0
        static StackObject *Blit_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Material @mat = (UnityEngine.Material) typeof(UnityEngine.Material).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.RenderTexture @dest = (UnityEngine.RenderTexture) typeof(UnityEngine.RenderTexture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Texture @source = (UnityEngine.Texture) typeof(UnityEngine.Texture).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);


            UnityEngine.Graphics.Blit(@source, @dest, @mat);

            return(__ret);
        }
コード例 #23
0
        static int _m_CreateRenderTexture_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    int  _width          = LuaAPI.xlua_tointeger(L, 1);
                    int  _height         = LuaAPI.xlua_tointeger(L, 2);
                    bool _stencilSupport = LuaAPI.lua_toboolean(L, 3);

                    UnityEngine.RenderTexture gen_ret = FairyGUI.CaptureCamera.CreateRenderTexture(_width, _height, _stencilSupport);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #24
0
        static int _m_RenderProbe(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.ReflectionProbe gen_to_be_invoked = (UnityEngine.ReflectionProbe)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1)
                {
                    var gen_ret = gen_to_be_invoked.RenderProbe(  );
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <UnityEngine.RenderTexture>(L, 2))
                {
                    UnityEngine.RenderTexture _targetTexture = (UnityEngine.RenderTexture)translator.GetObject(L, 2, typeof(UnityEngine.RenderTexture));

                    var gen_ret = gen_to_be_invoked.RenderProbe(_targetTexture);
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.ReflectionProbe.RenderProbe!"));
        }
コード例 #25
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 3 && translator.Assignable <UnityEngine.Camera.RenderRequestMode>(L, 2) && translator.Assignable <UnityEngine.RenderTexture>(L, 3))
                {
                    UnityEngine.Camera.RenderRequestMode _mode; translator.Get(L, 2, out _mode);
                    UnityEngine.RenderTexture            _rt = (UnityEngine.RenderTexture)translator.GetObject(L, 3, typeof(UnityEngine.RenderTexture));

                    var gen_ret = new UnityEngine.Camera.RenderRequest(_mode, _rt);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 4 && translator.Assignable <UnityEngine.Camera.RenderRequestMode>(L, 2) && translator.Assignable <UnityEngine.Camera.RenderRequestOutputSpace>(L, 3) && translator.Assignable <UnityEngine.RenderTexture>(L, 4))
                {
                    UnityEngine.Camera.RenderRequestMode        _mode; translator.Get(L, 2, out _mode);
                    UnityEngine.Camera.RenderRequestOutputSpace _space; translator.Get(L, 3, out _space);
                    UnityEngine.RenderTexture _rt = (UnityEngine.RenderTexture)translator.GetObject(L, 4, typeof(UnityEngine.RenderTexture));

                    var gen_ret = new UnityEngine.Camera.RenderRequest(_mode, _space, _rt);
                    translator.Push(L, gen_ret);

                    return(1);
                }

                if (LuaAPI.lua_gettop(L) == 1)
                {
                    translator.Push(L, default(UnityEngine.Camera.RenderRequest));
                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Camera.RenderRequest constructor!"));
        }
コード例 #26
0
        static int _m_DiscardContents(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.RenderTexture __cl_gen_to_be_invoked = (UnityEngine.RenderTexture)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 1)
                {
                    __cl_gen_to_be_invoked.DiscardContents(  );



                    return(0);
                }
                if (__gen_param_count == 3 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    bool discardColor = LuaAPI.lua_toboolean(L, 2);
                    bool discardDepth = LuaAPI.lua_toboolean(L, 3);

                    __cl_gen_to_be_invoked.DiscardContents(discardColor, discardDepth);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.RenderTexture.DiscardContents!"));
        }
コード例 #27
0
        static StackObject *Ctor_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.RenderTextureFormat @format = (UnityEngine.RenderTextureFormat) typeof(UnityEngine.RenderTextureFormat).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @depth = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Int32 @height = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            System.Int32 @width = ptr_of_this_method->Value;


            var result_of_this_method = new UnityEngine.RenderTexture(@width, @height, @depth, @format);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #28
0
        /** OnRenderImage
         */
        private void OnRenderImage(UnityEngine.RenderTexture a_source, UnityEngine.RenderTexture a_dest)
        {
            //レンダリングテクスチャ作成。
            this.work_rendertexture = UnityEngine.RenderTexture.GetTemporary(a_source.width, a_source.height, 0, a_source.format, UnityEngine.RenderTextureReadWrite.Default);

            try{
                //x
                UnityEngine.Graphics.Blit(a_source, this.work_rendertexture, this.material_blur_x);

                //y
                this.material_blur_y.SetFloat("rate_blend", this.rate_blend);
                this.material_blur_y.SetTexture("texture_original", a_source);
                UnityEngine.Graphics.Blit(this.work_rendertexture, a_dest, this.material_blur_y);
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            //レンダーテクスチャ解放。
            if (this.work_rendertexture != null)
            {
                UnityEngine.RenderTexture.ReleaseTemporary(this.work_rendertexture);
                this.work_rendertexture = null;
            }
        }
コード例 #29
0
        static int _m_BlendCubemap_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    UnityEngine.Texture _src          = (UnityEngine.Texture)translator.GetObject(L, 1, typeof(UnityEngine.Texture));
                    UnityEngine.Texture _dst          = (UnityEngine.Texture)translator.GetObject(L, 2, typeof(UnityEngine.Texture));
                    float _blend                      = (float)LuaAPI.lua_tonumber(L, 3);
                    UnityEngine.RenderTexture _target = (UnityEngine.RenderTexture)translator.GetObject(L, 4, typeof(UnityEngine.RenderTexture));

                    var gen_ret = UnityEngine.ReflectionProbe.BlendCubemap(_src, _dst, _blend, _target);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
コード例 #30
0
        static int _m_SetTexture(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.ComputeShader gen_to_be_invoked = (UnityEngine.ComputeShader)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <UnityEngine.Texture>(L, 4))
                {
                    int _kernelIndex             = LuaAPI.xlua_tointeger(L, 2);
                    int _nameID                  = LuaAPI.xlua_tointeger(L, 3);
                    UnityEngine.Texture _texture = (UnityEngine.Texture)translator.GetObject(L, 4, typeof(UnityEngine.Texture));

                    gen_to_be_invoked.SetTexture(_kernelIndex, _nameID, _texture);



                    return(0);
                }
                if (gen_param_count == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <UnityEngine.Texture>(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5))
                {
                    int _kernelIndex             = LuaAPI.xlua_tointeger(L, 2);
                    int _nameID                  = LuaAPI.xlua_tointeger(L, 3);
                    UnityEngine.Texture _texture = (UnityEngine.Texture)translator.GetObject(L, 4, typeof(UnityEngine.Texture));
                    int _mipLevel                = LuaAPI.xlua_tointeger(L, 5);

                    gen_to_be_invoked.SetTexture(_kernelIndex, _nameID, _texture, _mipLevel);



                    return(0);
                }
                if (gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Texture>(L, 4))
                {
                    int    _kernelIndex          = LuaAPI.xlua_tointeger(L, 2);
                    string _name                 = LuaAPI.lua_tostring(L, 3);
                    UnityEngine.Texture _texture = (UnityEngine.Texture)translator.GetObject(L, 4, typeof(UnityEngine.Texture));

                    gen_to_be_invoked.SetTexture(_kernelIndex, _name, _texture);



                    return(0);
                }
                if (gen_param_count == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.Texture>(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5))
                {
                    int    _kernelIndex          = LuaAPI.xlua_tointeger(L, 2);
                    string _name                 = LuaAPI.lua_tostring(L, 3);
                    UnityEngine.Texture _texture = (UnityEngine.Texture)translator.GetObject(L, 4, typeof(UnityEngine.Texture));
                    int _mipLevel                = LuaAPI.xlua_tointeger(L, 5);

                    gen_to_be_invoked.SetTexture(_kernelIndex, _name, _texture, _mipLevel);



                    return(0);
                }
                if (gen_param_count == 6 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <UnityEngine.RenderTexture>(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5) && translator.Assignable <UnityEngine.Rendering.RenderTextureSubElement>(L, 6))
                {
                    int _kernelIndex = LuaAPI.xlua_tointeger(L, 2);
                    int _nameID      = LuaAPI.xlua_tointeger(L, 3);
                    UnityEngine.RenderTexture _texture = (UnityEngine.RenderTexture)translator.GetObject(L, 4, typeof(UnityEngine.RenderTexture));
                    int _mipLevel = LuaAPI.xlua_tointeger(L, 5);
                    UnityEngine.Rendering.RenderTextureSubElement _element; translator.Get(L, 6, out _element);

                    gen_to_be_invoked.SetTexture(_kernelIndex, _nameID, _texture, _mipLevel, _element);



                    return(0);
                }
                if (gen_param_count == 6 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.RenderTexture>(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5) && translator.Assignable <UnityEngine.Rendering.RenderTextureSubElement>(L, 6))
                {
                    int    _kernelIndex = LuaAPI.xlua_tointeger(L, 2);
                    string _name        = LuaAPI.lua_tostring(L, 3);
                    UnityEngine.RenderTexture _texture = (UnityEngine.RenderTexture)translator.GetObject(L, 4, typeof(UnityEngine.RenderTexture));
                    int _mipLevel = LuaAPI.xlua_tointeger(L, 5);
                    UnityEngine.Rendering.RenderTextureSubElement _element; translator.Get(L, 6, out _element);

                    gen_to_be_invoked.SetTexture(_kernelIndex, _name, _texture, _mipLevel, _element);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.ComputeShader.SetTexture!"));
        }