webgl 2.0_WebGL 2.0的线性渲染支持

时间:2024-05-20 13:12:00
webgl 2.0_WebGL 2.0的线性渲染支持

webgl 2.0

One of the new features in Unity 2017.2 is linear rendering with WebGL 2.0. With linear rendering, you’re sure that the inputs, the outputs and the computation are in the correct color space. The brightness of the final image will go linearly with the amount of light in the scene. That means more consistent lighting across your scenes and assets.

Unity 2017.2的新功能之一是使用WebGL 2.0进行线性渲染 。 使用线性渲染时,请确保输入,输出和计算在正确的色彩空间中。 最终图像的亮度将与场景中的光量成线性关系。 这意味着您的场景和资产上的照明更加一致。

Left: A linear gradient. Right: How our eyes perceive that gradient. Note where the borders (which are exactly mid-grey) merge with the gradient in each case

左:线性渐变。 右图:我们的眼睛如何看待渐变。 请注意每种情况下边界(恰好是灰色)与渐变合并的位置

In Unity 5.5 we shipped linear rendering for Android with OpenGL ES 3.0 and iOS with Metal.

在Unity 5.5中,我们为带有OpenGL ES 3.0的Android和带有Metal的iOS提供了线性渲染

In Unity 2017.2, linear rendering is now supported on:

在Unity 2017.2中,现在支持线性渲染:

  • Windows, Mac OS X and Linux (Standalone)

    Windows,Mac OS X和Linux(独立)
  • Xbox One

    Xbox One
  • PlayStation 4

    的PlayStation 4
  • Android with OpenGL ES 3.x and Vulkan

    装有OpenGL ES 3.x和Vulkan的Android
  • iOS with Metal

    带金属的iOS
  • WebGL 2.0

    WebGL 2.0

Linear rendering is particularly interesting because it allows you to use the Unity post processing stack, including temporal anti-aliasing, and get really good results with WebGL.

线性渲染特别有趣,因为它使您可以使用Unity后处理堆栈 (包括临时抗锯齿),并使用WebGL获得非常好的效果。

Linear rendering in Unity WebGL player works on any web browser that supports WebGL 2.0.

Unity WebGL Player中的线性渲染可在任何支持WebGL 2.0的Web浏览器上使用。

However, there is a performance caveat. We worked with the Khronos WebGL group to create a WebGL 2.0 extension to add support of sRGB DXT texture compression texture formats. If the web browser doesn’t support this functionality, Unity decompresses the sRGB DXT textures which results in a significant increase of bandwidth consumption. Thanks to Kenneth Russell and Kai Ninomiya from Google and Jeff Gilbert from Mozilla for their help on this extension.

但是,存在性能警告。 我们与Khronos WebGL小组一起创建了WebGL 2.0扩展,以添加对sRGB DXT纹理压缩纹理格式的支持。 如果Web浏览器不支持此功能,则Unity将对sRGB DXT纹理进行解压缩,这将显着增加带宽消耗。 感谢Google的Kenneth Russell和Kai Ninomiya以及Mozilla的Jeff Gilbert在此扩展程序方面的帮助。

Load Demo (~12mb)
加载演示(〜12mb)

翻译自: https://blogs.unity3d.com/2017/07/17/linear-rendering-support-with-webgl-2-0/

webgl 2.0