This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

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

See Also

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: 2024-08-16
Build: ()