Crack-Free Tessellation Displacement

Similar documents
Physically Based Shading in Unity. Aras Pranckevičius Rendering Dude

LEVEL 1 ANIMATION ACADEMY2010

Flowmap Generator River Tutorial

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

8K Earth, Moon and Mars Shaders Asset V Documentation

TSBK03 Screen-Space Ambient Occlusion

Hardware Displacement Mapping

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Planets Earth, Mars and Moon Shaders Asset V Documentation (Unity 5 version)

Property of: Entrada Interactive. PBR Workflow. Working within a PBR-based environment

Advanced Distant Light for DAZ Studio

Rock Tutorial: Creating A Rock Like Seen In Gears Of War With A Focus On Normal

DAZ Page 1. DAZ3D to Unity (Objects and Clothing)

DG Shader Essentials User s Guide

Introduction to Digital Modelling and Animation in Design week 4 Textures

Underwater Manager (Optional)

Glass Gambit: Chess set and shader presets for DAZ Studio

Easy Decal Version Easy Decal. Operation Manual. &u - Assets

Computergrafik. Matthias Zwicker. Herbst 2010

Chapter 5- Materials & Textures

VISIT FOR THE LATEST UPDATES, FORUMS & MORE ASSETS.

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Those Delicious Texels or Dynamic Image-Space Per-Pixel

Chapter 4- Blender Render Engines

Flowmap Generator Reference

WET AND TANNED SKINS

Texture Mapping. Images from 3D Creative Magazine

TUTORIAL 7: Global Illumination & Ambient Occlusion

Iray Uber Shader Properties. Workshop Reference Guide

Graphics and Interaction Rendering pipeline & object modelling

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Skin Texturing and Shading in Maya Part 2

ZBrush To Softimage XSI 16-Bit Displacement Guide

Deferred Rendering Due: Wednesday November 15 at 10pm

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Radeon ProRender and Radeon Rays in a Gaming Rendering Workflow. Takahiro Harada, AMD 2017/3

ULTIMATE IRAY SKIN MANAGER

CS GAME PROGRAMMING Question bank

COS 116 The Computational Universe Laboratory 10: Computer Graphics

AWE Shading Kit 1.0. General Notes. Overview. Light Sets

CREATING AND USING NORMAL MAPS - A Tutorial

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

The Shadow Rendering Technique Based on Local Cubemaps

Shadow Casting in World Builder. A step to step tutorial on how to reach decent results on the creation of shadows

Computer Graphics 10 - Shadows

COS 116 The Computational Universe Laboratory 10: Computer Graphics

CS451 Texturing 4. Bump mapping continued. Jyh-Ming Lien Department of Computer SCience George Mason University. From Martin Mittring,

Pd Iray Shader Kit 2 - User s Guide

Surface Rendering. Surface Rendering

Opaque. Flowmap Generator 3

After the release of Maxwell in September last year, a number of press articles appeared that describe VXGI simply as a technology to improve

Computer Graphics. Shadows

Voxel Cone Tracing and Sparse Voxel Octree for Real-time Global Illumination. Cyril Crassin NVIDIA Research

Terrain Tutorial using Shade-C By padmalcom (February 2011)

rendering rasterization based rendering pipelined architecture, parallel mostly triangles (lines and points possible too)

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

Shaders and Textures in Artlantis 2.0 By Gérard Bomer, Abvent

The Making of Seemore WebGL. Will Eastcott, CEO, PlayCanvas

4.6 Normal Mapping Simplifying Meshes for Normal Mapped Objects. CHAPTER 4 Surfacing

Displacement Mapping

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Caustics - Mental Ray

Drawing a Crowd. David Gosselin Pedro V. Sander Jason L. Mitchell. 3D Application Research Group ATI Research

The Vegetation of Horizon Zero Dawn. Gilbert Sanders Principal Artist, Guerrilla Games

Rendering 17 Mixed Lighting

Shadow Techniques. Sim Dietrich NVIDIA Corporation

Rendering 13 Deferred Shading

Normal Maps and Cube Maps. What are they and what do they mean?

Self-shadowing Bumpmap using 3D Texture Hardware

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Pipeline Operations. CS 4620 Lecture 10

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Chapter 4- Materials and Textures

3ds Max certification prep

Shadows in the graphics pipeline

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

Shadow Mapping. Marc Stamminger, University of Erlangen-Nuremberg

