• 打扮家viewport视频


     

     if和else

     

    viewport相关类型

     gameviewportClient

     

     

     

     

    template<ESlateVertexRounding Rounding>
    void FSlateElementBatcher::AddViewportElement( const FSlateDrawElement& DrawElement )
    {
    	const FSlateRenderTransform& RenderTransform = DrawElement.GetRenderTransform();
    	const FVector2D& LocalSize = DrawElement.GetLocalSize();
    	const FSlateViewportPayload& DrawElementPayload = DrawElement.GetDataPayload<FSlateViewportPayload>();
    	ESlateDrawEffect InDrawEffects = DrawElement.GetDrawEffects();
    	const int32 Layer = DrawElement.GetLayer();
    
    	const FColor FinalColor = PackVertexColor(DrawElementPayload.GetTint());
    
    	ESlateBatchDrawFlag DrawFlags = DrawElement.GetBatchFlags();
    
    	FSlateShaderResource* ViewportResource = DrawElementPayload.RenderTargetResource;
    	ESlateShader ShaderType = ESlateShader::Default;
    
    	if(DrawElementPayload.bViewportTextureAlphaOnly )
    	{
    		// This is a slight hack, but the grayscale font shader is the same as the general shader except it reads alpha only textures and doesn't support tiling
    		ShaderType = ESlateShader::GrayscaleFont;
    	}
    
    	FSlateRenderBatch& RenderBatch = CreateRenderBatch( Layer, FShaderParams(), ViewportResource, ESlateDrawPrimitive::TriangleList, ShaderType, InDrawEffects, DrawFlags, DrawElement);
    
    	// Tag this batch as requiring vsync if the viewport requires it.
    	if( ViewportResource != nullptr && !DrawElementPayload.bAllowViewportScaling )
    	{
    		bRequiresVsync |= DrawElementPayload.bRequiresVSync;
    	}
    
    	// Do pixel snapping
    	FVector2D TopLeft(0,0);
    	FVector2D BotRight(LocalSize);
    
    	// If the viewport disallows scaling, force size to current texture size.
    	if (ViewportResource != nullptr && !DrawElementPayload.bAllowViewportScaling)
    	{
    		const float ElementScale = DrawElement.GetScale();
    		BotRight = FVector2D(ViewportResource->GetWidth() / ElementScale, ViewportResource->GetHeight() / ElementScale);
    	}
    
    	FVector2D TopRight = FVector2D( BotRight.X, TopLeft.Y);
    	FVector2D BotLeft =	 FVector2D( TopLeft.X, BotRight.Y);
    
    	// The start index of these vertices in the index buffer
    	const uint32 IndexStart = 0;
    
    	// Add four vertices to the list of verts to be added to the vertex buffer
    	RenderBatch.AddVertex( FSlateVertex::Make<Rounding>( RenderTransform, TopLeft,	FVector2D(0.0f,0.0f),	FinalColor ) );
    	RenderBatch.AddVertex( FSlateVertex::Make<Rounding>( RenderTransform, TopRight,	FVector2D(1.0f,0.0f),	FinalColor ) );
    	RenderBatch.AddVertex( FSlateVertex::Make<Rounding>( RenderTransform, BotLeft,	FVector2D(0.0f,1.0f),	FinalColor ) );
    	RenderBatch.AddVertex( FSlateVertex::Make<Rounding>( RenderTransform, BotRight,	FVector2D(1.0f,1.0f),	FinalColor ) );
    
    	// Add 6 indices to the vertex buffer.  (2 tri's per quad, 3 indices per tri)
    	RenderBatch.AddIndex( IndexStart + 0 );
    	RenderBatch.AddIndex( IndexStart + 1 );
    	RenderBatch.AddIndex( IndexStart + 2 );
    
    	RenderBatch.AddIndex( IndexStart + 2 );
    	RenderBatch.AddIndex( IndexStart + 1 );
    	RenderBatch.AddIndex( IndexStart + 3 );
    }
    

      

  • 相关阅读:
    Spring Boot 使用 Dev-tool 热部署
    Spring Boot 上传文件
    Spring Boot 目录文件结构
    Spring MVC 文件上传
    Spring MVC 混合使用多种视图技术
    XmlViewResolver 和 ResourceBundleViewResolver
    XML 和 Json
    Excel 和 PDF
    04-树5 Root of AVL Tree (25 分)
    04-树4 是否同一棵二叉搜索树 (25 分)
  • 原文地址:https://www.cnblogs.com/Shaojunping/p/16107904.html
Copyright © 2020-2023  润新知