Exemple #1
0
    static int get_lightProbeUsage(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Renderer obj = (UnityEngine.Renderer)o;
            UnityEngine.Rendering.LightProbeUsage ret = obj.lightProbeUsage;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index lightProbeUsage on a nil value" : e.Message));
        }
    }
    static int get_lightProbeUsage(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Renderer obj = (UnityEngine.Renderer)o;
            UnityEngine.Rendering.LightProbeUsage ret = obj.lightProbeUsage;
            LuaDLL.lua_pushinteger(L, (int)ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index lightProbeUsage on a nil value"));
        }
    }
    static int set_lightProbeUsage(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Renderer obj = (UnityEngine.Renderer)o;
            UnityEngine.Rendering.LightProbeUsage arg0 = (UnityEngine.Rendering.LightProbeUsage)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rendering.LightProbeUsage));
            obj.lightProbeUsage = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index lightProbeUsage on a nil value"));
        }
    }
Exemple #4
0
	static int get_lightProbeUsage(IntPtr L)
	{
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Renderer.lightProbeUsage");
#endif
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			UnityEngine.Renderer obj = (UnityEngine.Renderer)o;
			UnityEngine.Rendering.LightProbeUsage ret = obj.lightProbeUsage;
			ToLua.Push(L, ret);
			return 1;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index lightProbeUsage on a nil value");
		}
	}
Exemple #5
0
	static int set_lightProbeUsage(IntPtr L)
	{
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Renderer.lightProbeUsage");
#endif
		object o = null;

		try
		{
			o = ToLua.ToObject(L, 1);
			UnityEngine.Renderer obj = (UnityEngine.Renderer)o;
			UnityEngine.Rendering.LightProbeUsage arg0 = (UnityEngine.Rendering.LightProbeUsage)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rendering.LightProbeUsage));
			obj.lightProbeUsage = arg0;
			return 0;
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e, o, "attempt to index lightProbeUsage on a nil value");
		}
	}
Exemple #6
0
        public void Reset()
        {
            motionVectorGenerationMode = MotionVectorGenerationMode.Object;
            reflectionProbeUsage       = ReflectionProbeUsage.BlendProbes;
            lightProbeUsage            = LightProbeUsage.Off;
            dynamicOccludee            = true;
#if UNITY_EDITOR
//			lightmapParameters				= new UnityEditor.LightmapParameters();
            importantGI = false;
            optimizeUVs = false;
            ignoreNormalsForChartDetection = false;
            scaleInLightmap    = 1.0f;
            autoUVMaxDistance  = 0.5f;
            autoUVMaxAngle     = 89;
            minimumChartSize   = 4;
            renderingLayerMask = ~(uint)0;
#if UNITY_2017_2_OR_ABOVE
            stitchLightmapSeams = false;
#endif
#endif
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="binaryReader"></param>
        public override void Deserialize(BinaryReader binaryReader)
        {
            base.Deserialize(binaryReader);

#if UNITY_2019_1_OR_NEWER
            m_forceRenderingOff = binaryReader.ReadBoolean();
            m_rayTracingMode    = (UnityEngine.Experimental.Rendering.RayTracingMode)binaryReader.ReadInt32();
#endif
            m_lightProbeUsage            = (UnityEngine.Rendering.LightProbeUsage)binaryReader.ReadInt32();
            m_motionVectorGenerationMode = (MotionVectorGenerationMode)binaryReader.ReadInt32();
            m_reflectionProbeUsage       = (UnityEngine.Rendering.ReflectionProbeUsage)binaryReader.ReadInt32();
            m_shadowCastingMode          = (UnityEngine.Rendering.ShadowCastingMode)binaryReader.ReadInt32();
            m_lightmapIndex                 = binaryReader.ReadInt32();
            m_rendererPriority              = binaryReader.ReadInt32();
            m_realtimeLightmapIndex         = binaryReader.ReadInt32();
            m_sortingLayerID                = binaryReader.ReadInt32();
            m_sortingOrder                  = binaryReader.ReadInt32();
            m_renderingLayerMask            = binaryReader.ReadUInt32();
            m_lightProbeProxyVolumeOverride = binaryReader.ReadString();
            m_sortingLayerName              = binaryReader.ReadString();
            m_receiveShadows                = binaryReader.ReadBoolean();
            m_allowOcclusionWhenDynamic     = binaryReader.ReadBoolean();
            m_enabled             = binaryReader.ReadBoolean();
            m_isPartOfStaticBatch = binaryReader.ReadBoolean();
            m_isVisible           = binaryReader.ReadBoolean();
            m_bounds                      = SerializerKun.DesirializeObject <BoundsKun>(binaryReader);
            m_probeAnchor                 = SerializerKun.DesirializeObject <TransformKun>(binaryReader);
            m_lightmapScaleOffset         = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader);
            m_realtimeLightmapScaleOffset = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader);
            m_localToWorldMatrix          = SerializerKun.DesirializeObject <Matrix4x4Kun>(binaryReader);
            m_worldToLocalMatrix          = SerializerKun.DesirializeObject <Matrix4x4Kun>(binaryReader);
            m_material                    = SerializerKun.DesirializeObject <MaterialKun>(binaryReader);
            m_sharedMaterial              = SerializerKun.DesirializeObject <MaterialKun>(binaryReader);
            m_materials                   = SerializerKun.DesirializeObjects <MaterialKun>(binaryReader);
            m_sharedMaterials             = SerializerKun.DesirializeObjects <MaterialKun>(binaryReader);
        }
Exemple #8
0
 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, List <Matrix4x4> matrices, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage)
 {
     DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, null);
 }
