本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
示例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;
}