https://blog.uwa4d.com/archives/TechSharing_198.html
https://blog.uwa4d.com/archives/UWA_GOLOverview.html // GPU性能测试
用到了renderfeature,发现打包到安卓真机上会出现花屏,网上搜资料说是Don‘ care的问题,有点地方还真的可不能不care,要care的,把care方式设为true就好了
解决方案
// cmd.ClearRenderTarget(true, false, Color.clear);
cmd.ClearRenderTarget(true, true, Color.clear);
备注
unity有两种方式设置RenderTarget,一种是
cmd.SetRenderTarget(temporaryRTId);
cmd.ClearRenderTarget(true, true, Color.clear);
还有一种是
buffer.SetRenderTarget(
colorBuffer,
RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare,
depthStencilBuffer,
RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare);
这种方式貌似不能设置clear
然后灵活运用 DontCare, Load 和 Store,对性能能有成倍的优化
还可以结合起来使用
buffer.SetRenderTarget(
colorBuffer,
RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare,
depthStencilBuffer,
RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare);
cmd.ClearRenderTarget(true, true, Color.clear);
模拟器花屏
模板测试在模拟器上会有问题,尝试用alpha通道替代模板测试