Table of Contents

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This page provides information on the VRayDisplacement node.

 

Page Contents


Overview


Displacement mapping is a technique for adding detail to your scene geometry without having to model it first. The concept is very similar to bump mapping. However, bump mapping is a shading effect that only changes the appearance of a surface, while displacement mapping actually modifies the surface.

The VRayDisplacement node has two different functionalities. First, it allows us to subdivide a geometry during render time. Additionally, it allows us to apply displacement mapping to an object.

 


 

UI Path: ||Toolbar|| > V-Ray menu icon > Geometry > VRayDisplacement

 

 


 

Example: Displacement vs Bump Mapping

 

This example shows the difference between bump mapping and displacement mapping. Notice the round outline of the sphere and its shadow in the case of bump mapping, and the deformed outline produced by the displacement:

 

 

 

Bump mapping

 

Displacement mapping

 

 

 

 


 

Inputs


The VRayDisplacement node has two inputs:

geo – Connects the geometry you would like to subdivide or displace.

displ – Connect the texture you would like to use for the displacement.

 

Subdivision rollout


 

 

 

Render as subdivision surface – When enabled, the object will be subdivided during rendering.

Preserve Map Borders – Specifies how to handle subdivisions of UV coordinates at UV seams when Subdivide UVs is enabled. The possible values are:

None – UVs are always subdivided regardless of whether they are on a UV seam or not.
Internal – Only preserve UVs if they are on an internal UV seam.
All – Does not subdivide UVs on UV seams.

Subdivide UVs – Determines whether or not the UVs of the object will be subdivided at the borders.

Generate Static Geometry – When enabled, the subdivision geometry will be pre-compiled into an acceleration structure at the beginning of the rendering and remain there until the end of the frame. This might speed up the rendering and increase the memory usage.

Classic Catmull Clark – When enabled, V-Ray will use the Classic Catmull Clark method for subdividing the mesh instead of the hybrid one used by default. This option will work correctly only if the mesh is composed entirely of rectangular faces.

 

Subdivision and Displacement Quality





Use Global Settings – When enabled, V-Ray uses its default settings when rendering Subdivision and Displacement geometry. Unchecking the box allows you manually control the quality of those two types of geometry.

View dependent – When this option is enabled, Edge length determines the maximum length of a subtriangle edge, in pixels. A value of 1.0 means that the longest edge of each subtriangle will be about one pixel long when projected on the screen. When View-dependent is off, Edge length is the maximum subtriangle edge length in world units.

Edge Length – Determines the quality of the displacement or subdivision. Each triangle of the original mesh is subdivided into a number of subtriangles. More subtriangles means more detail in the displacement, slower rendering times and more RAM usage. Less subtriangles mean less detail, faster rendering, and less RAM. The meaning of Edge length depends on the View-dependent parameter above. For more information, see the Edge Length example below. 

Max subdivs – Controls the maximum subtriangles generated from any triangle of the original mesh. The value is, in fact, the square root of the maximum number of subtriangles. For example, a value of 256 means that at most 256 x 256 = 65536 subtriangles will be generated for any given original triangle. It is recommended that this value be kept relatively low. If you need to use higher values, it will be better to tessellate the original mesh itself into smaller triangles instead.

 


 

Example: Edge Length 

 

The image below was rendered in a way, representing the original triangles of the mesh. Now, V-Ray will not only smooth the surface normals but will also automatically apply a normals map that represents the normal of the perfect displaced surface, which will make the surface look a lot more detailed than it actually is.

View-dependent is turned on, and it refers to pixels in the original image, not the zoomed-in image you get with a blow-up rendering. This is why we were able to do a blow-up rendering to see the individual subtriangles better. Click the images for a larger view:

 

Edge Length 0.5

 


Edge Length 0.5 Close up view

 


Edge Length 1.0

 


Edge Length 1.0 Close up view

 


Edge Length 2.0

 


Edge Length 2.0 Close up view

 


Edge Length 5.0

 


Edge Length 5.0 Close up view

 

Edge Length 10.0

 

Edge Length 10.0 Close up view

 

 

 


 

 

Displacement Control rollout


 

 

 

None – When checked, disables the displacement.

Geometry Generation – Determines when the geometry is compiled during rendering. Note: When rendering to the GPU with displacement, all geometry uses the Pre-tessellated method.

On the Fly – The subdivision geometry dynamically goes into the dynamic memory pool during rendering from which it can later be removed if needed. This process is at the expense of some speed but potentially saves memory. Note: This option is not supported when rendering is done on the GPU.
Pre-tessellated – The subdivision geometry will be pre-compiled into an acceleration structure at the beginning of the rendering and remains there until the end of the frame. This can speed up the rendering and increase memory usage. 

Displacement Type – Specifies the mode in which the displacement will be rendered.

