置换着色器
Detail can be added to the shape of a surface with displacement shaders.
To create displacement, connect a Displacementor nodeto the displacement output of the Material Output node. Procedural, painted or baked textures canthen be connected to these nodes.
Typical displacement node setup.
Three displacement methods exits, with varying accuracy, performance and memory usage.
Bump only, displacement only and displacement and bump combined.
It requires the mesh to be finely subdivided, which can be memory intensive.Adaptive Subdivision is the best wayto subdivide the mesh, so that exactly the right amount of subdivision is used depending onthe distance of the object to the camera.
For baked displacement maps, best results are achieved with 16 or 32-bit float maps,as 8-bit byte images often can not represent all the necessary detail.
See also
通过 也可以用来取代网格。
The least accurate but most memory efficient method is to use a bump mapping.This method does not actually alter the mesh surface, but merely changes the shading to make it seem so.
For baked bump maps 8-bit byte images are commonly used, however 16 or 32-bit float maps can providebetter looking results. When using image textures use Cubic interpolation to avoid stepping artifacts,these are more visible for bump maps than other types of textures.
Important
Because bump mapping is a fake effect, it can cause artifacts if the actual shape of the geometryis too different from the bump mapped shape. If this happens the strength of bump mapping shouldbe reduced or actual displacement should be used.
Both methods can be combined to use actual displacement for the bigger displacement andbump for the finer details. This can provide a good balance to reduce memory usage.
Once you subdivide the mesh very finely, it is better to use only actual displacement.Keeping bump maps will then only increase memory usage and render slower.