当前位置: 首页>>代码示例>>C#>>正文


C# dfRenderData.Merge方法代码示例

本文整理汇总了C#中dfRenderData.Merge方法的典型用法代码示例。如果您正苦于以下问题:C# dfRenderData.Merge方法的具体用法?C# dfRenderData.Merge怎么用?C# dfRenderData.Merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dfRenderData的用法示例。


在下文中一共展示了dfRenderData.Merge方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: clipToViewport

    private void clipToViewport( dfRenderData renderData )
    {
        //@Profiler.BeginSample( "Clip markup box to viewport" );

        var planes = getViewportClippingPlanes();

        var material = renderData.Material;
        var matrix = renderData.Transform;

        clipBuffer.Clear();
        dfClippingUtil.Clip( planes, renderData, clipBuffer );

        renderData.Clear();
        renderData.Merge( clipBuffer, false );
        renderData.Material = material;
        renderData.Transform = matrix;

        Profiler.EndSample();
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:19,代码来源:dfRichTextLabel.cs

示例2: processRenderData

    private bool processRenderData( ref dfRenderData buffer, dfRenderData controlData, ref Bounds bounds, ref Rect screenRect, uint checksum, dfTriangleClippingRegion clipInfo, ref bool wasClipped )
    {
        wasClipped = false;

        // This shouldn't happen in practice, but need to make certain
        if( controlData == null || controlData.Material == null || !controlData.IsValid() )
            return false;

        // A new draw call is needed every time the current Material, Texture, or Shader
        // changes. If the control returned a buffer that is not empty and uses a
        // different Material, need to grab a new draw call buffer from the object pool.
        bool needNewDrawcall = false;
        if( buffer == null )
        {
            needNewDrawcall = true;
        }
        else
        {
            if( !Material.Equals( controlData.Material, buffer.Material ) )
            {
                needNewDrawcall = true;
            }
            else if( !textureEqual( controlData.Material.mainTexture, buffer.Material.mainTexture ) )
            {
                needNewDrawcall = true;
            }
            else if( !shaderEqual( buffer.Shader, controlData.Shader ) )
            {
                needNewDrawcall = true;
            }
            else if( !this.clipInfo.IsEmpty && drawCallBuffers.Count == 1 )
            {
                needNewDrawcall = true;
            }
        }

        if( needNewDrawcall )
        {
            buffer = getDrawCallBuffer( controlData.Material );
            buffer.Material = controlData.Material;
            buffer.Material.mainTexture = controlData.Material.mainTexture;
            buffer.Material.shader = controlData.Shader ?? controlData.Material.shader;
        }

        if( !Application.isPlaying || clipType == dfClippingMethod.Software )
        {

            // Ensure that the control's render data is properly clipped to the
            // current clipping region
            if( clipInfo.PerformClipping( buffer, ref bounds, checksum, controlData ) )
            {
                return true;
            }

            // If PerformClipping() returns FALSE, then the control was outside of
            // the active clipping region
            wasClipped = true;

        }
        else
        {
            if( clipRect.IsEmpty() || screenRect.Intersects( clipRect ) )
            {
                buffer.Merge( controlData );
            }
            else
            {
                // Control was not inside of the active clipping rectangle
                wasClipped = true;
            }
        }

        return false;
    }
开发者ID:zc1415926,项目名称:Unity-SelectCharacter-Scene,代码行数:74,代码来源:dfRenderGroup.cs

示例3: clipToViewport

    private void clipToViewport( dfRenderData renderData )
    {
        var planes = getViewportClippingPlanes();

        var material = renderData.Material;
        var matrix = renderData.Transform;

        clipBuffer.Clear();
        dfClippingUtil.Clip( planes, renderData, clipBuffer );

        renderData.Clear();
        renderData.Merge( clipBuffer, false );
        renderData.Material = material;
        renderData.Transform = matrix;
    }
开发者ID:zc1415926,项目名称:Unity-SelectCharacter-Scene,代码行数:15,代码来源:dfRichTextLabel.cs

示例4: clipToPlanes

	public void clipToPlanes( dfList<Plane> planes, dfRenderData data, dfRenderData dest, uint controlChecksum )
	{

		if( data == null || data.Vertices.Count == 0 )
			return;

		if( planes == null || planes.Count == 0 )
		{
			dest.Merge( data );
			return;
		}

		dfClippingUtil.Clip( planes, data, dest );

	}
开发者ID:Elringus,项目名称:StarcorPreAlpha,代码行数:15,代码来源:dfClippingUtil.cs

示例5: PerformClipping

	/// <summary>
	/// Perform triangle clipping on the dfControl's RenderData and append the results
	/// to the destination RenderData
	/// </summary>
	/// <param name="dest">The buffer which will receive the final results</param>
	/// <param name="control">A <see cref="Bounds"/> instance fully enclosing the control</param>
	/// <param name="controlData">The <see cref="RenderData"/> structure generated by the dfControl</param>
	/// <returns>Returns TRUE if the dfControl was rendered, FALSE if it was not (lies entirely outside the clipping region)</returns>
	public bool PerformClipping( dfRenderData dest, ref Bounds bounds, uint checksum, dfRenderData controlData )
	{

		// If there are no clipping planes defined, then simply merge the control's
		// rendering information with the master buffer.
		if( planes == null || planes.Count == 0 )
		{
			dest.Merge( controlData );
			return true;
		}

		// If the RenderData's Checksum matches the dfControl's current checksum 
		// then in the case of a dfControl which was previously determined to be 
		// either entirely inside of all clipping planes or entirely outside
		// of any clipping plane we can skip clipping and intersection testing
		if( controlData.Checksum == checksum )
		{

			if( controlData.Intersection == dfIntersectionType.Inside )
			{
				// Merge the control's rendering information without any clipping
				//@Profiler.BeginSample( "Merge cached buffer - Fully inside" );
				dest.Merge( controlData );
				//@Profiler.EndSample();
				return true;
			}
			else if( controlData.Intersection == dfIntersectionType.None )
			{
				// Control lies entirely outside of the clipping region,
				// no need to include any of its rendering information
				//@Profiler.BeginSample( "Discard cached buffer - No intersection" );
				//@Profiler.EndSample();
				return false;
			}

		}

		var wasRendered = false;

		//@Profiler.BeginSample( "Clipping buffer data" );

		dfIntersectionType intersectionTest;
		var clipPlanes = TestIntersection( bounds, out intersectionTest );

		if( intersectionTest == dfIntersectionType.Inside )
		{
			//@Profiler.BeginSample( "Merging buffer - Fully inside" );
			dest.Merge( controlData );
			//@Profiler.EndSample();
			wasRendered = true;
		}
		else if( intersectionTest == dfIntersectionType.Intersecting )
		{
			//@Profiler.BeginSample( "Clipping intersecting buffer" );
			clipToPlanes( clipPlanes, controlData, dest, checksum );
			//@Profiler.EndSample();
			wasRendered = true;
		}

		controlData.Checksum = checksum;
		controlData.Intersection = intersectionTest;

		//@Profiler.EndSample();
		return wasRendered;

	}
开发者ID:Elringus,项目名称:StarcorPreAlpha,代码行数:74,代码来源:dfClippingUtil.cs

示例6: clipToViewport

 private void clipToViewport(dfRenderData renderData)
 {
     Plane[] clippingPlanes = this.GetClippingPlanes();
     Material material = renderData.Material;
     Matrix4x4 transform = renderData.Transform;
     dfRichTextLabel.clipBuffer.Clear();
     dfClippingUtil.Clip(clippingPlanes, renderData, dfRichTextLabel.clipBuffer);
     renderData.Clear();
     renderData.Merge(dfRichTextLabel.clipBuffer, false);
     renderData.Material = material;
     renderData.Transform = transform;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:12,代码来源:dfRichTextLabel.cs


注:本文中的dfRenderData.Merge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。