camera | 在渲染期间要使用的摄像机。 |
target | 要渲染到的立方体贴图。 |
faceMask | 位掩码,用于确定渲染到六个面中的哪一个。 |
culledFlags | 在渲染期间要剔除的对象的标志。 |
bool 如果渲染过程成功,则返回 /true/。否则返回 /false/。
将摄像机渲染到静态立方体贴图中。
该函数的主要用途是在编辑器中"烘焙"场景的静态立方体贴图。
此函数使用摄像机的清除标志、其变换组件的位置及其裁剪面距离将场景中的各位置部分渲染到每个立方体贴图面中。faceMask
是位域,指示将渲染到立方体贴图的哪些面。设置的每个位对应于一个面。位数为 CubemapFace 枚举的整数值。
默认情况下,此过程将渲染立方体贴图的所有六个面(默认值 63 意味着会设置最低六位。/00111111/)。
如果渲染到立方体贴图失败,则此函数返回 /false/。发生这种情况的一个示例是某些图形硬件不支持此功能。
注意:ReflectionProbes 是执行实时反射的更高级的方法。
注意:通过导航到 **Assets > Create > Legacy**,然后选择 **Cubemap** 选项,可在编辑器中创建立方体贴图。
另请参阅:立方体贴图资源、反光着色器。
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.