Ara you OK?
我看你是思想出现了偏差
哇!你认出了错别单词!恭喜你获得一次向我支付宝充值助我重返欧洲的机会!
这个页面管关不掉了,你自己看着办吧

UE4笔记-RHI相关

关于C++上的RHI应用的相关笔记记录:

 

 

Q.UE4读取当前视口屏幕(Camera)的像素数组:

参考

FRenderTarget::ReadPixels

对ENQUEUE_RENDER_COMMAND和ReadSurfaceData的使用

    if(InRect == FIntRect(0, 0, 0, 0))
    {
        InRect = FIntRect(0, 0, GetSizeXY().X, GetSizeXY().Y);
    }

    // Read the render target surface data back.    
    struct FReadSurfaceContext
    {
        FRenderTarget* SrcRenderTarget;
        TArray<FColor>* OutData;
        FIntRect Rect;
        FReadSurfaceDataFlags Flags;
    };

    OutImageData.Reset();
    FReadSurfaceContext Context =
    {
        this,
        &OutImageData,
        InRect,
        InFlags
    };

    ENQUEUE_RENDER_COMMAND(ReadSurfaceCommand)(
        [Context](FRHICommandListImmediate& RHICmdList)
        {
            RHICmdList.ReadSurfaceData(
                Context.SrcRenderTarget->GetRenderTargetTexture(),
                Context.Rect,
                *Context.OutData,
                Context.Flags
                );
        });
    FlushRenderingCommands();

    return OutImageData.Num() > 0;

 

posted @ 2022-06-09 10:09  林清  阅读(489)  评论(0编辑  收藏  举报