SetGlobalFloat() private method

private SetGlobalFloat ( int nameID, float value ) : void
nameID int
value float
return void
 static public int SetGlobalFloat(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(int), typeof(float)))
         {
             UnityEngine.Rendering.CommandBuffer self = (UnityEngine.Rendering.CommandBuffer)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             self.SetGlobalFloat(a1, a2);
             return(0);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(float)))
         {
             UnityEngine.Rendering.CommandBuffer self = (UnityEngine.Rendering.CommandBuffer)checkSelf(l);
             System.String a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             self.SetGlobalFloat(a1, a2);
             return(0);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #2
0
 internal override void RenderVectors(Camera camera, CommandBuffer renderCB, float scale, Quality quality)
 {
     if (this.m_initialized && !this.m_error && this.m_meshRenderer.isVisible)
     {
         bool flag = (this.m_owner.Instance.CullingMask & 1 << this.m_obj.gameObject.layer) != 0;
         if (!flag || (flag && this.m_moved))
         {
             int num = (!flag) ? 255 : this.m_owner.Instance.GenerateObjectId(this.m_obj.gameObject);
             Matrix4x4 value;
             if (this.m_obj.FixedStep)
             {
                 value = this.m_owner.PrevViewProjMatrixRT * this.m_currLocalToWorld;
             }
             else
             {
                 value = this.m_owner.PrevViewProjMatrixRT * this.m_prevLocalToWorld;
             }
             renderCB.SetGlobalMatrix("_AM_MATRIX_PREV_MVP", value);
             renderCB.SetGlobalFloat("_AM_OBJECT_ID", (float)num * 0.003921569f);
             renderCB.SetGlobalFloat("_AM_MOTION_SCALE", (!flag) ? 0f : scale);
             int num2 = (quality != Quality.Mobile) ? 2 : 0;
             for (int i = 0; i < this.m_sharedMaterials.Length; i++)
             {
                 MotionState.MaterialDesc materialDesc = this.m_sharedMaterials[i];
                 int shaderPass = num2 + ((!materialDesc.coverage) ? 0 : 1);
                 if (materialDesc.coverage)
                 {
                     Texture mainTexture = materialDesc.material.mainTexture;
                     if (mainTexture != null)
                     {
                         materialDesc.propertyBlock.SetTexture("_MainTex", mainTexture);
                     }
                     if (materialDesc.cutoff)
                     {
                         materialDesc.propertyBlock.SetFloat("_Cutoff", materialDesc.material.GetFloat("_Cutoff"));
                     }
                 }
                 renderCB.DrawMesh(this.m_mesh, this.m_transform.localToWorldMatrix, this.m_owner.Instance.SolidVectorsMaterial, i, shaderPass, materialDesc.propertyBlock);
             }
         }
     }
 }
Example #3
0
 internal override void RenderVectors(Camera camera, CommandBuffer renderCB, float scale, Quality quality)
 {
     if (this.m_initialized && !this.m_error && this.m_renderer.isVisible)
     {
         bool flag = (this.m_owner.Instance.CullingMask & 1 << this.m_obj.gameObject.layer) != 0;
         int num = (!flag) ? 255 : this.m_owner.Instance.GenerateObjectId(this.m_obj.gameObject);
         Vector3[] vertices = this.m_cloth.vertices;
         for (int i = 0; i < this.m_targetVertexCount; i++)
         {
             this.m_currVertices[i] = vertices[this.m_targetRemap[i]];
         }
         if (this.m_starting || !this.m_wasVisible)
         {
             Array.Copy(this.m_currVertices, this.m_prevVertices, this.m_targetVertexCount);
         }
         this.m_clonedMesh.vertices = this.m_currVertices;
         this.m_clonedMesh.normals = this.m_prevVertices;
         Matrix4x4 value;
         if (this.m_obj.FixedStep)
         {
             value = this.m_owner.PrevViewProjMatrixRT * this.m_currLocalToWorld;
         }
         else
         {
             value = this.m_owner.PrevViewProjMatrixRT * this.m_prevLocalToWorld;
         }
         renderCB.SetGlobalMatrix("_AM_MATRIX_PREV_MVP", value);
         renderCB.SetGlobalFloat("_AM_OBJECT_ID", (float)num * 0.003921569f);
         renderCB.SetGlobalFloat("_AM_MOTION_SCALE", (!flag) ? 0f : scale);
         int num2 = (quality != Quality.Mobile) ? 2 : 0;
         for (int j = 0; j < this.m_sharedMaterials.Length; j++)
         {
             MotionState.MaterialDesc materialDesc = this.m_sharedMaterials[j];
             int shaderPass = num2 + ((!materialDesc.coverage) ? 0 : 1);
             if (materialDesc.coverage)
             {
                 Texture mainTexture = materialDesc.material.mainTexture;
                 if (mainTexture != null)
                 {
                     materialDesc.propertyBlock.SetTexture("_MainTex", mainTexture);
                 }
                 if (materialDesc.cutoff)
                 {
                     materialDesc.propertyBlock.SetFloat("_Cutoff", materialDesc.material.GetFloat("_Cutoff"));
                 }
             }
             renderCB.DrawMesh(this.m_clonedMesh, this.m_currLocalToWorld, this.m_owner.Instance.ClothVectorsMaterial, j, shaderPass, materialDesc.propertyBlock);
         }
     }
 }
        private void CloneToBuffer(Material mat, CommandBuffer buf)
        {
            foreach (KeyValuePair<object, object> field in cache)
            {
                object obj = field.Value;
                //float
                int id = (int)field.Key;
                if (obj.GetType() == typeof(float))
                {
                    float value = mat.GetFloat(id);
                    buf.SetGlobalFloat(id, value);
                }
                //Color
                else if (obj.GetType() == typeof(Color))
                {
                    Color value = mat.GetColor(id);
                    buf.SetGlobalColor(id, value);
                }
                //Color32
                else if (obj.GetType() == typeof(Color32))
                {
                    Color value = mat.GetColor(id);
                    buf.SetGlobalColor(id, value);
                }//Vector2
                else if (obj.GetType() == typeof(Vector2))
                {
                    Vector4 value = mat.GetVector(id);
                    buf.SetGlobalVector(id, value);
                }
                //Vector3
                else if (obj.GetType() == typeof(Vector3))
                {
                    Vector4 value = mat.GetVector(id);
                    buf.SetGlobalVector(id, value);
                }
                //Vector4
                else if (obj.GetType() == typeof(Vector4))
                {
                    Vector4 value = mat.GetVector(id);
                    buf.SetGlobalVector(id, value);
                }
                //Matrix
                else if (obj.GetType() == typeof(Matrix4x4))
                {
                    Matrix4x4 value = mat.GetMatrix(id);
                    buf.SetGlobalMatrix(id, value);
                }

            }
        }
	void RenderReprojectionVectors( CommandBuffer commandBuffer, RenderTexture destination, float scale )
	{
		commandBuffer.SetGlobalMatrix( "_AM_MATRIX_CURR_REPROJ", m_baseCamera.PrevViewProjMatrix * m_baseCamera.InvViewProjMatrix );
		commandBuffer.SetGlobalFloat( "_AM_MOTION_SCALE", scale );

		RenderTexture dummy = null;
		commandBuffer.Blit( new RenderTargetIdentifier( dummy ), destination, m_reprojectionMaterial );
	}
    private void CreateCommandBuffers()
    {
        m_renderCmdBuffer = new CommandBuffer();
        m_renderCmdBuffer.name = "Highlights: Drawing Objects";

        // Drawing objects to the buffer
        m_renderCmdBuffer.SetRenderTarget(m_colorRT, BuiltinRenderTextureType.CameraTarget);
        m_renderCmdBuffer.ClearRenderTarget(false, true, Color.clear);

        var pass = m_selectionType == HighlightType.Glow ? HighlightPass.MarkStencilArea : HighlightPass.DrawSolid;
        foreach(var hObject in m_renderers)
        {
            m_renderCmdBuffer.SetGlobalColor("_Color", hObject.Value);
            m_renderCmdBuffer.SetGlobalFloat("_Cutoff",  m_cutoffValue * 0.5f);
            m_renderCmdBuffer.DrawRenderer(hObject.Key, m_highlightMaterial, 0, (int) pass);
        }
            
        foreach(var hObject in m_renderers)
        {
            m_renderCmdBuffer.SetGlobalColor("_Color", hObject.Value);
            m_renderCmdBuffer.DrawRenderer(hObject.Key, m_highlightMaterial, 0, (int) HighlightPass.ExtrudeOutline);
        }

        var drawEvent = GetCameraDrawEvent();
        m_camera.AddCommandBuffer(drawEvent, m_renderCmdBuffer);
    }
Example #7
0
	internal override void RenderVectors( Camera camera, CommandBuffer renderCB, float scale, AmplifyMotion.Quality quality )
	{
		if ( m_initialized && !m_error && m_renderer.isVisible )
		{
			Profiler.BeginSample( "Skinned.Update" );

			if ( !m_useFallback )
			{
				if ( !m_useGPU )
					WaitForAsyncUpdate();
			}

			Profiler.EndSample();

			Profiler.BeginSample( "Skinned.Render" );
			if ( !m_useGPU )
			{
				if ( !m_useFallback )
					m_clonedMesh.vertices = m_currVertices;
				m_clonedMesh.normals = m_prevVertices;
			}

			const float rcp255 = 1 / 255.0f;
			bool mask = ( m_owner.Instance.CullingMask & ( 1 << m_obj.gameObject.layer ) ) != 0;
			int objectId = mask ? m_owner.Instance.GenerateObjectId( m_obj.gameObject ) : 255;

			Matrix4x4 prevModelViewProj;
			if ( m_obj.FixedStep )
				prevModelViewProj = m_owner.PrevViewProjMatrixRT * m_currLocalToWorld;
			else
				prevModelViewProj = m_owner.PrevViewProjMatrixRT * m_prevLocalToWorld;

			renderCB.SetGlobalMatrix( "_AM_MATRIX_PREV_MVP", prevModelViewProj );
			renderCB.SetGlobalFloat( "_AM_OBJECT_ID", objectId * rcp255 );
			renderCB.SetGlobalFloat( "_AM_MOTION_SCALE", mask ? scale : 0 );

			if ( m_useGPU )
			{
			#if !UNITY_4
				Vector4 vertexTexelSize = new Vector4( 1.0f / m_gpuVertexTexWidth, 1.0f / m_gpuVertexTexHeight, m_gpuVertexTexWidth, m_gpuVertexTexHeight );

				renderCB.SetGlobalVector( "_AM_VERTEX_TEXEL_SIZE", vertexTexelSize );
				renderCB.SetGlobalVector( "_AM_VERTEX_TEXEL_HALFSIZE", vertexTexelSize * 0.5f );

				renderCB.SetGlobalTexture( "_AM_PREV_VERTEX_TEX", m_gpuPrevVertices );
				renderCB.SetGlobalTexture( "_AM_CURR_VERTEX_TEX", m_gpuCurrVertices );
			#endif
			}

			int hardwarePass = m_useGPU ? 4 : 0;
			int qualityPass = ( quality == AmplifyMotion.Quality.Mobile ) ? 0 : 2;
			int basePass = hardwarePass + qualityPass;

			for ( int i = 0; i < m_sharedMaterials.Length; i++ )
			{
				MaterialDesc matDesc = m_sharedMaterials[ i ];
				int pass = basePass + ( matDesc.coverage ? 1 : 0 );

				if ( matDesc.coverage )
				{
					Texture mainTex = matDesc.material.mainTexture;
					if ( mainTex != null )
						matDesc.propertyBlock.SetTexture( "_MainTex", mainTex );
					if ( matDesc.cutoff )
						matDesc.propertyBlock.SetFloat( "_Cutoff", matDesc.material.GetFloat( "_Cutoff" ) );
				}

				renderCB.DrawMesh( m_clonedMesh, m_currLocalToWorld, m_owner.Instance.SkinnedVectorsMaterial, i, pass, matDesc.propertyBlock );
			}

			Profiler.EndSample();
		}
	}
Example #8
0
        // [ImageEffectOpaque]
        public void OnPreRender()
        {
            if (material == null)
            {
                return;
            }
            else if (Camera.current.actualRenderingPath != RenderingPath.DeferredShading)
            {
                return;
            }

            int downsampleAmount = (settings.reflectionSettings.reflectionQuality == SSRResolution.High) ? 1 : 2;

            var rtW = camera_.pixelWidth / downsampleAmount;
            var rtH = camera_.pixelHeight / downsampleAmount;

            float sWidth = camera_.pixelWidth;
            float sHeight = camera_.pixelHeight;

            float sx = sWidth / 2.0f;
            float sy = sHeight / 2.0f;

            const int maxMip = 5;

            RenderTextureFormat intermediateFormat = camera_.hdr ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.ARGB32;

            material.SetInt("_RayStepSize", settings.reflectionSettings.stepSize);
            material.SetInt("_AdditiveReflection", settings.reflectionSettings.blendType == SSRReflectionBlendType.Additive ? 1 : 0);
            material.SetInt("_BilateralUpsampling", bilateralUpsample ? 1 : 0);
            material.SetInt("_TreatBackfaceHitAsMiss", treatBackfaceHitAsMiss ? 1 : 0);
            material.SetInt("_AllowBackwardsRays", settings.reflectionSettings.reflectBackfaces ? 1 : 0);
            material.SetInt("_TraceBehindObjects", traceBehindObjects ? 1 : 0);
            material.SetInt("_MaxSteps", settings.reflectionSettings.iterationCount);
            material.SetInt("_FullResolutionFiltering", 0);
            material.SetInt("_HalfResolution", (settings.reflectionSettings.reflectionQuality != SSRResolution.High) ? 1 : 0);
            material.SetInt("_HighlightSuppression", highlightSuppression ? 1 : 0);

            /** The height in pixels of a 1m object if viewed from 1m away. */
            float pixelsPerMeterAtOneMeter = sWidth / (-2.0f * (float)(Math.Tan(camera_.fieldOfView / 180.0 * Math.PI * 0.5)));

            material.SetFloat("_PixelsPerMeterAtOneMeter", pixelsPerMeterAtOneMeter);
            material.SetFloat("_ScreenEdgeFading", settings.screenEdgeMask.intensity);
            material.SetFloat("_ReflectionBlur", settings.reflectionSettings.reflectionBlur);
            material.SetFloat("_MaxRayTraceDistance", settings.reflectionSettings.maxDistance);
            material.SetFloat("_FadeDistance", settings.intensitySettings.fadeDistance);
            material.SetFloat("_LayerThickness", settings.reflectionSettings.widthModifier);
            material.SetFloat("_SSRMultiplier", settings.intensitySettings.reflectionMultiplier);
            material.SetFloat("_FresnelFade", settings.intensitySettings.fresnelFade);
            material.SetFloat("_FresnelFadePower", settings.intensitySettings.fresnelFadePower);

            Matrix4x4 P = camera_.projectionMatrix;
            Vector4 projInfo = new Vector4
                    ((-2.0f / (sWidth * P[0])),
                    (-2.0f / (sHeight * P[5])),
                    ((1.0f - P[2]) / P[0]),
                    ((1.0f + P[6]) / P[5]));

            Vector3 cameraClipInfo = (float.IsPositiveInfinity(camera_.farClipPlane)) ?
                new Vector3(camera_.nearClipPlane, -1.0f, 1.0f) :
                new Vector3(camera_.nearClipPlane * camera_.farClipPlane, camera_.nearClipPlane - camera_.farClipPlane, camera_.farClipPlane);

            material.SetVector("_ReflectionBufferSize", new Vector2(rtW, rtH));
            material.SetVector("_ScreenSize", new Vector2(sWidth, sHeight));
            material.SetVector("_InvScreenSize", new Vector2((float)(1.0f / sWidth), (float)(1.0f / sHeight)));
            material.SetVector("_ProjInfo", projInfo); // used for unprojection

            material.SetVector("_CameraClipInfo", cameraClipInfo);

            Matrix4x4 warpToScreenSpaceMatrix = new Matrix4x4();
            warpToScreenSpaceMatrix.SetRow(0, new Vector4(sx, 0.0f, 0.0f, sx));
            warpToScreenSpaceMatrix.SetRow(1, new Vector4(0.0f, sy, 0.0f, sy));
            warpToScreenSpaceMatrix.SetRow(2, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
            warpToScreenSpaceMatrix.SetRow(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

            Matrix4x4 projectToPixelMatrix = warpToScreenSpaceMatrix * P;

            material.SetMatrix("_ProjectToPixelMatrix", projectToPixelMatrix);
            material.SetMatrix("_WorldToCameraMatrix", camera_.worldToCameraMatrix);
            material.SetMatrix("_CameraToWorldMatrix", camera_.worldToCameraMatrix.inverse);

            if (m_CommandBuffer == null)
            {
                m_CommandBuffer = new CommandBuffer();
                m_CommandBuffer.name = "Screen Space Reflections";

                // RGB: Normals, A: Roughness.
                // Has the nice benefit of allowing us to control the filtering mode as well.
                m_CommandBuffer.GetTemporaryRT(kNormalAndRoughnessTexture, -1, -1, 0, FilterMode.Point, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);

                m_CommandBuffer.GetTemporaryRT(kHitPointTexture, rtW, rtH, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);

                for (int i = 0; i < maxMip; ++i)
                {
                    // We explicitly interpolate during bilateral upsampling.
                    m_CommandBuffer.GetTemporaryRT(kReflectionTextures[i], rtW >> i, rtH >> i, 0, FilterMode.Bilinear, intermediateFormat);
                }

                m_CommandBuffer.GetTemporaryRT(kFilteredReflections, rtW, rtH, 0, bilateralUpsample ? FilterMode.Point : FilterMode.Bilinear, intermediateFormat);
                m_CommandBuffer.GetTemporaryRT(kFinalReflectionTexture, rtW, rtH, 0, FilterMode.Point, intermediateFormat);

                m_CommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, kNormalAndRoughnessTexture, material, (int)PassIndex.BilateralKeyPack);
                m_CommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, kHitPointTexture, material, (int)PassIndex.RayTraceStep);
                m_CommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, kFilteredReflections, material, (int)PassIndex.HitPointToReflections);
                m_CommandBuffer.Blit(kFilteredReflections, kReflectionTextures[0], material, (int)PassIndex.PoissonBlur);

                for (int i = 1; i < maxMip; ++i)
                {
                    int inputTex = kReflectionTextures[i - 1];

                    int lowMip = i;

                    m_CommandBuffer.GetTemporaryRT(kBlurTexture, rtW >> lowMip, rtH >> lowMip, 0, FilterMode.Bilinear, intermediateFormat);
                    m_CommandBuffer.SetGlobalVector("_Axis", new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
                    m_CommandBuffer.SetGlobalFloat("_CurrentMipLevel", i - 1.0f);

                    m_CommandBuffer.Blit(inputTex, kBlurTexture, material, (int)PassIndex.Blur);

                    m_CommandBuffer.SetGlobalVector("_Axis", new Vector4(0.0f, 1.0f, 0.0f, 0.0f));

                    inputTex = kReflectionTextures[i];
                    m_CommandBuffer.Blit(kBlurTexture, inputTex, material, (int)PassIndex.Blur);
                    m_CommandBuffer.ReleaseTemporaryRT(kBlurTexture);
                }

                m_CommandBuffer.Blit(kReflectionTextures[0], kFinalReflectionTexture, material, (int)PassIndex.CompositeSSR);

                m_CommandBuffer.GetTemporaryRT(kTempTexture, camera_.pixelWidth, camera_.pixelHeight, 0, FilterMode.Bilinear, intermediateFormat);

                m_CommandBuffer.Blit(BuiltinRenderTextureType.CameraTarget, kTempTexture, material, (int)PassIndex.CompositeFinal);
                m_CommandBuffer.Blit(kTempTexture, BuiltinRenderTextureType.CameraTarget);


                m_CommandBuffer.ReleaseTemporaryRT(kTempTexture);
                camera_.AddCommandBuffer(CameraEvent.AfterFinalPass, m_CommandBuffer);
            }
        }
Example #9
0
	internal override void RenderVectors( Camera camera, CommandBuffer renderCB, float scale, AmplifyMotion.Quality quality )
	{
		if ( m_initialized && !m_error && m_meshRenderer.isVisible )
		{
			Profiler.BeginSample( "Solid.Render" );

			bool mask = ( m_owner.Instance.CullingMask & ( 1 << m_obj.gameObject.layer ) ) != 0;
			if ( !mask || ( mask && m_moved ) )
			{
				const float rcp255 = 1 / 255.0f;
				int objectId = mask ? m_owner.Instance.GenerateObjectId( m_obj.gameObject ) : 255;

				Matrix4x4 prevModelViewProj;
				if ( m_obj.FixedStep )
					prevModelViewProj = m_owner.PrevViewProjMatrixRT * m_currLocalToWorld;
				else
					prevModelViewProj = m_owner.PrevViewProjMatrixRT * m_prevLocalToWorld;

				renderCB.SetGlobalMatrix( "_AM_MATRIX_PREV_MVP", prevModelViewProj );
				renderCB.SetGlobalFloat( "_AM_OBJECT_ID", objectId * rcp255 );
				renderCB.SetGlobalFloat( "_AM_MOTION_SCALE", mask ? scale : 0 );

				// TODO: cache property blocks

				int qualityPass = ( quality == AmplifyMotion.Quality.Mobile ) ? 0 : 2;

				for ( int i = 0; i < m_sharedMaterials.Length; i++ )
				{
					MaterialDesc matDesc = m_sharedMaterials[ i ];
					int pass = qualityPass + ( matDesc.coverage ? 1 : 0 );

					if ( matDesc.coverage )
					{
						Texture mainTex = matDesc.material.mainTexture;
						if ( mainTex != null )
							matDesc.propertyBlock.SetTexture( "_MainTex", mainTex );
						if ( matDesc.cutoff )
							matDesc.propertyBlock.SetFloat( "_Cutoff", matDesc.material.GetFloat( "_Cutoff" ) );
					}

					renderCB.DrawMesh( m_mesh, m_transform.localToWorldMatrix, m_owner.Instance.SolidVectorsMaterial, i, pass, matDesc.propertyBlock );
				}
			}

			Profiler.EndSample();
		}
	}
Example #10
0
	internal override void RenderVectors( Camera camera, CommandBuffer renderCB, float scale, AmplifyMotion.Quality quality )
	{
		Profiler.BeginSample( "Particle.Render" );

		// TODO: batch

		if ( m_initialized && !m_error && m_renderer.isVisible )
		{
			bool mask = ( m_owner.Instance.CullingMask & ( 1 << m_obj.gameObject.layer ) ) != 0;
			if ( !mask || ( mask && m_moved ) )
			{
				const float rcp255 = 1 / 255.0f;
				int objectId = mask ? m_owner.Instance.GenerateObjectId( m_obj.gameObject ) : 255;

				renderCB.SetGlobalFloat( "_AM_OBJECT_ID", objectId * rcp255 );
				renderCB.SetGlobalFloat( "_AM_MOTION_SCALE", mask ? scale : 0 );

				int qualityPass = ( quality == AmplifyMotion.Quality.Mobile ) ? 0 : 2;

				for ( int i = 0; i < m_sharedMaterials.Length; i++ )
				{
					MaterialDesc matDesc = m_sharedMaterials[ i ];
					int pass = qualityPass + ( matDesc.coverage ? 1 : 0 );

					if ( matDesc.coverage )
					{
						Texture mainTex = matDesc.material.mainTexture;
						if ( mainTex != null )
							matDesc.propertyBlock.SetTexture( "_MainTex", mainTex );
						if ( matDesc.cutoff )
							matDesc.propertyBlock.SetFloat( "_Cutoff", matDesc.material.GetFloat( "_Cutoff" ) );
					}

					var enumerator = m_particleDict.GetEnumerator();
					while ( enumerator.MoveNext() )
					{
						KeyValuePair<uint, Particle> pair = enumerator.Current;

						Matrix4x4 prevModelViewProj = m_owner.PrevViewProjMatrixRT * pair.Value.prevLocalToWorld;
						renderCB.SetGlobalMatrix( "_AM_MATRIX_PREV_MVP", prevModelViewProj );

						renderCB.DrawMesh( m_mesh, pair.Value.currLocalToWorld, m_owner.Instance.SolidVectorsMaterial, i, pass, matDesc.propertyBlock );
					}
				}
			}
		}

		Profiler.EndSample();
	}