【发布时间】:2016-07-23 12:43:32
【问题描述】:
我正在 Unity game engine 中创建 iOS 应用。
我正在尝试重写我的 着色器,以便使用它的 材质 给 >绽放(发光)效果(像Halo component)。
一个示例它的外观:
我确实在互联网上搜索了答案,但没有找到任何适合工人或适合我的问题的解决方案。
我的着色器的代码:
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
}
}
}
}
【问题讨论】:
-
Emission,因此绽放量来自最终像素颜色值的值,该值通常应在 HDR 范围内。尝试添加发射属性,例如_Emission("发射强度", Range(0.01,3.0)) = 1.0。然后将你的输出乘以这个属性。
-
你能告诉我应该如何在我添加到问题的着色器女巫中完成吗?
-
不幸的是,我认为事情没有那么简单。您当前正在使用着色器程序。要操纵发射,您需要将着色器重新编写为表面着色器,而不是使用程序。请参阅手册docs.unity3d.com/Manual/SL-SurfaceShaderExamples.html 中的此处并查找“排放”有很多示例。那就是说我对它还很陌生,并且会欢迎其他 cmets。
-
你在使用Bloom Effect脚本吗?
-
我需要添加到我的着色器(有问题)绽放效果(如屏幕截图)。
标签: ios unity3d opengl-es shader unity5