Corona Sky Corona Sun Corona Light Create Camera About

Working with the BCC Brick Generator

Pipeline Operations. CS 4620 Lecture 14

Kobold. Shoe Modeling Tutorial 01: Model and animate a red high heel shoe. Software: CINEMA 4D R14

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

How-To Guide SAP 3D Visual Enterprise Author 8.0 Document Version: How To Work with Textures

UDK Basics Maya Export/UDK Import/Viewport and placing content

Guide Contents Introduction Useful Information Navigating the Scene Hotkeys Placing and Manipulating Objects The Builder Cube Builder Cube Edit

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Chapter 7 - Light, Materials, Appearance

COMP 175: Computer Graphics April 11, 2018

Tips and Tricks to Get the Most out of Your Virtual-Reality Experiences in Stingray

Render-To-Texture Caching. D. Sim Dietrich Jr.

ART 268 3D Computer Graphics Texture Mapping and Rendering. Texture Mapping

critical theory Computer Science

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

VEGETATION STUDIO FEATURES

Cinema 4D R19 (SP2) Change List Cinema 4D / BodyPaint 3D Service Release

AWE Surface 1.0 Documentation

Transcription:

Documentation Crack-Free Tessellation Displacement (CFTD) version: 1.6 package link: http://u3d.as/n5k support: assetstore -(at)- pandishpan.com Thank you for purchasing CFTD! 1

Table of Contents CFTD at a glance...4 Limitations...5 Features and Shader Variations...6 Distance Based...6 Edge Length Based...7 Getting Started / How To Use...8 Auto Scene Manager...8 CFTD Per Object...8 Removing the Buffer Creator...8 Shader (Material) Settings...9 Pimped Workflow...9 Tessellation Settings (Distance Based)...10 Tessellation Factor...10 Tessellation / Displacement Fade Distance...10 Tessellation Settings (Edge Length)...10 Edge Length in Pixels...10 Shared Tessellation Settings (Both Shaders)...11 Shadow Caster LOD:...11 Main Maps...12 Albedo / Displacement...12 Normal Map...12 Displacement Settings...12 Displacement Scale...12 Displacement Offset...13 Displacement Texture Tile / Offset...13 2

Material Parameters...13 Metallic...13 Smoothness...13 Specularity Variation...14 Specular Ambient Occlusion...14 Diffuse Ambient Occlusion...14 Global Illumination Ambient Occlusion (GI AO)...15 Secondary Maps...16 Detail Albedo Map...16 Detail Normal Map...16 Detail Map AO...16 Texture Tools...17 Static Subdivision Tools...17 Example...18 Demo Scene...19 3

CFTD at a glance What is CFTD? Crack-Free Tessellation Displacement (CFTD) is a set of tessellation shaders designed to patch 'cracks' that occur when displacement is applied to a model with UV discontinuities. I.e., if your model's texture does not tile perfectly, this will result in displacement cracks on the edges where the tiling breaks. That's because the displacement values at the neighboring texels would be different. Fixing this issue requires extra calculations and an extra buffer to store all the data. Luckily, CFTD does exactly that. Supported Platforms? CFTD only supports DirectX11 and Standalone (PC) builds. CFTD does not work on mobile. Do I need this shader? CFTD is best used with environment props that have a single material with a tiling texture. Needless to say, it is not advised to use CFTD on every single model in your scene. Think of it as the cherry on the cake. Some good examples where it makes a difference are: cobble stone on a street, damaged pavement on a sidewalk, brick wall(s)!, shingles on a rooftop. A good note is to look at where tessellation was used in Assassin's Creed Unity. VR? CFTD has sweet performance stats and works well with VR. Again, it was not meant to be used on every single asset in your game. However, it does look pretty darn awesome in VR. Baked meshes? If you are planning to use tessellation and displacement with sculpted and baked meshes (think a sculpture, for example), then you do NOT need CFTD! In such cases, you are better off using a standard tessellation shader. Better even, use our free shader that's on the assetstore! Link: http://u3d.as/gio 4