Exemple #9
0
 public static void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int layer, Camera camera, int submeshIndex, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, Transform probeAnchor, LightProbeUsage lightProbeUsage)
 {
     Internal_DrawMesh(mesh, submeshIndex, matrix, material, layer, camera, properties, castShadows, receiveShadows, probeAnchor, lightProbeUsage, null);
 }
 extern internal static void Internal_DrawMeshInstancedIndirect(Mesh mesh, int submeshIndex, Material material, Bounds bounds, ComputeBuffer bufferWithArgs, int argsOffset, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage, LightProbeProxyVolume lightProbeProxyVolume);
 extern internal static void Internal_DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage, LightProbeProxyVolume lightProbeProxyVolume);
        public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, List <Matrix4x4> matrices, [uei.DefaultValue("null")] MaterialPropertyBlock properties, [uei.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows, [uei.DefaultValue("true")] bool receiveShadows, [uei.DefaultValue("0")] int layer, [uei.DefaultValue("null")] Camera camera, [uei.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage, [uei.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
        {
            if (matrices == null)
            {
                throw new ArgumentNullException("matrices");
            }

            DrawMeshInstanced(mesh, submeshIndex, material, NoAllocHelpers.ExtractArrayFromListT(matrices), matrices.Count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
        }
        public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, [uei.DefaultValue("matrices.Length")] int count, [uei.DefaultValue("null")] MaterialPropertyBlock properties, [uei.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows, [uei.DefaultValue("true")] bool receiveShadows, [uei.DefaultValue("0")] int layer, [uei.DefaultValue("null")] Camera camera, [uei.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage, [uei.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
        {
            if (!SystemInfo.supportsInstancing)
            {
                throw new InvalidOperationException("Instancing is not supported.");
            }
            else if (mesh == null)
            {
                throw new ArgumentNullException("mesh");
            }
            else if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
            {
                throw new ArgumentOutOfRangeException("submeshIndex", "submeshIndex out of range.");
            }
            else if (material == null)
            {
                throw new ArgumentNullException("material");
            }
            else if (!material.enableInstancing)
            {
                throw new InvalidOperationException("Material needs to enable instancing for use with DrawMeshInstanced.");
            }
            else if (matrices == null)
            {
                throw new ArgumentNullException("matrices");
            }
            else if (count < 0 || count > Mathf.Min(kMaxDrawMeshInstanceCount, matrices.Length))
            {
                throw new ArgumentOutOfRangeException("count", String.Format("Count must be in the range of 0 to {0}.", Mathf.Min(kMaxDrawMeshInstanceCount, matrices.Length)));
            }
            else if (lightProbeUsage == LightProbeUsage.UseProxyVolume && lightProbeProxyVolume == null)
            {
                throw new ArgumentException("lightProbeProxyVolume", "Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.");
            }

            if (count > 0)
            {
                Internal_DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
            }
        }
 extern internal static void Internal_DrawMesh(Mesh mesh, int submeshIndex, Matrix4x4 matrix, Material material, int layer, Camera camera, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, Transform probeAnchor, LightProbeUsage lightProbeUsage, LightProbeProxyVolume lightProbeProxyVolume);
 public static void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int layer, Camera camera, int submeshIndex, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, Transform probeAnchor, LightProbeUsage lightProbeUsage, [uei.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
 {
     if (lightProbeUsage == LightProbeUsage.UseProxyVolume && lightProbeProxyVolume == null)
     {
         throw new ArgumentException("lightProbeProxyVolume", "Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.");
     }
     Internal_DrawMesh(mesh, submeshIndex, matrix, material, layer, camera, properties, castShadows, receiveShadows, probeAnchor, lightProbeUsage, lightProbeProxyVolume);
 }
Exemple #16
0
 public static void DrawMeshInstancedIndirect(Mesh mesh, int submeshIndex, Material material, Bounds bounds, ComputeBuffer bufferWithArgs, int argsOffset, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage)
 {
     DrawMeshInstancedIndirect(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, null);
 }
        public static void DrawMeshInstancedIndirect(Mesh mesh, int submeshIndex, Material material, Bounds bounds, ComputeBuffer bufferWithArgs, [uei.DefaultValue("0")] int argsOffset, [uei.DefaultValue("null")] MaterialPropertyBlock properties, [uei.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows, [uei.DefaultValue("true")] bool receiveShadows, [uei.DefaultValue("0")] int layer, [uei.DefaultValue("null")] Camera camera, [uei.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage, [uei.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
        {
            if (!SystemInfo.supportsInstancing)
            {
                throw new InvalidOperationException("Instancing is not supported.");
            }
            else if (mesh == null)
            {
                throw new ArgumentNullException("mesh");
            }
            else if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
            {
                throw new ArgumentOutOfRangeException("submeshIndex", "submeshIndex out of range.");
            }
            else if (material == null)
            {
                throw new ArgumentNullException("material");
            }
            else if (bufferWithArgs == null)
            {
                throw new ArgumentNullException("bufferWithArgs");
            }
            if (lightProbeUsage == LightProbeUsage.UseProxyVolume && lightProbeProxyVolume == null)
            {
                throw new ArgumentException("lightProbeProxyVolume", "Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.");
            }

            Internal_DrawMeshInstancedIndirect(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
        }
Exemple #18
0
 public static void DrawMeshInstancedIndirect(Mesh mesh, int submeshIndex, Material material, Bounds bounds, GraphicsBuffer bufferWithArgs, int argsOffset = 0, MaterialPropertyBlock properties = null, ShadowCastingMode castShadows = ShadowCastingMode.On, bool receiveShadows = true, int layer = 0, Camera camera = null, LightProbeUsage lightProbeUsage = LightProbeUsage.BlendProbes)
 {
     DrawMeshInstancedIndirect(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, null);
 }