Modifiers¶
Modifiers can be either added separately or are already used on the road presets. Modifier position on the modifier stack matters. The road modifier stack can consist of the following operators:
- Input Curve - prepares the input geometry curve
- Profile - multiple tq profiles define the individual parts of road surface
- Road Mark (optional) - adds road markings
- Distribute (optional) - adds distributed assets along the curve
- Scatter (optional) - adds scattered assets along selected road surface types
- Cleanup - merges unnecessary geometry, can realize instances for conversion to editable
Randomized parameters input convention
Randomized parameters in the modifiers work the same way. Randomized value of 20
means the
parameter will be calculated as: Base + Random([-20, 20])
.
Curve radius has to be 1.0
The generated geometry is affected by the curve radius, the curve radius should be set to 1.0 for proper functionality and scaling!
Inputs of each modifier can be tweaked to your liking, however already generated crossroads will not adapt.
Crossroads are automatically constructed in Build Roads automatically with a set of Crossroad Modifiers.
Input Curve¶
Nodegroup: tq_Input_Curve
A modifier that prepares attributes on the input curve, resamples it and fillets it.
Parameters
Resample Length
- Number of lines that create the final curve (a new point is created every Resample Length meters).Fillet Radius
- Maximal radius of the road turn (This corresponds to the Fillet Curve Radius node input).
Named attributes
@base_resample
- Stores the Resample Length parameter to be used in subsequent modifiers.@curvature
- How much is the road curve. Value in range [0, 1]. Value of 0 means straight, 1 means very sharp curve.@layer
- Layer of the road generator profile. Initialized to 0.@slope
- Estimated slope of the curve. Value is in range [-1, 1]. Limits values are completely vertical roads, in opposite curve directions.
Road Mesh / Profile¶
Nodegroup: (tq_Profile)
Used for generating the road surface additively. Each profile modifier creates a mesh that follows the original curve with an offset along normal. This can be used to generate the cross-section of the road mesh. Multiple modifiers can be combined to create more complex road meshes.
Parameters
Surface Type
- Defines what surface this part of road is. This value is used further more in tq_Scatter and for crossroad generation.0
- Other1
- Road Surface2
- Road Marking3
- GrassWidth
- Width of current profile. If both sides are generated, then this is width of each side.Exclude From Width Stack
- If toggled OFF, then this profile does not count into the additive width.Height
- Height of the current profile.Vertical Offset
- Offset of the generated profile from the curve positions across Z axis.Horizontal Offset
- Offset of the generated profile from the width based position. IfExclude From Width Stack
is used, then this is offset from the input curve. This can be used to introduce gaps.Sides Generation Mode
- There are three modes. If mode is0
then the profile is generated on both sides (or in the middle for first profile modifier). If mode is1
then profile is generated on the left side, and if2
a profile is generated only on the right side.Profile Object
- Custom profile object, by default a quad without bottom edge is used. Read more info inUsing Custom Profile Object
if using custom profile object.Material
- Material to apply on this generated profile.UV Scale
- Scale of generated UVs - scale 1 means that one UV patch is generated on 1x1m area.UV Offset
- Offset of generated UVs.Auto Smooth
- Angle (in degrees) threshold for auto smoothing.Ending Length
- Length of road ending on each spline. Ending slowly transitions the profile height to zero.
Using Custom Profile Object¶
- Profile object is an arbitrary CURVE.
- Profile object has to be defined in YZ axis (facing from X) and have scale (1, 1, 1), then the width and height controls will work correctly.
- The origin of the object affects the generated mesh geometry on the and it is preferable for it to be under the center of the object bounding box.
- The direction of the curve in the profile object matters. The direction can change the face normals
(Use
Segments -> Switch Direction
in edit mode to change the direction). - The profile object has to have unique name, otherwise the object can be exchanged from different road types, while loaded in the scene.
Named attributes
@surface_type
- Value is based on the eponymous input. Stored on the generated mesh, reused in other modifiers.@layer
- Incremented by one each profile modifier.@span_left
- Cumulative width on the LEFT side of the road center.@span_right
- Cumulative width on the RIGHT side of the road center.@uv
- Generated UV mapping - can be used in material shaders.@uv_norm
- Per road profile normalized UV mapping.
Material UV mapping
In order to use the generated UV mapping you have to create an Attribute
node in the shader
with attribute value set to @uv
and read its vector output. There is also tq_Mapping
nodegroup that reads the attribute for you.
For additional material features like like mixing, you can use @uv_norm
.
Creating other than road surfaces
This modifier can also create guard rails when combined with
tq_Distribute. You can create horizontally offset geometry by using
the Exclude From Width Stack
input (for example a rail system).
Distribute¶
Nodegroup: tq_Distribute
Distribute modifier can be used to add additional detail by distributing assets along a offset curve. The modifier is highly customizable and allows a lot of fine-tuning of how the assets are distributed. This can be used to add trees, bollards, repeated signs, lamps, or other assets next to the road.
Note
The modifier tries to keep the desired distance between points, in order to have finer detail, change the resampling.
!!! tip "Slope and curvature instancing
Distribute modifier supports instancing only in curves or in steep sections of road. Check the
Curvature Instancing
Slope Instancing
parameters.
Base parameters
Distribute Curve Resample
- Resample of the base curve. Points from this curve are selected for distribution. Provide higher number for more finer adjustment.Curve Normal Offset
- Offset of the distribute curve along normal of the input curve.Mirror
- If set to true then the distribution will also be generated on the opposite side of the input curve.Collection
- One or more assets to distribute on the curve. In case of more assets, the assets from the collection are distributed sequentially.
Instancing parameters
Fill
- If set to true then the modifier will try to populate the whole curve with the distributed assets. Ensure to have only one asset in the collection for correct results.Fill Spacing
- Spacing between assets ifFill
mode is active.Instance Spacing
- Spacing between assets in default mode.Slope Instancing
- Enable / Disable slope based instancing.Slope Threshold
- Threshold for instancing based on slope values. Negative values control instancing on straights, positive on slope.Curvature Instancing
- Enable / Disable curvature based instancing.Curvature Threshold
- Threshold for instancing based on curvature values. Negative values control instancing where the curvature is high, positive where the curvature is low.Offset Along Curve
- Offsets the asset along the direction of the curve between the two generated points.
Transform parameters
Rotation (Deg)
- Base rotation of instanced assets.Random Rotation (Deg)
- Randomized rotation to be added to base rotation in degrees.Random Rotation Seed
- Seed for the randomized rotations.Offset
- Offset in world coordinates of all instances.Random Offset
- Randomized offset of each instance. This input works the same as theRandom Rotation (Deg)
.Random Offset Seed
- Seed for the randomized offset.Scale
- Base scale of instanced assets.Random Scale
- Randomized scale of all components at once.Random Component Scale
- Randomized scale that is applied to each of XYZ component separately.Random Scale Seed
- Seed for the randomized scale.
Named attributes
This modifier only reads named attributes and does not change them in any way.
Scatter¶
Nodegroup: tq_Scatter, tq_ScatterToTarget
Scatter modifiers can be used to add additional detail on the road or next to the road. This can be used to add textured decals, pebbles or grass or to create a more complex nature system next to the road.
There are two variants of nodegroups for scattering modifier. tq_Scatter
can be used to scatter
on the object where it is assigned in a modifier. tq_ScatterToTarget
can be used to scatter to
selected collections of objects.
Scattering parameters
Scatter On Other Surface
- scatter on profiles withSurfaceType
marked asOther
Scatter On Road Surface
- scatter on profiles withSurfaceType
marked asRoad
Scatter On Grass Surface
- scatter on profiles withSurfaceType
marked asGrass
Instance Collection
- Objects from this collection are instanced.Seed
- Seed for the main distribution of objects.Density
- How many objects are scattered on area of one m^2 (squared meter).Collision Distance
- Limits instancing of objects based on their relative distance between each other.Viewport Display
- How many instances are shown in the viewport vs in the render.Max Slope
- Limits instancing to faces based on how they are aligned to the Z axis.
Proximity parameters
Proximity Objects
- Collection of objects from which the scatter will keep distance based onMin Distance From Objects
andMax Distance From Objects
parameters.Min Distance From Objects
- Minimal distance from objects inProximity Collection
.Max Distance From Objects
- Maximal distance from objects inProximity Collection
.Boundary Min Distance
- Minimal distance of scattered instanced from the object boundaries.Boundary Edge Angle
- If the object is not a simple plane, the boundary is calculated by the edge angle. This value in range 0-1 controls what angle can be considered as a boundary.
Transform parameters
Instances Offset
- Offset of each instance.Align To Face Normal
- Align instanced objects to normal of the face, where the object is instanced.Base Rotation (Deg)
- Base rotation of instanced assets.Random Rotation (Deg)
- Randomized rotation to be added to base rotation in degrees.Rotation Seed
- Seed for the randomized rotations.Base Scale
- Base scale of instanced assets.Random Scale
- Randomized scale of all components at once.Random Component Scale
- Randomized scale that is applied to each of XYZ component separately.Scale Seed
- Seed for the randomized scale.
Named attributes
This modifier only reads named attributes and does not change them in any way.
Road Markings¶
Nodegroup: tq_RoadMark
Generates a road markings mesh snapped to the road surface that acts as a road marking.
Parameters
Offset
- Offset along the curve normal.Mirror
- Mirror or not the road markings along the input curve.Ground Offset
- Offset from the ground after ray-casting. Use to tweak Z-fighting.Resample Length
- Resampling of the base curve where the marking is generated. Tweaking is required for correct lengths ofMarking Length
andSpace Length
. You can use smaller values if there is not a requirement for smooth road markings in corners.Marking Length
- Length of the marking between spaces.Space Length
- Length of spaces between individual lanes.Width
- Width of the road marking.Material
- Material of the road marking.
Named attributes
This modifier only reads named attributes and does not change them in any way.
Crosswalk¶
Nodegroup: tq_Crosswalk
This modifier generates crosswalk on a crossroad or on a road segment. Crosswalk size and material can be parametrized, with its rotation. The crosswalk is snapped to the road surface.
Parameters
Position Offset
- Distance from the first point of the first spline, where the crosswalk is generated.Crossroad Point Index
- Index of the crossroad neighbor point where crosswalk will be generated.Ground Offset
- Offset from the ground after ray-casting. Use to tweak Z-fighting.Rotation
- Rotation of the generated crosswalk.Width
- Width of the generated crosswalk.Marking Length
- Length of the marking between spaces.Space Length
- Length of spaces between individual lanes.Material
- Material of the crosswalk.
Named attributes
This modifier only reads named attributes and does not change them in any way.
Cleanup¶
Nodegroup: tq_Cleanup
The cleanup modifier is used to clean the mesh based on distance and can be used to
Realize Instances
of the generated geometry for conversion to mesh.
Parameters
Merge Distance
- Distance of points that are going to be merged together.Only Connected
- If true, then only connected meshes are joined, if false everything is joined based onMerge Distance
.Realize Instances
- If true all instances will be realized as a geometry. This slows performance, use only if you know what you are doing. This is required for converting to a mesh.
Named attributes
This modifier does not change named attributes in any way.
Crossroad modifiers¶
Advanced Users Only
For most use cases it is enough to use the Build Roads
operator for creating crossroad
semi-automatically.
Crossroad modifiers generate the geometry of the crossroad. Modifiers on crossroad are constructed
by the Build Roads
operator. However, for experienced users it is possible to create a crossroad
manually. It requires creating many modifiers. There are multiple tq_CX_RegisterAdjacency
modifiers, where each creates a curve between sides of neighboring roads. After each
tq_CX_RegisterAdjacency
a tq_CX_Profile
modifier can be present that adds geometry to that
neighboring side, this modifier works similarly to tq_Profile
. The geometry of the road surface
between the neighboring roads is generated with the last modifier in the stack tq_Build
.
Road markings can be added using tq_RoadMark
and instances using tq_CX_Instance
.
It is recommended to check how a crossroad modifier stack is constructed by the Build Roads
operator and create your own based on that.