Real Turing RT renders: the MaterialX Teapot and Lion with their materials, and coarse meshes without black rims.
The ASWF MaterialX Teapot and Lion now render their glaze, brass, gold and wood under a studio fitted to the official images (left: official render, middle: before, right: after).
Low-poly smooth-shaded spheres lose their black silhouette rims, and the shadow terminator of a 12-segment sphere becomes smooth.
Situation
Turing RT is the Metal path tracer behind Turing Sim, our robot simulator. It already had OpenPBR-style layered materials, HDRI importance sampling and an AI denoiser, but the question of the day was blunt: why do the renders still not look good?
The first finding was about content, not the renderer. The robot workcell scenes had no lights and no materials, only display colours, so path tracing and realtime ray tracing produced nearly identical images: there was nothing to bounce off and nothing glossy to reflect. Adding a floor, two area lights and a few real materials to the same robot immediately showed soft shadows and glossy reflections. That moved the work to the cases where the renderer itself was wrong.
Task
- Make glass and metal hold up on real assets, starting with a material test scene.
- Support the NVIDIA MaterialX Teapot and Lion from the ASWF Digital Production Example Library, which rendered completely grey.
- Explain why their colours still differed from the official renders, and close as much of that gap as could be measured.
- Make Turing Sim always use the latest renderer.
The constraint throughout was the project rule that every rendering change ships with a measurement against a reference.
Action
- Dark rims on smooth low-poly meshes. Metal spheres showed black rims. Swapping them for 256×128 meshes made the rims vanish, which pointed at interpolated normals on coarse facets: silhouettes were mistaken for back faces and reflections went into the surface. The fix decides front and back from the face, keeps opaque shading normals valid (the approach Cycles uses, with its quadratic root checked numerically over 200,000 random cases), and lifts shadow rays near the terminator onto the smooth surface (Hanika 2021). In a white-furnace test, a 12-segment mirror sphere went from 3.3% dark pixels to none, a strongly normal-mapped mirror plane from 0.46 to 0.98 of the dome, and terminator steps from 2.1% to 0.45%, at no measurable cost in render time.
- MaterialX BSDF graphs. The teapot and lion use standalone BSDF nodes (conductor, dielectric, Oren–Nayar, sheen) combined by layer and mix. The renderer now flattens these graphs onto its layered BSDF. Value graphs that feed them (multiply, power, ln and exp, normal maps and so on) become texture expressions: constants fold, single images stay images, and everything else is baked per UDIM tile when textures load. A layer map carries coat, sheen and specular weights that vary across the surface.
- A mesh bug found along the way. The lion's wooden base stayed cream even with its raw texture bound. The cause was in mesh loading: for meshes made only of triangles, Hydra reports that triangulation left face-varying data unchanged, and that answer was treated as a failure, so such meshes lost their UVs. Pre-triangulated exports are common, so this affected far more than one asset.
- Matching the official lighting. Tone curves turned out to matter little. A guessed bright studio scored worse than the built-in sky because its white floor whitened the glaze. Instead, a six-parameter studio (key light direction, size and strength, floor albedo, dome warmth) was fitted to both official images at once: about 200 renders in one process, about 3.5 minutes. Turing Sim's Compare Renders gained a matching studio override.
- Gold that leaned yellow. An isolated sphere showed the conductor itself was right. The problem was mixing a metal and a diffuse base under a soft mask: one blended colour paled the gold, and specular weight scaled the metal a second time. Each lobe now averages its parameters over its own share, and the metal keeps its own colour.
New headless tests cover each fix, and each was checked to fail without its fix. The renderer moved to its own TuringRender repository, Turing Sim installs it in editable mode, and all branches were merged after full test runs (TuringRender 45 tests, Turing Sim 520 passed after the final merge).
Result
Against the official renders, measured on object pixels as mean sRGB difference out of 255 at the best exposure: the teapot went from 44.5 (grey fallback) to 29.4 under the built-in sky and 24.1 under the fitted studio; the lion from 51.5 to 40.1 and 20.2.
Limits remain. The glaze's view-dependent absorption is evaluated head-on, so the teapot's blue is lighter and the lion's gold less orange than the official images. Coat and base share one normal. Diffuse surfaces still lose some energy under strong normal maps. Implicit USD spheres are still tessellated coarsely. The next step is view-dependent absorption, which should deepen both the blue glaze and the gold.
背景
Turing RT 是机器人仿真器 Turing Sim 背后的 Metal 路径追踪渲染器,已经有 OpenPBR 风格的分层材质、HDRI 重要性采样和 AI 降噪。今天的问题很直接:为什么渲染出来还是不好看?
第一个结论落在场景内容上,不在渲染器。机器人工作站场景里没有灯,也没有材质,只有显示颜色,所以路径追踪和实时光追渲出来几乎一样:既没有可以反弹的间接光,也没有可以反射的光滑表面。在同一个机器人场景里加上地面、两盏面光和几种真实材质,软阴影和光泽反射马上就出来了。于是工作转向渲染器本身真正出错的地方。
目标与难点
- 让玻璃和金属在真实资产上站得住,先从一个材质测试场景开始;
- 支持 ASWF 数字制作示例库里 NVIDIA 的 MaterialX Teapot 和 Lion,它们原来完全显示为灰色;
- 解释它们和官方渲染图的色差,并把能测量的差距尽量缩小;
- 让 Turing Sim 始终用上最新的渲染器。
全程的约束是项目规则:每一处渲染改动都要附带与参考图的测量对比。
解决思路与行动
- 低模平滑网格的黑边。 金属球边缘出现黑圈。换成 256×128 的细网格后黑圈消失,说明问题出在粗面片上插值出来的法线:轮廓被误判成背面,反射射线钻进了表面。修复包括三点:用几何面判断正反面;保证不透明表面的着色法线有效(Cycles 的做法,二次方程的选根用 20 万个随机样本做了数值验证);明暗交界线附近的阴影射线改从平滑曲面上发出(Hanika 2021)。白炉测试中,12 段镜面球的偏暗像素从 3.3% 降到 0,强法线贴图的镜面平面从环境亮度的 0.46 倍升到 0.98 倍,交界线锯齿从 2.1% 降到 0.45%,渲染耗时没有可测量的增加。
- MaterialX BSDF 图。 Teapot 和 Lion 的材质由独立的 BSDF 节点(conductor、dielectric、Oren–Nayar、sheen)通过 layer 和 mix 组合而成。渲染器现在把整张图压平到自己的分层 BSDF 上。驱动它们的数值节点链(multiply、power、ln/exp、法线贴图等)变成纹理表达式:常数直接折叠,单张图仍按贴图读取,其余的在加载贴图时按 UDIM 瓦片烘焙。另外用一张 layer 贴图承载随位置变化的清漆、绒毛和高光权重。
- 顺带发现的网格 bug。 即使直接绑上原始贴图,Lion 的木底座仍是米白色。原因在网格加载:对于全是三角形的网格,Hydra 会告诉调用方 faceVarying 数据"无需改变",而这个结果被当成了失败,于是这类网格丢掉了 UV。预先三角化的导出很常见,影响面远不止这一个资产。
- 匹配官方灯光。 实测发现色调曲线影响很小。手搭的亮白影棚反而比内置天空更差,因为白地面把釉面映白了。最后用 6 个参数的影棚(主光方向、大小和强度,地面反照率,环境光冷暖)同时拟合两张官方图:在一个进程里渲约 200 次,用时约 3.5 分钟。Turing Sim 的 Compare Renders 也加上了对应的影棚覆盖项。
- 偏黄的金色。 单独渲一个金属球,证明导体本身是对的。问题出在软遮罩下混合金属和漫反射:混成一个颜色会把金色冲淡,高光权重还会把金属再缩放一次。现在每个波瓣只在自己所占的份额里平均参数,金属保留自己的颜色。
每处修复都有新的无窗口测试,并确认去掉修复后测试会失败。渲染器搬进了独立的 TuringRender 仓库,Turing Sim 以 editable 方式安装它;所有分支在完整测试后合并(TuringRender 45 个测试;最后一次合并后 Turing Sim 520 个通过)。
结果与下一步
与官方渲染图对比(只看物体像素,在最佳曝光下计算 sRGB 平均差,满分 255):Teapot 从 44.5(灰色回退)降到内置天空下的 29.4、拟合影棚下的 24.1;Lion 从 51.5 降到 40.1 和 20.2。
仍有局限:釉的视角相关吸收按正对视角计算,所以 Teapot 的蓝比官方浅,Lion 的金不如官方橙;清漆层和底层共用一个法线;强法线贴图下漫反射仍会损失一些能量;USD 隐式球体的细分仍然偏粗。下一步是视角相关吸收,它会让蓝釉和金色都更深。


Top comments (0)