Overview
Render Entities available in CRYENGINE give designers quick ways of introducing various effects and visuals.
Cloud
The cloud entity allows you to place clouds in the level. The cloud definition files (.xml) are built with the cloud tool. Unlike with skyboxes, 3D clouds can be moved and players can fly though them.
See Setting Up Weather Effects for more information.
Property | Description |
---|---|
CloudFile | Defines which cloud object should be displayed. |
Scale | Deprecated |
AutoMove | Defines if the cloud should move or not using the speed property (cloud can also be moved with the Trackview Editor). |
FadeDistance | The distance in meters when the cloud should fade in when moving from one side of the Space Loop Box to the other. |
SpaceLoopBox | Defines the box in which the cloud moves from one end to the outer (looping). |
Speed | Specifies the speed in X, Y, Z direction. |
Flash
The entity flashes the users screen making it white for a few seconds. Very bright explosions can be simulated with the Flash Entity. Trigger strikes through flow graph.
Property | Description |
---|---|
SkyHighlightAtten | Specifies attenuation amount on the sky highlighting. |
SkyHighlightColor | Specifies in which color the skybox will be lit by the lightning effect. |
SkyHighlightMultiplier | Specifies how bright the skybox will be lit by the lightning effect. |
Sound | Specifies a sound to play when triggered. |
FadeInTime | Sets up the amount of time (in sec.) how long it takes to fade in the effect. |
FadeOutTime | Sets up the amount of time (in sec.) how long it takes to fade out the effect. |
FadeDuration | Sets up the amount of time (in sec.) fade in and out takes the effect. |
Fog
The Fog entity is used to overwrite the fog effect in specific areas. In indoor areas a subtle fog effect can be added to simulate a dusty area.
To use, create an area shape and link the shape to the Fog Entity. When in game mode, you can walk into the area and see how the fog gets different inside. Outside Game mode the fog is not visible.
Property | Description |
---|---|
AtmosphereHeightModifier | Defines the height of the density above sea level. The higher the atmosphere the less visible the effect of horizontal fog layers. |
FadeTime | Sets up the time in which the fog takes to fade in. |
GlobalDenstiyModifier | Specifies the density of the fog. |
FogVolume
Render FogVolumes exhibit the same properties of global volumetric fog, with the added benefit of locality. Currently supported volume types are boxes and ellipsoids (including spheres as a special case).
The benefit of using a FogVolume is that it is possible to define fog volumes that can be non-uniformly scaled along their major axes, rotated, and have an arbitrary fall-off direction (unlike global volumetric fog which defines the world space up-vector as its fall off direction).
An ellipsoid fog volume
Fog volumes are placed as entities. To place one open the RollupBar, select Entity, Render and then FogVolume in the tree view below. Drag the entity into the render view to place it. You should be see a white, spherical fog volume.
Translation and Rotation of a fog volume entity is performed via the move and rotate edit mode just like for any other object. Non-uniform scaling will distort the entity and produce incorrect rendering results.
Property | Description |
---|---|
Active | Select/deselect this box to enable or disable this fog volume entity. |
Color | Set the fog color. |
DensityOffset |
|
FallOffDirLati | This value controls the latitude of the world space fall off direction of the fog. |
FallOffDirLong | This value controls the longitude of the world space fall off direction of the fog. 0° represents East, rotation is counter-clockwise. |
FallOffScale | This value scales the density distribution along the fall off direction. Higher values will make the fog fall off more rapidly and generate thicker fog layers along the negative fall off direction. |
FallOffShift | This value controls how much to shift the fog density distribution along the fall off direction in world units (m). |
GlobalDensity | This value controls the global density of the fog. The higher the value the more dense the fog and the less you'll be able to see objects behind or inside the fog volume. |
HDRDynamic | HDR brightness multiplier for the fog color. |
NearCutoff | Stop rendering the object, depending on camera distance to object. |
SoftEdges | This value specifies a factor that is used to soften the edges of the fog volume when viewed from outside. |
UseGlobalFogColor | During rendering the Color property is ignored. Instead, the current global fog color is used. Please refer to the Volumetric Fog page for further information. |
VolumeType | Specifies the volume type. The following types are currently supported: 0 - Ellipsoid, 1 - Cube.
|
Size | The height/width/depth of the fog volume in world units (m). Non-uniform scaling is possible so height, width and depth don't have to be the same. |
Special Tips
- Fog volumes should not overlap. In some situations (i.e. clever placement of volumes) it might work but in general it won't. Fog volumes are internally treated and processed like alpha-transparent objects so the general sorting issue of these apply here as well. However, inclusion should work as it is guaranteed that smaller ones never overlap with bigger ones.
- Even though alpha-transparent objects behind fog volumes will be fogged per-pixel, this is not the case for when they are inside fog volumes.
- Fog densities cannot change in dynamic, non-uniform way (smoke-like). A particle effect with soft particle blending enabled is much better suited for that purpose.
Debugging:
e_Fog
Activates global height/distance based fog
e_FogVolumes
Activates local height/distance based fog volumes
Troubleshooting
Q: Shadow maps inside fog volumes do not work, what's wrong?
Make sure you have the cast/receive shadow flag unchecked for each fog volume entity.
Q: In indoors fog volumes sometime suddenly disappear when player moves around, how can this be fixed?
Make sure your fog volume entity doesn't cover more than one sector. They'll otherwise get culled when the main sector they were registered to becomes invisible.
Lightning
Lightning entities simulate Lightning effects. See Setting Up Weather Effects for more information.
Property | Description |
---|---|
Active | Turns the effect on or off. |
Distance | Specifies how far away from point where the entity was placed that the lighting effect should happen. |
DistanceVariation | Adds a random value to the distance, for example 20 means +-20% if the Distance is set to 100. |
RelativeToPlayer | Sets the effect relative to the player so always with the same distance. |
Effects |
|
LightIntensity | Specifies how bright the light should be. |
LightRadius | Within this radius objects will be lit. |
ParticleEffect | Specifies the lightning bolt effect. |
ParticleScale | Sets up the scale of the lightning bolt effect. |
ParticleScaleVariation | Sets up the scale variation of the lightning bolt effect. |
SkyHighlightAtten | Specifies the Sky Light Attenuation. |
SkyHighlightColor | Specifies in which color the skybox will be lit by the lightning effect. |
SkyHighlightMultiplier | Specifies how bright the skybox will be lit by the lightning effect. |
SkyHighlightVerticalOffset | Specifies how bright the skybox will be at the zenith. |
Sound | Sets up a sound effect that should be played when the effect happens. |
Timing |
|
Delay | Frequency of the lightning strikes, measured in seconds. |
DelayVariation | Varies the frequency of the lightning strikes. |
LightningDuration | Defines how long the visual effect of the lightning strike should last, in seconds. |
ThunderDelay | Delay time, in seconds, for the thunder sound to reach the player. |
ThunderDelayVariation | Varies the delay time for the ThunderDelay sound. |
PrismObject
ViewDist
The ViewDist entity limits how far the player can see. Using the ViewDistance entity can significantly increase the frame rate in specific areas.
This entity can be used in two ways, by linking it to an area shape or triggered through flow graph.
Property | Description |
---|---|
FadeTime | Specifies the amount of time it takes to fade from the current level ViewDistance settings to the MaxViewDist setting in the entity. |
MaxViewDist | Sets up the rendering View Distance in meters. |
VolumeObject
Volume objects in CRYENGINE offer the possibility to render volumetric effects of density fields (clouds, smoke, etc) in a realistic way. A volume description is converted into a 3D density field (texture) at load this. This density field is then used to calculate self shadowing, surface extraction, and shading at runtime. Currently the density field cannot be dynamically changed. Unlike 3D clouds volume objects are rendered in a single pass (no imposters needed). The pixel shader computes the final shading result by tracing the density field and density and shadow information at each sample point. Samples are blended using the "Under Operator". Additionally, back lighting and soft intersections with opaque scene geometry is supported.
Volume objects in CryENGINE.
Unlike the Cloud Object, the Volume Object renders 3D Volume objects with correct shading (shadows on the darker parts). The benefit of using a Volume Object is that it can be used to place realistic clouds in the level or for building irregular fog areas with varying heights.
Sandbox Usage
Follow these steps to place volume objects in a new level.
- On the RollupBar, select the Objects tab and click on the Entity button.
- Select the Render folder and drag a VolumeObject entity inside the level.
The Entity Properties section provides several options (for the most part these are equivalent to the entity properties for 3D clouds).
Property | Description |
---|---|
VolumeObjectFile | Specifies the .xml file containing the description of the volume object. It is compatible with the description file for 3D clouds. The description will be used to voxelize a 3D volume that will be used for rendering. |
AutoMove | Defines if the cloud should move or not using the speed property (cloud can also be moved with the Trackview Editor). |
FadeDistance | The distance in meters when the cloud should fade in when moving from one side of the Space Loop Box to the other. |
SpaceLoopBox | Defines the box in which the cloud moves from one end to the outer (looping). |
Speed | Specifies the speed in X, Y, Z direction. |
Material Parameters
The VolumeObject requires the VolumeObject shader in order to render. A basic example material can be found in materials/clouds/volumeobject.mtl
or you can create one with your own settings.
Material Parameter | Description |
---|---|
Diffuse Color | Defines color for shadowed areas of the the volume object. It's modulated with the current sky color. |
Specular Color | Defines color for directly lit areas of the volume object. It's modulated with the current sun color. |
Shader Generation Parameters
Volume objects expose the following shader generation parameters via the Shader Generation Params section inside the Material editor.
Soft Intersections | Enables soft intersections with (opaque) scene geometry. Consider enabling this feature only for volume objects that need it due to increased pixel shading cost. |
Back Lighting | Enables back lighting of volume objects. The silhouette will slightly glow when viewed against the sun. |
Tips
- To save texture memory and shader cost the resolution of the 3d volume texture is fixed and limited (64x64x64). Therefore you should make sure your volume description doesn't contain too many high frequency details. They would otherwise get lost during voxelization and/or rendering (aliasing)!
- To improve speed on lower spec configs less samples are taken when computing ray tracing results -> higher chance of aliasing.
- To save texture space reuse a given volume description file as much as possible and rotate volume objects when placing them into the scene to create the illusion of variation. Volume descriptions (and their associated textures are shared) so instances only need individual textures to bake shadow information.