Hi, I created a lit shader graph with a simple UV scrolling function. The shader works fine in the scene view. But I found the texture doesn’t scroll in the game view in edit mode. It only works in play mode for game view. It seems the shader graph itself is correct. I am using unity2021.3.14 and HDRP. Is there any way to refresh shader UVs in game view without entering play mode? Thanks!
No. Time doesn’t advance in the game view unless you’re in play mode. This is working as intended.
Thank you very much! Yeah, it seems that’s the case in HDRP. I tested a UV scrolling shader in URP and found that it could update in game view.
And in HDRP, I created a shader as follows. _Time works again without play mode in game view. I am kind of confused.
Shader “Unlit/Test”
{
Properties
{
_MainTex (“Texture”, 2D) = “white” {}
_Factor(“Factor”,Vector) = (1,1,0,0)
}
SubShader
{
Tags { “RenderType”=“Opaque” }
LOD 100
Pass
{
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;
float4 _Factor;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv , _MainTex) + _Time.gg *_Factor.xy;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
return col;
}
ENDCG
}
}
}
The fact it works in the URP is a bug.
Got it. Thanks again;)!
Thank you very much!
This is working for me!