2D – This method bases the displacement on a texture map that is known in advance. The displaced surface is rendered as a warped height-field based on that texture map. The actual raytracing of the displaced surface is done in texture space, and the result is mapped back into 3D space. The advantage of this method is that it preserves all the details in the displacement map. However, it requires the object to have valid texture coordinates; you cannot use this method for 3D procedural textures or other textures that use Object or World coordinates. The displacement map can take any values (as opposed to the Normal method, which will ignore values outside the 0.0-1.0 or black to white range).
Normal – This is a general method which takes the original surface geometry and subdivides its triangles into smaller sub-triangles which are then displaced. It can use arbitrary displacement maps with any kind of mapping. Note that with the Normal method, the displacement map's range of values must be within the 0.0-1.0 range (black to white). Values outside of this range will be clipped.
Vector – If using a displacement texture that is not grayscale, V-Ray will convert it to grayscale before rendering the displaced geometry.This mode allows V-Ray to use the Red, Green and Blue channels of the displacement texture to displace the geometry in the U and V directions in addition to the normal of the face.
Vector (absolute) – This is a Vector displacement mode in which the texture is interpreted as 0.5-based tangent space displacement map.
Vector (object) – This type is only meaningful with Ptex displacement textures through the VRayPtex texture, where the texture values represent zero-based displacement in object space. If mesh information is stored in the Ptex file, V-Ray can also correctly displace mesh deformations.

Displacement Amount – The amount of displacement. A value of 0.0 means the object will appear unchanged. Higher values produce a greater displacement effect. This value can also be negative, in which case the displacement will push geometry inside the object.

Displacement Shift – Specifies a constant which will be added to the displacement map values, effectively shifting the displaced surface up and down along the normals. This value can be either positive or negative. For more information, see the Displacement Shift Parameter example below.

Keep Continuity – When enabled, V-Ray will try to produce a connected surface. Use it when you get splits (usually around sharp edges) in the displaced geometry. For more information, see the Keep Continuity Option example below.

Enable Water Level – When enabled, the surface geometry will be clipped in places where the displacement map value is below the threshold specified by the Water Level field. This option can be used for clip mapping a displacement map value below which geometry will be clipped. For more information, see the Enable Water Level example below.

Water Level – Specifies the threshold below which the surface geometry will be clipped.

Cache Normals – When enabled, V-Ray generates and saves information about the normal of each newly generated vertex. This requires additional memory but speeds up the shading calculations during rendering.

Texture resolution – Determines the resolution of the displacement texture used by V-Ray. If the texture map is a bitmap, it would be best to match this resolution to the size of the bitmap. For procedural 2D maps, the resolution is determined by the desired quality and detail in the displacement. Note that V-Ray will also automatically generate a normals map based on the displacement map, to compensate for details not captured by the actual displaced surface.

Precision – Precision of the calculation for the surface's curvature. Lower values are appropriate for flat or near-flat surfaces, while more curved surfaces require higher values. Lower values compute faster than higher values. For a flat plane, a value of 1 is appropriate. If the Precision value is not high enough for the curvature, dark spots ("surface acne") might appear on the displacement. 

Tight bounds – Causes V-Ray to compute more precise bounding volumes for the displaced triangles, leading to slightly better rendering times. 

Filter texture – When enabled, the texture map will be filtered before the actual displacement takes place.

Displacement Bounds – This parameter controls how the minimum and maximum allowable values of the displacement texture are determined.

Automatic – V-Ray automatically determines the minimum and maximum values allowed for the displacement texture.
Explicit – Minimum and maximum values can be set manually.

Min/Max value – These two options specify custom boundaries for the displaced geometry. By default, the range is limited to values between 0 and 1. For more information, see the Texture Boundaries example below.

 


 

Example: Displacement Shift Parameter

 

Note that the Displacement Shift parameter is an absolute value in world units. If you change the Displacement Amount, you will probably need to adjust the Displacement Shift too.

 

 

Displacement Shift = -5.0

 

Displacement Shift = 0.0

 

Displacement Shift = 5.0

 

 

 


 

Example: Keep Continuity

 

The Keep Continuity option is useful for objects with disjoint normals on neighboring triangles, usually because of different smoothing groups. In the middle image below you can see the edge splits produced by disjoint normals. Using the Keep Continuity option avoids this problem. 

 

 

No displacement

 

Keep Continuity is off

 

Keep Continuity is on

 

 

 


 

Example: Water Level

 

The Water Level parameter is absolute in world units. If you change the Displacement Amount and/or Displacement Shift values, you will probably need to adjust the Water Level to get the same effect.

For this example, the Displacement Amount parameter is set to 5.0 and the Displacement Shift parameter is set to 0.0.

 


Water Level = 0.0 (no clipping)

 


Water Level = 1.25

 


Water Level = 2.5

 


Water Level = 3.75

 

 


 

Example: Texture Boundaries

 

This example shows a plane mapped with a displacement map that has negative values. With the default boundaries for the displacement, we are unable to see the geometry displaced in the negative direction. However, once we set the custom boundaries to -1 and 1 we can see the displaced geometry in both the positive and negative direction.

 


Min value = 0; Max value = 1

 


Min value = -1; Max value = 1