返回介绍

Graphics.SetRenderTarget 设置渲染目标

发布于 2019-12-18 15:37:44 字数 4156 浏览 1890 评论 0 收藏 0

JavaScript => public static function SetRenderTarget(rt: RenderTexture): void;
JavaScript =>public static function SetRenderTarget(rt: RenderTexture, mipLevel: int): void;
JavaScript =>public static function SetRenderTarget(rt: RenderTexture, mipLevel: int, face: CubemapFace): void;
JavaScript =>public static function SetRenderTarget(colorBuffer: RenderBuffer, depthBuffer: RenderBuffer): void;
JavaScript =>public static function SetRenderTarget(colorBuffers: RenderBuffer[], depthBuffer: RenderBuffer): void;
JavaScript =>public static function SetRenderTarget(colorBuffer: RenderBuffer, depthBuffer: RenderBuffer, mipLevel: int): void;
JavaScript =>public static function SetRenderTarget(colorBuffer: RenderBuffer, depthBuffer: RenderBuffer, mipLevel: int, face: CubemapFace): void;
C# => public static void SetRenderTarget(RenderTexture rt);
C# =>public static void SetRenderTarget(RenderTexture rt, int mipLevel);
C# =>public static void SetRenderTarget(RenderTexture rt, int mipLevel, CubemapFace face);
C# =>public static void SetRenderTarget(RenderBuffer colorBuffer, RenderBuffer depthBuffer);
C# =>public static void SetRenderTarget(RenderBuffer[] colorBuffers, RenderBuffer depthBuffer);
C# =>public static void SetRenderTarget(RenderBuffer colorBuffer, RenderBuffer depthBuffer, int mipLevel);
C# =>public static void SetRenderTarget(RenderBuffer colorBuffer, RenderBuffer depthBuffer, int mipLevel, CubemapFace face);

Parameters 参数

Description 描述

Sets current render target.

设置当前渲染目标。

This function sets which RenderTexture or a RenderBuffer combination will be rendered into next. Use it when implementing custom rendering algorithms, where you need to render something into a render texture manually.

该函数设置的RenderTexture 或RenderBuffer 组合将被渲染到下一步。当执行自定义渲染算法使用它,你需要手动渲染某些渲染纹理时采用自定义。

Variants with mipLevel and face arguments enable rendering into a specific mipmap level of a RenderTexture, or specific cubemap face of a cubemap RenderTexture.

启用mipLevel 和face变形的参数渲染到指定RenderTexture的mipmap 级别,或者立方体贴图渲染纹理的指定的立方体贴图面。

The function call with colorBuffers array enables techniques that use Multiple Render Targets (MRT), where fragment shader can output more than one final color.

colorBuffers数组函数调用实现技术使用多重渲染目标(MRT),在片段渲染器可以输出多个最终的颜色。

Calling SetRenderTarget with just a RenderTexture argument is the same as setting RenderTexture.active property.

调用SetRenderTarget仅与RenderTexture 参数是设置相同RenderTexture.active属性。

Note that in Linear color space, it is important to have the correct sRGBLinear color conversion state set. Depending on what was rendered previously, the current state might not be the one you expect. You should consider setting GL.sRGBWrite as you need it before doing SetRenderTarget or any other manual rendering.

注意在线性颜色空间,拥有当前sRGB线性颜色转换声明设置是重要的。当前状态可能不是你所期望的那种,取决于预先渲染什么。在做设置渲染目标或者其他手工渲染之前,你应该考虑设置 GL.sRGBWrite作为你需要的那个。

graphics

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文