小编ART*_*AGE的帖子

为着色器添加bloom(glow)效果(Unity游戏引擎)

我在Unity游戏引擎中创建iOS应用程序.

我正在尝试重写我的着色器,以便使用它的材料赋予Bloom(Glow)效果(如Halo组件).

它应该如何显示的一个例子:

绽放(辉光)效果

在此输入图像描述

我真的在互联网上搜索答案,但没有为工人找到任何东西或找到适合我问题的解决方案.

我的着色器代码:

Shader "Unlit"
{ 
    Properties
    {
        _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
        _Color("Main Color", Color) = (1, 1, 1, 1) 
    }
    SubShader
    {
        Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
        LOD 100 
        Cull off
        ZWrite on 
        Blend SrcAlpha OneMinusSrcAlpha
        Pass 
        { 
            Lighting Off
            SetTexture[_MainTex]
            {
                constantColor[_Color]
                Combine texture * constant, texture * constant 
            } …
Run Code Online (Sandbox Code Playgroud)

shader opengl-es unity-game-engine ios unity5

5
推荐指数
1
解决办法
2万
查看次数

在 if 语句中声明变量 (ANSI C)

有没有办法在if 语句中声明变量(仅使用ANSI C)?

例子:

if(int variable = some_function())
{
    return 1;
}
Run Code Online (Sandbox Code Playgroud)

c variables if-statement ansi declare

3
推荐指数
1
解决办法
6276
查看次数