source | 要从中进行 blit 操作的源纹理或渲染目标。 |
dest | 要作为 blit 操作目标的目标。 |
mat | 要使用的材质。 |
pass | 要使用的着色器通道(默认为 -1,表示“所有通道”)。 |
scale | 应用于源纹理坐标的缩放。 |
offset | 应用于源纹理坐标的偏移。 |
sourceDepthSlice | 要从中执行 blit 操作的纹理数组源切片。 |
destDepthSlice | 要对其执行 blit 操作的纹理数组目标切片。 |
添加“对渲染纹理执行 blit 操作”命令。
这与 Graphics.Blit 相似 - 主要用于从一个(渲染)纹理复制到其他纹理,可能使用自定义着色器。
源纹理或渲染目标将作为“_MainTex”属性传递给材质。
可通过若干种方式指示要使用的渲染纹理:RenderTexture 对象、用 GetTemporaryRT 创建的临时渲染纹理或内置的临时纹理之一 (BuiltinRenderTextureType)。上述所有形式的渲染纹理都用 RenderTargetIdentifier 结构来表示,该结构使用隐式转换运算符,实现键入时保存。
请注意,Blit 会更改当前处于活动状态的渲染目标。在 Blit 执行后,dest
会变为活动渲染目标。
通常不需要保留 Blit dest
的先前内容。在这种情况下,建议使用 SetRenderTarget 以适当的加载和存储操作显式激活 dest
渲染目标。然后,应将 Blit dest
设置为 BuiltinRenderTextureType.CurrentActive。
另请参阅:GetTemporaryRT、RenderTargetIdentifier。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.