Microdisplacement; stitching between two faces of different material indices does not exist (when dicing is used)
Open, NormalPublic

Description

System Information
Win10 64 bit; 24 gigs RAM; third-gen i7 CPU; ATI 79xx GPU

Blender Version
Broken: hash a0c1876
Worked: never

Short description of error
When you enable the rendertime dicing in the subsurf modifier (for displacement) and the mesh has more than one material index, both the rendered view and F12 render will reveal that the faces are not connected in any way (but displacement without the dicing works as it should

Exact steps for others to reproduce the error
Open the .blend file and switch to the rendered view (or press F12)

image

blend

I'm not entirely sure if you're accepting bug reports for this feature yet, but then again there's no user-visible list of remaining todo items so as to know whether to report something.

Details

Type
To Do
Adam Friesen (ace_dragon) renamed this task from Ex. Microdisplacement; stitching between two faces of different material indices does not exist (when dicing is used) to Exp. Microdisplacement; stitching between two faces of different material indices does not exist (when dicing is used).

I'm not sure this is a bug but rather a limitation. By using two materials with different displacement settings you've created a discontinuous function; the surface literally doesn't exist for those points.

If you have a specific idea on how you expect this to be resolved could you please describe what you expect to happen?

The expected result would be something like this

The edges of the red zone is not the prettiest thing, but the mesh at least is a closed volume (this is how discontinuous values have traditionally been handled in 3D).

Now I'm not sure if OpenSubDiv here has the ability to produce such a result in this case, if it's an OSD limitation then there's not much that can be done until Pixar and co. decide to resolve it.

Sergey Sharybin (sergey) triaged this task as Normal priority.Aug 9 2016, 11:21 AM

Nothing to do with OSD

While I can understand the want of a closed mesh I'm still not convinced that this is the correct behavior, in fact I feel like the case of the surface being stitched together when adaptive subdivision isn't in use is wrong...

You'll notice that the stitched part in your image is red, but what if the artist had wanted it to be white? The choice is arbitrary, and there's no way to allow control over what happens. Also the quality of the polygons in the stitched area will degrade quite quickly as the intensity of displacement increases. Finally, I cant really think of a case where this kind of mixing displacement shaders on a single mesh would be necessary in an actual scene. For those reasons I think we should leave the current behavior as is and have non-adaptive meshes match.

@Brecht Van Lommel (brecht), do you have an opinion on what correct behavior should be here?

If you want to actually break up the mesh or create discontinuities that seems more the task of modifiers or modelling tools.

If possible I'd suggest to average the vertex locations from both sides. Mainly for the case where the user intended to create a smooth transition but precision issues or a small mismatch causes the mesh to not be entirely watertight.

I imagine doing stitching is problematic for the geometry cache, though if we want to ensure watertight results it might be inevitable to look across the edges even with a single material?

Either way I would consider this pretty low priority, displacement with a discontinuous texture is also problematic in general.

Brecht Van Lommel (brecht) renamed this task from Exp. Microdisplacement; stitching between two faces of different material indices does not exist (when dicing is used) to Microdisplacement; stitching between two faces of different material indices does not exist (when dicing is used).Aug 24 2016, 8:34 PM
Brecht Van Lommel (brecht) changed Type from Bug to To Do.

Marking this as a To Do item since this will still be an experimental feature in 2.78.