Camera Clearing with simple linear Gradient with HDRP?
I'm trying the HDRP for the first time and love the results, but I'm struggling with the new approach to skyboxes. At some point in my Game I need the a second camera to clear with a simple vertical linear gradient (color1 to color2).
Skyboxes seem to be global now, OK... I understand that I can smoothly blend between settings/skyboxes using the volume system. However I'm a mere beginner in shader programming. How can I get the simple gradient shader I was using before to fit as a skybox into the HDRP system?
Properties {
_TopColor ("Top color", Color) = (1,1,1,1)
_BottomColor ("Bottom color", Color) = (1,1,1,1)
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
fixed4 _TopColor;
fixed4 _BottomColor;
struct v2f {
float4 position : SV_POSITION;
fixed4 color : COLOR;
};
v2f vert (appdata_full v)
{
v2f o;
o.position = UnityObjectToClipPos (v.vertex);
o.color = lerp(_TopColor,_BottomColor, v.texcoord.y );
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float4 color = i.color;
color.a = 1;
return color;
}
ENDCG
}
}
Any hint appreciated, thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612183915im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Equivalent of blender holdout shader? 0 Answers
Camera FX to fade out back to normal 0 Answers
how can i reproduce the 'Unity_Matrix_VP' value? 0 Answers
How to set a render-to-texture camera to be a VR camera 0 Answers
Materia Drag & Drop Bug 0 Answers