Is there a project setting that makes this button actually show animated materials animating? What is the name of this part of the GUI even?
My animated materials animate fine when I press that. Does this material animate if you put it on an object and drop it into the scene view? (Assuming you’ve turned on Animated Materials in the Scene view…)
Animated materials in scene view do draw correctly (as long as I have them turned on like you mentioned).
How did you make the shader? Hand-written Cg/HLSL, or Shader Graph? What are you specifically using to animate this over time? _Time.y, the Shader Graph Time node? Care to share that specific code, so I can see if it animates for me as well?
It’s handwritten, time is modded by 1000 here so that it repeats every 1000 seconds and avoids some float precision problems that can pop up.
Well, it works fine for me. I just created a standard unlit shader, and modified the UV to add _Time.y to it, and it animates fine both in the scene view and in the material preview inspector.
Maybe try this in a brand new project, just creating this shader, assigning a material and texture to it, and see if the material animates?
Shader "Unlit/DeleteMe2"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType" = "Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv + float2(_Time.y, _Time.y), _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag(v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}
I have the same situation,it works fine in upr project but not in 2d/3d project.Also,it worked fine in unity 2018.This occurs when I update my unity version to 2019.Hope to get solution too.