- Category: Materials
- Update: 1.0 (06-04-2019)
- Unreal Engine: 4.18-4.22
- Platforms: VR, PC, Console, HTML
Ice Cool is an advanced master material prepared especially to create multiple types of ice like ground ice, ice cubes, icebergs, crystals, glass and icicles. The translucent material option is a great solution for improving your level storytelling on cold arctic maps. Designed and optimized specially for Mobile, Virtual Reality, and stylized PC/Console games.
- Customization options. Over 200 parameters to make it look cool. Additionally, Over 50 switches allows controlling efficiency-quality trade off.
- Uses NEW FAST cracks rendering method. Implementation of new cheap iterative technique of parallax for rendering deep cracks based on Signed Distance Field Textures. Thanks to using SDF result effect stays clean and smooth even on closeups with using only 7 texture reads! (5 times faster than other methods).
- Supports multiple types of refraction. Supported cube map with box projection mapping/screen color/ build in refraction pin.
- Advanced translucency options. Translucency supports depth fading fog for better quality of covering the objects inside the ice.
- Subsurface scattering and custom lighting. Useful for more advanced user to better fit the ice into the scene.
- Extended reflection mode. System supports pre-rendered cube map reflections mapped on meshes using box projection mapping and spherical mapping. This method is very fast even on translucent materials.
- Icy vertex offsets. Material supports configurable Vertex displacement for Icicles.
- Masked dithering. You can configure system to use translucent material only where you need and dither the opaque material around the wholes.
- Animated dust. Configurable dust map with refraction noise makes material look even deeper and real.
- Efficient and GPU friendly. Uses between 90-210 instructions depending on the number of features enabled can be used on VR and even mobile.
- Extra tools. System includes additional tools for generating new Signed Distance Fields and environment cube maps.
- Multiple useful examples. Package contains example map with showcase of multiple samples of use the material.
Ice Cool is mackage based on single advanced master material. The material is placed in folder IceCool/Materials/M_IceCool. Basically every user have two ways of working with the package.
- Copy Material (Easy one) – Copy example material and modify parameter to fit the requirements. You can check the example materials in the demo IceMap.
- Create Material (Hard one) – Create material instance from master material and setup material parameters from scratch.
This documentation cover both approaches to create the cool ice material.
It is good practice to create New Folder where the materials created using Ice Cool package will be stored. Try to not modify or add any content do the Ice Cool package it will protect your project from problems after downloading the new updates of the package.
Copy existing material
Ice Cool package contains demo folder with multiple examples of materials of ice prepared for the specific conditions that can be copied to your project. All examples of ice materials are stored in the Demo/ExampleMaterils folder.
- Cracked ground
- Half translucent ice cubes
- Opaque icebergs
- Translucent icicles
- Ice shell
- Select material that you want to use in your game
- click right button on the material and choose duplicate (if you want to copy) or create material instance (if you want to extend material and modify parameters).
- Move the newly created material into your project folder.
Cracked ground is the most advanced use of the Ice Cool package. This material is prepared to be used as ground. The UV coordinates of ice texture are calculated in the world space so the material can be used regardless of mapping or ground size. There are multiple types of this material prepared for fulfil the requirements of quality and platform type that game targeting. Demo allows to see differences between every type of the material by pressing keys 1-7 on the example map .
|Opaque Unlit||Material parameters||Cubemap||All|
|Opaque Lit||Build in UE4||Reflection Captures||All|
|Translucent Unlit||Material parameters||Cubemap||All|
|Translucent Lit||Build in UE4||Cubemap||PC|
|Dithered Lit + Translucent Unlit||Mixed||Cubemap near the camera.||PC|
|Dithered Lit + Translucent Lit||Build in UE4. Best quality.||Cubemap near the camera.||PC|
|Dithered Unlit + Translucent Unlit||Material parameters||Cubemap||PC|
Half translucent cubes
Half translucent means that this type of ice is combination of two meshes opaque and translucent.
- Inside layer (MI_IceBlockBigInside) Opaque mesh is rendered from inside of the geometry (normal inverted front face culling)
- Outside layer (MI_IceBlockBigOutside) Translucent mesh is rendered traditionally as layer over the
This kind materials are useful when you want to put some meshes into ice cube and achieve good effect of refraction. Mesh will be rendered between inside and outside layer.
Very efficient good looking opaque material useful for icebergs that uses refraction based on external cubemap.
This material type was prepared especially for creating icicles hanging from a roof. Additional layer of animated dirt makes it looks wet.
Create new material
If you are not interested in using predefined materials of ice then there is always the harder path to follow. You can remove all demo content and create the material instance from scratch.
- Find the base material IceCool/Materials
- Duplicate the MI_IceCool or create material instance from M_IceCool.
- Rename newly created material and move to the Ice materials folder in your project.
- Material is ready to use from now.
I’m not recommending u this method. It requires a lot of knowledge abut the ice material and this documentation does not cover all details yet.
Reflection effect is based on pre-rendered cubemaps. Detailed explanation how to create cubemap for ice can be found in the Tools/Cubemap Rendering chapter. Ice materials supports two types of reflection mapping. Spherical reflections and box projection mapping.
- Spherical mapping – Very fast but inaccurate. Works out of the box.
- Box projection mapping – Very accurate in box shaped rooms. Requires additional room size informations in the materials.
|Box projection mapping|
|UseBoxProjection||Allows using box projection mapping. If disabled then system uses standard spherical cube-map projection.|
|ReflectionBoxExtend||half size of the room cached in the reflection map.|
|ReflectionBoxPosition||Position camera where the reflection was cached.|
|UseReflectionBoxLocal||Forces system to use reflection box capture in local space of actor position. Useful when mesh is connected to the same actor as reflection capture component.|
Other reflection parameters:
|ReflectionColor||Color of reflection allow to adjust the cubemap to underwater conditions. Alpha channel represents the power of fresnel.|
|ReflectionTexture||Prebaked cubemap reflection texture should be cached in place where the glass is rendered.|
|Use Shlick Reflection||Enables physical based Shlicks fresnel calculations. Otherwise uses fast simplified dot(camera, normal) fresnel.|
|UseReflectionBoxLocal||When true then ReflectionBoxPosition will be added to the actor position.|
Package supports multiple advanced types of refraction. Each type of refraction is useful for different scenario.
- Build in UE4 refraction
- Screen color refraction
- Opaque cubemap refraction
Fast dithered layers
The dithered material is the composition of two meshes with top layer implemented as dither translucent. That combination allows to use the slow translucent materials only where it is needed and increase quality of lighting and reflections with low cost by using the opaque material over the translucent.
- Top mesh layer uses opaque dithered opaque material that has high quality reflections and lighting implemented by Epic.
- Bottom mesh layer uses layer translucent material that is covered by top layer using ditered transition.
It’s good practice to use bottom translucent layer only where it is needed and cut invisible parts of this mesh to increase a performance by lowering the geometry overdraw.
Dithered material can be masked by vertex color alpha channel painted in the vertex paint mode. This functionality is active only when the UseDitheringVertexAlpha option in the top opaque material is active.
|Use Dithering Distance||Use dithering in distance from camera.|
|Use Dithering Vertex Alpha||Use masking of the dithering by vertex alpha.|
|Use Dithering Per Vertex||Calculate distance for dithering per vertex to lowerise the shader complexity. Can cause some quality problems when using low density meshes.|
|Dithering Border||Dithering distance border.|
|Dithering Smooth||Dithering border smoothing.|
Advanced algorithm of rendering parallax cracks uses the information about the distance from crack to render very efficient and smooth effect in only 6-8 texture reads. In comparison to other algorithms it is over 6 times faster and looks much better on closeups.
|Use Cracks||Whether the effect of cracks should be used in material. The cost of this effect is noticeable (obut 30-40) instruction so it’s good to enable this flag only when intended to use effect.|
|Cracks SDF Texture||Signed Distance Field texture used to generate effect. Detailed description about preparing SDF textures can be found in the chapter “Signed Distance Fields rendering” .|
|Cracks Color||Bottom color of cracks effect.|
|Cracks Color Light||Top color of cracks effect.|
|Cracks Depth Iteration||Number of iterations used to calculate the effect. Best results can be achieved in between 5-10 iterations. It’s worth to minimize this value for optimization.|
|Cracks Depth Step Size||Step size per iteration|
|Cracks Depth Scattering||Depth scattering scale.|
|Cracks Depth Scale||Depth intensity scale.|
|Cracks Depth Smooth||Smoothing of the effect. Should be lowered when there is a lot of holes in the cracks.|
|Cracks Distortion||Distortion of cracks based on normal-map.|
|Cracks Width||Width of the effect. Should be between 0.93 and 1.0.|
|Cracks Height||Height of the effect.|
Ice Cool package support deep layer of animated dust.
|Use Dust||Whether the dust should be used in material.|
|Dust Color||Color multiplier for the dust texture|
|Dust depth shift||Offset of the dut layer|
|Use Dust Layered||Whether to use second layer of dust.|
|Dust Layer Between||Interpolation of layer rendered in between base layer and mesh surface.|
|Dust Texture||Texture used as dust layer.|
|Dust Texture UV Scale||UV coordinates (X,Y) and scale(Z,W)|
|Dust Texture UV Anim||UV animation speed per second (X,Y)|
|Use Dust World Space UV||Whether to calculate dust UV in world space or take it from UV0.|
|Use Dust Noise||Whether to distort dust layer by noise texture.|
|Use Dust Noise Alpha||Whether to read distortion of UV dust layer from noise alpha.|
|Dust Noise Texture||Dust noise texture source.|
|Dust Noise Scale||Dust noise texture uv scale.|
|Use Dust Noise World Space UV||Whether to calculate dust noise UV in world space or take it from UV0.|
Shell effect extrudes the mesh in direction created from normal and gravity vector. The shell effect is useful for covering geometry by ice with additional icicles hanging from a mesh.
|Use Shell||Whether the shell effect should be enabled|
|Shell Offset||Channels RGB represents the direction of gravity length of this vector represents force. Channel A is shell size in direction of normal.|
|Shell Vertex Color R||Whether use R vertex color to scale the intensity of shell effect .|
Ice Cool package contains additional tools that can help to use the full potential of material system.
Cubemap reflections rendering
Materials uses cubemaps for simulating reflection and refraction of opaque materials. Those cubemaps can be created using BP_CaptureCubeMap blueprint.
- Place Blueprints/BP_SceneCaptureCube on your map and set up proper position to capture scene (center of the room would be great).
- Open IceCool/Tools folder and select the render target (RT_SceneCapture).
- Click right on the RT_SceneCapture and select “create static texture” newly created texture is ready to use.
- Set reflection texture cubemap to material parameter called ReflectionTexture.
Signed Distance Fields rendering
Signed Distance Field is an image where each pixel contains the distance to the nearest point on the boundary. An additional sign of distance allows determining if the pixel is inside or outside rendered shape. SDF image that looks like gradient can be loaded from a file or generated by mathematical functions called Signed Distance Functions.
Short description how to create the SDF texture:
- Place the BP_SignedDistanceFiled on map.
- Setup parameters.
Source Texture The texture that will be used for generating the SDF. Search Width Width of search the distance in pixels. W*W is the number of iterations per pixel. Big numbers can crash the program. Texture Size Resolution of the texture.
- Click generate to update the render target.
- Click right on the RT_SceneCapture and select “create static texture” newly created texture is ready to use.
- Ue the texture as CracksSDFTexture parameter.