Limitations CFTD has some limitations that you should be familiar with. DirectX11 Only Again, CFTD only works under DX11 PC. No Batching Since CFTD injects a custom buffer in the shader per object, it does not allow Static or Dynamic batching. The shader disables those automatically for the objects that use it. You can, however, combine your meshes via other Unity tools before runtime. Static Meshes Only CFTD does not work with skinned meshes. It is intended to be used with Static game meshes (environment objects). The objects do not necessarily need to be marked as Static. Single Material Advisory While CFTD works on meshes with multiple materials, it does not patch displacement cracks between different materials. That's because different materials in game engines are pretty much separate sub-meshes. It is best advised to use CFTD with single-material objects. That's where it works best. 5

Features and Shader Variations CFTD comes in 2 flavors. Each has it's pros and cons. Both shaders incorporate code that minimizes mesh swimming and popping artifacts. Distance Based Distance Based calculates tessellation factors based on the distance from the camera to a given face on the mesh. Hence, this variation is not FOV-dependent. This means when an object is far away form the camera, but FOV is very small (i.e. you've coded in a sniper mode into your game), tessellation factors will be wrong. Edge Length fixes this issue, but Distance Based does not. However, Distance allows for smoothing of the patched edges of the displacement cracks. In other words, even if your mesh has hard edges (different smoothing groups) CFTD Distance Based will smooth the normals between the different faces. With this feature CFTD takes on tessellation solutions in some of the leading game engines! Of course, you can have a single smoothing group, but then shading would be way off. CFTD only smooths the edge. Edge Length (notice the hard edges) Distance Based (smooth beween different smoothing groups) 6

Edge Length Based The Edge Length version uses a modified tessellator. It supports better tessellation culling and more importantly it is FOV-dependent. This means if you zoom-in the camera by changing the FOV, tessellation is still applied the same way as if you were moving closer to the object. If your game incorporates a sniper mode, for instance, or binoculars or stuff like that, you'd most likely want to use Edge Length. Furthermore, sometimes keeping the hard edges hard actually helps with modular meshes. Here is an example of the FOV dependence of Distance Based. In this example, the camera is way far from the mesh and has a FOV of 3 (almost orthographic projection). Distance Based (tessellation is gone!) Edge Length (all works fine!) 7

Getting Started / How To Use CFTD requires a script to work. This script calculates the Crack Free Buffers at scene start (though it can do that during runtime as well). To use CFTD, you need to add the script to objects that use the shader wither manually, or via the automatic tools that come with CFTD. Important: Please note objects that use the shader will have cracks in the editor, but they'll all be gone when you start the game. Auto Scene Manager The easiest way to use CFTD and manage all objects that use it, is to add the Auto Scene Manager to your scene. To do that simply click: (Top Menu) CFTD > Create crack Free Auto Scene Manager And you're done, the Manager will do the rest! Cracks will be gone at scene start. CFTD Per Object You can also apply a CFTD Buffer creator per object, if you need more control over what's happening. Either do it manually, or click: (Top Menu) CFTD > CFTD Per-Object > Add Buffer Creator to All You can still use the Auto Manager as well. Removing the Buffer Creator If you'd like to remove all Buffer Creators from all objects in your scene that use the script, just click: (Top Menu) CFTD > CFTD Per-Object > Remove Buffer Creator from All This also useful if you want to clear up old projects that use a legacy version of CFTD, where the Auto Manager was not present. 8

Shader (Material) Settings Pimped Workflow CFTD uses what we call a 'Pimped Workflow'. It pimps your models by creating variations in the Metalness and Smoothness of the materials without additional maps. All values are derived from the Displacement Map. Check out the Material Paraments below. These settings and the workflow are shared between the different shader variations. The only differences are in the tessellation methods used. Distance Based Edge Length 9

Tessellation Settings (Distance Based) Tessellation Factor Maximum level of tessellation. Higher number means more detail. The max level specified here will be reached when the model is at the closest specified distance. Tessellation / Displacement Fade Distance This number is measured per polygon, it not based on the pivot of the model. This is the distance past which there will be no tessellation applied to the mesh. Tessellation will be at its maximum level at roughly 30% of this distance. For example, if Fade Distance is 10, the mesh will not be tessellated past that distance, while full detail will appear at a distance of 3. The tessellator will then interpolate between the two. Important: Finding the right Distance, along with the right Tessellation Factor are crucial for the adequate performance of CFTD. Tessellation Settings (Edge Length) Edge Length in Pixels This is the desired length of the tessellated edges on the mesh. The tessellator will try to keep this value constant. This reduces 'mesh swimming' and is a more adequate method than calculating tessellation based on distance. Lower number means more detail. The amount of detail is, however, not infinite. The tessellator will stop at an internal maximum tessellation level, even when you are very close to the given mesh polygon. Important: Using a very low number (i.e. 1 or 2) will have a significant impact on performance. Please not that 4 or 8 PX should usually be sufficient. 10

