- Home /
Weird outline around nearby HDR objects
In a game I am working on, I am experimenting with HDR. I am using the standard Bloom image effect with HDR enabled on the camera, and using my own shader to write RGB values greater than 1. The issue is that when objects that use HDR are very close to the camera, a green outline appears around them. Here is an example of it working correctly (no objects near camera):
And here is the bad one, with the camera very close to the beams:
As you can see, a green outline appears around the beams in the second image. The bloom script is using all the default values, although I have tried changing them around (to no avail). The only way I can make the outlines go away is to disable HDR on the camera or disable the bloom script.
Here is my shader code:
Shader "Custom/ParticleBeam" {
Properties {
_OutColor ("Outer Color", Color) = (1,0,0,1)
_InColor ("Inner Color", Color) = (1,0.5,0,1)
}
SubShader {
Tags {
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
fixed4 _OutColor;
fixed4 _InColor;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
v2f vert (appdata_base v) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv = v.texcoord;
return o;
}
fixed4 frag (v2f i) : SV_Target {
float y = i.uv.y;
float d = abs(y - 0.5) * 2;
d += abs(sin(_Time * 360) * 0.2);
fixed4 c = d * _OutColor + (1.0 - d) * _InColor;
c.a = 1.0f - d;
return c * 5;
}
ENDCG
}
}
FallBack "Diffuse"
}
Your answer
Follow this Question
Related Questions
Black blobs after turning on HDR for Android 1 Answer
Can't change Post processing value from script with HDRP keep getting a TrygetSettings error 0 Answers
GLSL - Post processing? 0 Answers
In FastBloom(Bloom Optimized) shader, what's the difference between Standard and Sgx blur type? 0 Answers
Is it possible to use Image Synthesis in an HDRP project? 0 Answers