Professional Documents
Culture Documents
Bill Bilodeau
ISV Relations Group
AMD
bill.bilodeau@amd.com
V1.0
Topics Covered in This Session
Compact representation
Real-time, continuous level of detail
Better looking silhouettes
Direct rendering of high-order
surfaces created by modeling
software
Faster – Animations can be done on
the lower resolution mesh
Tessellating unnecessarily!
–Triangles not seen
–Triangles too small
HULL
TESSELLATOR
SHADER
Triangle Tessellated
Patch Mesh Mesh
DOMAIN
SHADER
Tessellated Displaced
Mesh Mesh
Displacement Map
PIXEL
SHADER
return Out;
}
13 Direct3D Tutorial: Tessellation 3/31/2010
Simple Hull Shader (patch constant phase)
//Called once per patch. The patch and an index to the patch (patch
// ID) are passed in
HS_CONSTANT_DATA_OUTPUT ConstantsHS( InputPatch<VS_OUTPUT_HS_INPUT, 3>
p, uint PatchID : SV_PrimitiveID )
{
HS_CONSTANT_DATA_OUTPUT Out;
return Out;
} // end of domain shader
HULL DOMAIN
TESSELLATOR
SHADER SHADER
3 3
// ...
return Value;
}
// find the distance from the current vertex to the hit location
float distanceToHit = distance(vWorldPos, vHitLocation.xyz);
Analysis
– Expensive Domain Shader
– Small triangles are inefficient
Hardware wants triangles to be at least 8 pixels
Solution
– Reduce the number of tessellated vertices
Fewer executions of the Domain Shader
– Hull Shader can adjust the tessellation factors
Decal
Patch Triangle
If neither endpoint is
See if the given edge within the decal
needs to be tessellated radius, check to the
distance from the
decal to the edge.
Decal
Patch Triangle
Patch Triangle
Rotated wireframe view with back face culling showing culled patches
Frustum Culling
Group tessellated draw call together
Orientation Adaptive Tessellation
– Use dot(V, N) to find silhouette patches
Hull Shader
– Try to reduce data passed in and out
Domain Shader
– Try to move work to Pixel Shader
– Reduce data passed out
Geometry Shader
– Use Stream Out to avoid re-tessellating an object
bill.bilodeau@amd.com
Trademark Attribution
AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc. in the United States and/or other
jurisdictions. Other names used in this presentation are for identification purposes only and may be trademarks of their respective owners.