我在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) 有没有办法在if 语句中声明变量(仅使用ANSI C)?
例子:
if(int variable = some_function())
{
return 1;
}
Run Code Online (Sandbox Code Playgroud)