0
\$\begingroup\$

I'm using Amplify shader visual scripting to make tessellation and increment level of detail of the 3d mesh. enter image description here

But is not applying Catmull-Clark subdivision round smoothness. And my model still looks square and computationally expensive. I did not find nodes name Catmull-Clark or similar. Since rendering of Catmull-Clark subdivision surfaces is often mentioned as the primary application for the tessellation pipeline, my question is:

How can I make a Unity 5 Physically Based shader that includes Catmull-Clark subdivision surfaces tessellation to increase LOD? If is possible using Amplify shader nodes or Shaderforge.

In my case, The 3D models came from 3dmax [simple quad N-Gons] in OBJ format and I apply subdivision surface in Blender to get roundness. Blender use Catmull-Clark subdivision surfaces and I do not know what type of approximating method is using [https://docs.blender.org/manual/ja/dev/modeling/modifiers/generate/subsurf.html]. But I wish a more real-time dynamic approach and increase the LOD in the game based on camera proximity and omit the step of making a second model with Hi level of detail, that is a big time-consuming. I scroll down the Unity documentation and try to apply all the solutions including the Phong tessellation. But at the edges of the mark seams the 3d mesh creates noticeable big holes.

I have no idea about any Catmull-Clark subdivision types. If you can clarify that, can help. I'm really just seeking some method to round-out the shapes of the tesselated mesh.

Note that the info on Unity website about tessellation does not include Catmull-Clark subdivision and PBR: https://docs.unity3d.com/Manual/SL-SurfaceShaderTessellation.html

here is an example of Unity5 PBR with tessellation but is missing the roundness.

Shader "Standard (Tesselation)" { Properties { _Color ("Color", Color) = (1,1,1,1) _MainTex ("Albedo (RGB)", 2D) = "white" {} _BumpMap ("Normal Map (RGB)", 2D) = "bump" {} _BumpScale ("Normal Power" , Float) = 1 _Occlusion ("Occlusion Map (R)" , 2D) = "white" {} _Metallic ("Metallic (R) , Smoothness (A)" , 2D) = "black" {} _ParallaxMap ("Heightmap (A)", 2D) = "black" {} _EdgeLength ("Edge length", Range(3,50)) = 10 _Parallax ("Height", Range (0.0, 1.0)) = 0.5 } SubShader { Tags { "RenderType"="Opaque" } LOD 200 CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard fullforwardshadows vertex:disp tessellate:tessEdge #include "Tessellation.cginc" sampler2D _ParallaxMap; float _EdgeLength; fixed _Parallax; float _BumpScale; sampler2D _MainTex; sampler2D _Occlusion; sampler2D _BumpMap; sampler2D _Metallic; struct appdata { float4 vertex : POSITION; float4 tangent : TANGENT; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; float2 texcoord1 : TEXCOORD1; float2 texcoord2 : TEXCOORD2; }; float4 tessEdge (appdata v0, appdata v1,appdata v2) { return UnityEdgeLengthBasedTessCull (v0.vertex, v1.vertex, v2.vertex, _EdgeLength, _Parallax * 1.5f); } void disp (inout appdata v) { float d = tex2Dlod(_ParallaxMap, float4(v.texcoord.xy,0,0)).a * _Parallax; v.vertex.xyz += v.normal * d; } // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 struct Input { float2 uv_MainTex; }; fixed4 _Color; void surf (Input IN, inout SurfaceOutputStandard o) { // Albedo comes from a texture tinted by color fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; o.Albedo = c.rgb; // Metallic and smoothness come from slider variables fixed4 m = tex2D(_Metallic,IN.uv_MainTex); o.Metallic = m.r; o.Occlusion = tex2D(_Occlusion,IN.uv_MainTex).x; o.Smoothness = m.a; o.Normal = normalize(UnpackScaleNormal(tex2D(_BumpMap, IN.uv_MainTex), _BumpScale)); o.Alpha = c.a; } ENDCG } FallBack "Diffuse" } 

from: https://pastebin.com/quZSxe0C

\$\endgroup\$
3
  • \$\begingroup\$ "Since rendering of Catmull-Clark subdivision surfaces is often mentioned as the primary application for the tessellation pipeline" there may be a misunderstanding here. Refining portions of a coarse mesh to a controllable level of detail is the aim of both Catmull-Clark surfaces and the tesselation pipeline, but the specific Catmull-Clark approach is not the pipeline's main purpose. In fact, this presentation from NVidia notes that the Catmull-Clark method is a "poor fit to hardware tesselation pipeline" and advises approximating \$\endgroup\$ Commented May 17, 2017 at 21:03
  • \$\begingroup\$ Yes here is a link of other tessellation application where the "quote" came form: ludicon.com/castano/blog/2009/01/… I will try to include a shader script so that is more general use and not Amplify specific since at the moment, Amplify visual scripting do not support this feature. \$\endgroup\$ Commented May 18, 2017 at 22:08
  • \$\begingroup\$ Scroll down in that document and you'll see it clarifies itself to say the pipeline is used in various ways to approximate Catmull-Clark subdivision surfaces, such as rendering bicubic quad patches & tangent patches, piecewise quartic triangle patches, or Gregory patches. So there's not a single drop-in solution for Catmull-Clark subdivision in games — you'll need to choose some approximating method to use. Or is Catmull-Clark in particular not actually your goal, and you're really just seeking some method to round-out the shapes of your tesselated mesh, even if it's not Catmull-Clark? \$\endgroup\$ Commented May 18, 2017 at 22:26

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.