Shared Tessellation Settings (Both Shaders) Shadow Caster LOD: CFTD has the option to interpolate between the tessellated model and the base one when it comes to real-time shadow casting. Adjusting this setting can improve performance significantly. You don't usually need a very detailed mesh for shadows. Bumping this setting will, however, degrade the quality of the self-shadows on the tessellated surfaces. 0 means the highest tessellation level will be used, 1 means the base mesh will be used when it comes to shadow casting. Important: It is always recommended to use at least some level of tessellation LOD. Small values work well. Suggested values: 0.05-0.3 for Edge Length; 0.1-0.4 for Distance Based. Shadow LOD at 0 Shadow LOD at 0.5 Shadow LOD at1 11

Main Maps Albedo / Displacement This is the Diffuse (Albedo) texture of the material (RGB), with a required Alpha channel for the Displacement. Displacement is always gray-scale, thus we save an extra map by packing it into the Diffuse texture. Displacement tiling and offset are not tied to the Albedo settings! You can tile / offset Displacement independently, even though it is packed in the main map (more under Displacement Settings). Dark values in the alpha result in lower displacement and vice-versa. A displacement map is usually hand crafted or baked. However, you can generate one automatically, right inside Unity! To do this simply tick the 'Alpha from Grayscale' option on your Albedo texture and apply. CFTD also has a tool to combine a separate Displacement texture into your Albedo's alpha (more under CFTD Texture Tools). You can also specify color tint by using the color tab. Important: CFTD will not work properly without an Alpha channel containing Displacement values. Normal Map This is the main Normal Map slot. CFTD can work without a Normal Map, and extra calculations are disabled in the code when that's the case, however, it looks much better with one. The value on the right controls the strength of the Normal Map. Negative values are allowed, too. Displacement Settings Displacement Scale Values in the Displacement map (the Alpha of the Albedo map) are scaled based on this value. Displacement Scale can be considered an arbitrary setting. It is best to just play with this value and see what works best with you mesh and maps. Important: Displacement Scale (and CFTD in general) does not play well with scaled meshes. For best results it is not recommended to use CFTD with scaled meshes. Small variations of the scale (i.e. to make various rocks) should work fine. 12

Displacement Offset This value can be considered the 'mid-point' of the Displacement. The default value is '0.5'. Again, this value is also somewhat arbitrary. Dark values in the Displacement Map (the Alpha of the Albedo map) result in no or little Displacement. They do not displace in a negative direction. I.e. a mid grey value means displacement of '0.5', not of '0'. Thus, you need to compensate for the overall positive displacement (or push) of the mesh, by lowering the offset setting. Important: Values of 0.45-0.49 should provide sufficient in most cases. Displacement Texture Tile / Offset You can tile and offset the Displacement Map independently from other maps by tweaking the values here. If your Albedo and Normal maps have tiling, you need to provide your desired values here manually. Material Parameters Important: CFTD creates variations in the Material Parameters based on the Displacement Map (the Alpha of the Albedo map). That is why CFTD does not require separate Metallic and Smoothness maps in order to create interesting materials and beautiful graphics. Metallic This is the desired Metalness level (or maximum Metalness level, since dark values in the Displacement Map will alter this value). Smoothness This is the desired Smoothness level (or maximum Smoothness level that is, since dark values in the Displacement Map will alter this value). 13

Specularity Variation Specularity Variation is derived from the red channel of the Albedo Map. Increasing this value creates interesting variations in the Smoothness levels on the material. This helps with simulating an actual Smoothness map on the mesh. Specular Ambient Occlusion Specular 'Ambient Occlusion' is derived from the Displacement Map (the Alpha of the Albedo map). It is not Ambient Occlusion per se, but a way to simulate it. The way it works is, values from the Displacement Map alter the Metalness and Smoothness values of the material. The default setting of Specular AO is '0.5'. At this this setting, the material will have consistent Metalness and Smoothness based on the settings you have specified above. At values above 0.5, CFTD will simulate dust and age on a model. Areas that are concave and not displaced (or in other words areas where the Displacement Map is darker) will be less shiny and more dull. For instance, to simulate concave mortar joint on a brick wall, bump this value to 1. Values under 0.5 will do the opposite. Areas that are concave will be shinier and will look newer. This is useful if you would like to simulate wear on metals, as an example. Diffuse Ambient Occlusion Aka Diffuse Burn, is a rough way to simulate self shadows / Ambient Occlusion on a mesh. It simply burns the Albedo Map with the dark values from the Displacement Map. The resulting burned map is not quite physically-shading friendly. It is useful when you want to have very dark cracks and with small concave areas. 14

