- Home /
How to write an additive HDRP shader without glow
Hi. I apologise in advance if this is a stupid question but I want to write a regular additive shader. I am using Blend One One
in Pass and without skybox and post processing, this works. However, when I turn these features on, the shader seems to fall into a loop of adding itself to a ghost of itself. Its brightness simply continues to increase, creating an intense glow. How do I avoid this? Is there a trick?
Here is the full test shader:
Shader "Unlit/Glowtest"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Transparent" }
LOD 100
Pass
{
Blend One One
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
return float4(0.5,0.5,0.5,0.5);
}
ENDCG
}
}
}
Your answer
Follow this Question
Related Questions
Scene Color Node in Shader Graph not working with Unity's 2D Renderer and URP 5 Answers
Distortion Shader does not render transparent objects (Shader Graph) 2 Answers
Converting c# function to shader. 0 Answers
Making shader not ignore Light on transparent areas ? 0 Answers
URP Blit Render Feature not rendering in Single Pass Instanced VR 0 Answers