示例#1
0
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.Experimental.Rendering.ShaderPassName o;
         if (argc == 2)
         {
             System.String a1;
             checkType(l, 2, out a1);
             o = new UnityEngine.Experimental.Rendering.ShaderPassName(a1);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc <= 2)
         {
             o = new UnityEngine.Experimental.Rendering.ShaderPassName();
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        #pragma warning restore 414

        public DrawRendererSettings(Camera camera, ShaderPassName shaderPassName)
        {
            rendererConfiguration = RendererConfiguration.None;
            flags = DrawRendererFlags.EnableInstancing;

            m_OverrideMaterialInstanceId = 0;
            m_OverrideMaterialPassIdx    = 0;

            fixed(int *p = shaderPassNames)
            {
                for (int i = 0; i < maxShaderPasses; i++)
                {
                    p[i] = -1;
                }
            }

            fixed(int *p = shaderPassNames)
            {
                p[0] = shaderPassName.nameIndex;
            }

            rendererConfiguration = RendererConfiguration.None;
            flags = DrawRendererFlags.EnableInstancing;

            InitializeSortSettings(camera, out sorting);
        }
 public DrawRendererSettings(CullResults cullResults, Camera camera, ShaderPassName shaderPassName)
 {
     this._cullResults          = cullResults.cullResults;
     this.shaderPassName        = shaderPassName;
     this.rendererConfiguration = RendererConfiguration.None;
     this.flags       = DrawRendererFlags.EnableInstancing;
     this.inputFilter = InputFilter.Default();
     DrawRendererSettings.InitializeSortSettings(camera, out this.sorting);
 }
        public void SetShaderPassName(int index, ShaderPassName shaderPassName)
        {
            if (index >= maxShaderPasses || index < 0)
            {
                throw new ArgumentOutOfRangeException("index", string.Format("Index should range from 0 - DrawRendererSettings.maxShaderPasses ({0}), was {1}", maxShaderPasses, index));

                fixed(int *p = shaderPassNames)
                {
                    p[index] = shaderPassName.nameIndex;
                }
        }
        public unsafe void SetShaderPassName(int index, ShaderPassName shaderPassName)
        {
            if (index >= DrawRendererSettings.maxShaderPasses || index < 0)
            {
                throw new ArgumentOutOfRangeException("index", string.Format("Index should range from 0 - DrawRendererSettings.maxShaderPasses ({0}), was {1}", DrawRendererSettings.maxShaderPasses, index));
            }

            fixed(int *ptr = &this.shaderPassNames.FixedElementField)
            {
                ptr[(IntPtr)index * 4] = shaderPassName.nameIndex;
            }
        }
示例#6
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Experimental.Rendering.ShaderPassName o;
         System.String a1;
         checkType(l, 2, out a1);
         o = new UnityEngine.Experimental.Rendering.ShaderPassName(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        public unsafe DrawRendererSettings(Camera camera, ShaderPassName shaderPassName)
        {
            this.rendererConfiguration = RendererConfiguration.None;
            this.flags = DrawRendererFlags.EnableInstancing;
            this.m_OverrideMaterialInstanceId = 0;
            this.m_OverrideMaterialPassIdx    = 0;
            fixed(int *ptr = &this.shaderPassNames.FixedElementField)
            {
                for (int i = 0; i < DrawRendererSettings.maxShaderPasses; i++)
                {
                    ptr[(IntPtr)i * 4] = -1;
                }
            }

            fixed(int *ptr2 = &this.shaderPassNames.FixedElementField)
            {
                *ptr2 = shaderPassName.nameIndex;
            }

            this.rendererConfiguration = RendererConfiguration.None;
            this.flags = DrawRendererFlags.EnableInstancing;
            DrawRendererSettings.InitializeSortSettings(camera, out this.sorting);
        }
示例#8
0
 public ShaderPassName(string name)
 {
     this.nameIndex = ShaderPassName.Init(name);
 }