Global Illumination Ambient Occlusion (GI AO) GI Ambient Occlusion also uses the Displacement Map. Increasing this value simulates Ambient Occlusion on the Global Illumination of the mesh. Dark values on the Displacement Map (ridges and concave areas) will result in those areas on the mesh receiving less GI. This is superior to Diffuse Burn in terms of quality and looks, but is less visible. Important: The material setting sliders have a bit of a learning curve. They all work together and usually all need to be tweaked to get best results. However, with just these sliders you can get a very precise control of the material settings and look of the materials. Just spend some time and have fun! Standard Settings Tweaked Settings 15

Secondary Maps Secondary Map calculations are disabled in the code when these maps are not used. These should be smaller-sized maps (like 256 x 256) that contain some tiling 'noisy' detail. They are used to create micro detail and should tile quite a few times (4x or 8x). Detail Albedo Map Detail Albedo will add detail to the Albedo (Diffuse) map of the material. It is best to use a neutral-valued map (i.e. somewhat mid-gray). Detail Normal Map Detail Normal is combined with the main normal map to add micro detail. You can also control the strength of the Detail Normal Map. Negative values are also allowed. Detail Map AO Detail Map AO controls where the Detail Maps will be more visible on the mesh. This depends on the values of the Displacement Map and the given slider. At '0' Detail Maps will be visible all across the mesh. Higher values will make the details appear at areas where the Displacement Map is darker (concave areas). This is useful when you want the displaced (higher) areas of the mesh to be more polished and 'shiny'. For instance, if you want only the mortar on a brick wall to have more detail and be more 'bumpy'. Lower values will make details appear where the Displacement Map is lighter (on displaced areas). This can help simulate scratches on metal areas that are more exposed. 16

Texture Tools CFTD includes a tool that automatically combines an Albedo (Diffuse) texture and a Displacement / Height texture. It is useful when you have downloaded texture or material packs and would like to combine those maps in Unity. It might not work in all cases, as it attempts to recognize the Displacement texture automatically. Nonetheless, it can help you avoid the hassle of combining those textures in an external image editing tool. To use it simply select your Albedo / Diffuse texture and Displacement texture in the project explorer (the textures themselves, not objects in a scene) and click: (Top Menu) CFTD > Texture Tools > Smart Combine Albedo + Heightmap. The new texture should appear in the same folder where the two textures were. Generating and importing might take some time. Static Subdivision Tools CFTD tessellates edges, but it cannot create infinite amount of detail. An edge on a given mesh needs to be decently small, in order for CFTD to achieve the desired level of detail. Otherwise, displacement will look pretty bad, as the mesh would not have enough detail (or newly created vertices) to display it. To help elevate this issue, CFTD includes a static subdivider, that adds more detail at startup. Note that this detail is not dynamic, such as the GPU tessellation that CFTD provides. The subdivider is just a tool to help with some stubborn meshes and it should be considered more of a last-resort. 17

Example The Unity default cube with a CFTD Distance Based shader with a tessellation setting of 32 (the maximum level). Notice the mesh does not have enough detail to display the bricks, even though tessellation is maxed out! The same cube, now with a subdivider (set at 4x). The mesh now has enough detail and everything looks nice and fine! Important: The subdivider, and CFTD in general, work best with meshes that have somewhat regularly sized polygons (triangles). The closer the mesh triangles are to being equilateral (or just more regular and consistent), the better results CFTD will have! 18

Demo Scene CFTD comes with a pretty sweet demo scene! The scene requires a bunch of Standard Assets to work. Please check the readme file in the main CDTD folder for specific instructions on the demo scene. If you have purchased CFTD, you can use all custom assets form the demo for every project you would like! Thank you for purchasing and please remember to rate and review CFTD! 19