This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Mesh Unlit

Implements the basic render functionality for an unlit mesh. Doesn’t cast or receive shadows, that’s why it can be the base for a custom lighting implementation (e.g., raymarching). Can be used for the following objects (inherited from parent abstract material — Mesh):

Notice
Mesh Unlit has the same states and shaders available as the parent Mesh abstract material.

You can find the source code for this abstract material here: <SDK>/data/core/materials/abstract/mesh/mesh_unlit.abstmat

Features#

The Mesh Unlit abstract material has features implemented as internal states that can be enabled on demand in the child material:

States#

Mesh Unlit contains the same states as parent abstract Mesh material but adds new or modified values of some of the existing ones.

Name Default Description
static_shadow true Overrides Unigine::Mesh’s state value.
gbuffer false Enables writing of deferred buffers for the material.
transparent_blur false Enables rendering of transparent blur effect.
refraction false Enables rendering of post-processing refraction.

Shaders#

fragment#

Input data and functions are the same as for Mesh abstract material. The Unlit material implements its “unlit” functionality by using the emission buffer as an output for the resulting color and skipping deferred pipeline.

Output Data#

Name Type Description
OUT_FRAG_COLOR float4 Final fragment color as emission

Usage Example#

ULON
BaseMaterial <parent=Unigine::mesh_unlit>
{
    Texture2D albedo = "core/textures/common/checker_d.dds"
    Color albedo = [1 1 1 1]
    
    // optimization
    State static_shadow = true
    State vertex_velocity = false
    
    Shader vertex_struct =
    #{
        INIT_BASE_DATA
    #}
    
    Shader common =
    #{
        float4 sample_color(float2 uv)
        {
            return TEXTURE(tex_albedo, uv) * var_albedo;
        }
    #}
    
    Shader fragment =
    #{
        float4 color = srgbInv(sample_color(DATA_UV.xy));
        
        OUT_FRAG_EMISSION = color.rgb;
        OUT_FRAG_OPACITY = color.a;
    #}
}
Last update: 2022-03-10
Build: ()