RemoveAllCommandBuffers() private method

private RemoveAllCommandBuffers ( ) : void
return void
コード例 #1
0
 static public int RemoveAllCommandBuffers(IntPtr l)
 {
     try {
         UnityEngine.Light self = (UnityEngine.Light)checkSelf(l);
         self.RemoveAllCommandBuffers();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #2
0
 static int RemoveAllCommandBuffers(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.Light obj = (UnityEngine.Light)ToLua.CheckObject(L, 1, typeof(UnityEngine.Light));
         obj.RemoveAllCommandBuffers();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #3
0
 public static int RemoveAllCommandBuffers_wrap(long L)
 {
     try
     {
         long nThisPtr         = FCLibHelper.fc_get_inport_obj_ptr(L);
         UnityEngine.Light obj = get_obj(nThisPtr);
         obj.RemoveAllCommandBuffers();
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
コード例 #4
0
    static int RemoveAllCommandBuffers(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Light.RemoveAllCommandBuffers");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            UnityEngine.Light obj = (UnityEngine.Light)ToLua.CheckObject(L, 1, typeof(UnityEngine.Light));
            obj.RemoveAllCommandBuffers();
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #5
0
	void EnsureHookedLightSource(Light light) {
		if(!light)
			return;

		if(light.commandBufferCount == 2)
			return;

		//Debug.Log("Hooking scattering command buffers on light source: " + light.name);

		// NOTE: This doesn't really play nicely with other users of light events.
		//       Currently not an issue since this code was written pre-5.1 (and light events
		//       are a new feature in 5.1), but might need a proper solution in the future.
		light.RemoveAllCommandBuffers();

		if(m_occlusionCmdAfterShadows != null)
			m_occlusionCmdAfterShadows.Dispose();
		if(m_occlusionCmdBeforeScreen != null)
			m_occlusionCmdBeforeScreen.Dispose();

		m_occlusionCmdAfterShadows = new UnityEngine.Rendering.CommandBuffer();
		m_occlusionCmdAfterShadows.name = "Scatter Occlusion Pass 1";
		m_occlusionCmdAfterShadows.SetGlobalTexture("u_CascadedShadowMap", new UnityEngine.Rendering.RenderTargetIdentifier(UnityEngine.Rendering.BuiltinRenderTextureType.CurrentActive));
		m_occlusionCmdBeforeScreen = new UnityEngine.Rendering.CommandBuffer();
		m_occlusionCmdBeforeScreen.name = "Scatter Occlusion Pass 2";

		light.AddCommandBuffer(UnityEngine.Rendering.LightEvent.AfterShadowMap, m_occlusionCmdAfterShadows);
		light.AddCommandBuffer(UnityEngine.Rendering.LightEvent.BeforeScreenspaceMask, m_occlusionCmdBeforeScreen);
	}
コード例 #6
0
    /// <summary>
    /// 
    /// </summary>
    void Start()
    {
        _commandBuffer = new CommandBuffer();
        _commandBuffer.name = "Light Command Buffer";

        _cascadeShadowCommandBuffer = new CommandBuffer();
        _cascadeShadowCommandBuffer.name = "Dir Light Command Buffer";
        _cascadeShadowCommandBuffer.SetGlobalTexture("_CascadeShadowMapTexture", new UnityEngine.Rendering.RenderTargetIdentifier(UnityEngine.Rendering.BuiltinRenderTextureType.CurrentActive));

        _light = GetComponent<Light>();
        _light.RemoveAllCommandBuffers();
        if(_light.type == LightType.Directional)
        {
            _light.AddCommandBuffer(LightEvent.BeforeScreenspaceMask, _commandBuffer);
            _light.AddCommandBuffer(LightEvent.AfterShadowMap, _cascadeShadowCommandBuffer);

        }
        else
            _light.AddCommandBuffer(LightEvent.AfterShadowMap, _commandBuffer);

        _material = new Material(Shader.Find("Sandbox/VolumetricLight")); // new Material(VolumetricLightRenderer.GetLightMaterial());
    }