PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.11k stars 1.21k forks source link

storm ignores subd normals #2981

Closed ben-arx closed 3 months ago

ben-arx commented 8 months ago

Storm ignores normals with higher subd levels, increasing complexity adds more geometry, but the normals stay the same, resulting in smooth shading and softer edges on the very high complexity mesh compared to the same mesh with subdivisions baked into the geometry. Attached is a simple example of a cube mesh with a crease weight of 10, showing the same smooth normals and shading with complexity low and very high and then compared with subd baked into the mesh instead. Renderman and Karma render subd with the proper normals.

cube.zip

low cube_low

very high cube_very_high

baked cube_baked

davidgyu commented 8 months ago

The default method of displaying subdivision surface meshes in Storm is limited as you point out, especially with respect to meshes with sharpened creases and other features. You can get a higher fidelity representation by enabling adaptive subdivision with GPU tessellation, e.g.

`% env HD_ENABLE_OPENSUBDIV3_ADAPTIVE=1 usdview --complexity medium cube_creased.usda`

It would be good if this was exposed in a way that was more discoverable.

ben-arx commented 8 months ago

Thank you for that env var, adaptive subdivision looks promising with better normals, but it does create some artefacts and not enough subdivision compared to the fixed subdivision. Is there any way to control adaptive subdivision resolution with an env var or some other way? It seems to always subdivide to roughly the same screen space polygon size resulting in black faces near sharper creases and not rough edges for small subd detail. Increasing complexity doesn't seem to fix issues or result in higher resolution subdivision.

Attached is an example of a simple square tube with rounded edges, top and bottom crease weight of 5, that shows black faces near creases when moving further away and even further it will not subdivide much at all showing faceted edges instead of smooth subd shapes.

complexity mid close enough so everything looks good image

complexity very high with normal issues at the creases image

complexity mid with the same normal issues, but only starting further away image

complexity mid not subdividing enough far away image

edit: added tube.usda zipped example tube.zip

jesschimein commented 8 months ago

Filed as internal issue #USD-9383

davidgyu commented 8 months ago

@ben-arx Agree those tessellation artifacts are undesirable. There should be a fairly straightforward fix for that bug, we'll take a look. We haven't yet exposed any additional controls for adaptive tessellation.