Frosted Glass 适配UE4.25 - 4.27, 5.0
The frosted glass shader is provided in two fundamental implementations, each with their benefits and drawbacks (they can be combined):
Surface Material
Supports per surface diffuse color (for effects like stained glass)
Supports per surface reflection color
Does not support rendering translucency behind the frosted surface
Supports mobile rendering (lower quality)
Post Process Material
Supports per post process volume diffuse color
Supports per surface reflection color
Supports rendering translucency behind the frosted surface
Supports mobile rendering (full quality)
The best thing to do is look at the included showcase level to see how the different versions are used and how they can be used in combination to enable more complex effects like multiple layers of frosted glass. Most examples also have a note placed next to them in the level, that provides further information on that specific example.
How to use surface materials
Simply assign one of the frosted glass materials to your mesh and the effect will work immediately
If you choose to enable backface culling in the material instance (useful for removing self-overlapping artifacts on complex surfaces), make sure to enable "Render CustomDepth Pass" on the mesh
How to use post process materials
In the Project Settings, set "Custom Depth-Stencil Pass" to "Enabled with Stencil"
Assign a regular glass material to your mesh
On your mesh, enable "Render CustomDepth Pass" and set "CustomDepth Stencil Value" to any value from 1-255
On your Post Process Volume, add a frosted glass post process material instance to the "Post Process Materials" section
You should now be able to see the effect on your glass - if you need more information, check out the official documentation on post process materials
Notes on usage with UE5.0
Because Lumen does not yet support mirror like reflections for glass surfaces, you may noticed the reflections look blurry. In such case I would recommend to turn off the lumen glass reflections and use cubemaps to get sharp reflections. The relevant command for that is "r.Lumen.TranslucencyReflections.Enable 0"
Also if you wish to view the static lighting scene, set Global Illumination solution to Screen Space in project settings (this will allow lightmaps and reflections from captures to be shown like in UE4).
Raytraced translucency only supports simple frosted glass where both reflected and transmitted light is scattered.
技术细节
Supported Platforms
The effect is supported and tested on high end as well as mobile platforms. The post process version has the best compatibility across platforms and supports full quality and material feature set on mobile, compared to the surface version which falls back to a lower quality and limited feature set on mobile.
Rendering Compatibility
Glass materials that are used in combination with the post process frosting version need to have "Render after DOF" / "Mobile Separate Translucency" enabled if they are meant to have sharp reflections or surface detail like dirt or detail normals. This relies on "Separate Translucency" to be enabled in the project settings, which is the case by default.
Included Content
This product includes 4 master materials:
M_FrostedGlass - fully featured and highly configurable frosted glass surface material
M_SimpleFrostedGlass - very simple and easy to expand on frosted glass surface material
M_Glass - regular glass material
MPP_FrostedGlass - post process material that adds the frosted effect to regular glass surfaces
The surface master materials all share the same material function and also come with a SSR variation that is pre-configured to have screen space reflections enabled.
Additionally there are 26 material instances included, most of which are used in the showcase level to provide examples of how the materials can be used.
毛玻璃着色器提供两种基本实现,每种都有其优点和缺点(它们可以组合):
表面材质
支持每个表面漫反射颜色(用于彩色玻璃等效果)
支持每个表面反射颜色
不支持磨砂表面后面渲染半透明
支持移动渲染(质量较低)
后处理材料
支持每个后期处理体积漫反射颜色
支持每个表面反射颜色
支持磨砂表面后面的渲染半透明
支持移动端渲染(全画质)
最好的办法是查看附带的展示关卡,了解不同版本的使用方式以及如何组合使用它们以实现更复杂的效果,例如多层磨砂玻璃。 大多数示例在关卡中的旁边都会有一个注释,提供有关该特定示例的更多信息。
表面材料的使用方法
只需将其中一种磨砂玻璃材质分配给您的网格,效果就会立即生效
如果您选择在材质实例中启用背面剔除(对于去除复杂表面上的自重叠伪像很有用),请确保在网格上启用“渲染自定义深度通道”
如何使用后处理材料
在项目设置中,将“自定义深度模板通道”设置为“通过模板启用”
为您的网格指定常规玻璃材质
在网格上,启用“Render CustomDepth Pass”并将“CustomDepth Stencil Value”设置为 1-255 之间的任意值
在您的后期处理体积上,将磨砂玻璃后期处理材质实例添加到“后期处理材质”部分
您现在应该能够看到玻璃上的效果 - 如果您需要更多信息,请查看有关后处理材料的官方文档
UE5.0使用注意事项
由于 Lumen 尚不支持玻璃表面的镜面反射,因此您可能会注意到反射看起来很模糊。 在这种情况下,我建议关闭流明玻璃反射并使用立方体贴图来获得清晰的反射。 相关命令是“r.Lumen.TranslucencyReflections.Enable 0”
另外,如果您希望查看静态光照场景,请在项目设置中将全局照明解决方案设置为屏幕空间(这将允许像 UE4 中一样显示捕获的光照贴图和反射)。
光线追踪半透明仅支持简单的磨砂玻璃,其中反射光和透射光都会散射。
技术细节
支持的平台
该效果在高端和移动平台上得到支持和测试。 后期处理版本具有跨平台的最佳兼容性,并支持移动设备上的完整质量和材质功能集,而表面版本则回落到移动设备上的较低质量和有限的功能集。
渲染兼容性
与后期处理磨砂版本结合使用的玻璃材质如果要具有锐利的反射或表面细节(如污垢或细节法线),则需要启用“DOF 后渲染”/“移动单独半透明”。 这依赖于在项目设置中启用“单独半透明”,默认情况下就是这种情况。
包含内容
本产品包含4种主材:
M_FrostedGlass - 功能齐全且高度可配置的磨砂玻璃表面材料
M_SimpleFrostedGlass - 非常简单且易于在磨砂玻璃表面材质上扩展
M_Glass - 普通玻璃材质
MPP_FrostedGlass - 为常规玻璃表面添加磨砂效果的后处理材料
表面母版材质均具有相同的材质功能,并且还具有预先配置为启用屏幕空间反射的 SSR 变体。
此外,还包含 26 个材质实例,其中大部分用于展示级别,以提供如何使用材质的示例。
页:
[1]