Quantcast
Channel: Questions in topic: "shader programming"
Viewing all articles
Browse latest Browse all 169

How to write an additive HDRP shader without glow

$
0
0
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 } } }

Viewing all articles
Browse latest Browse all 169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>