Simple Parallax Material Scrolling
How to use:
Convert the material with texture albedo to a shader, then copy and paste the code below and add to the code you just created.
Shader code
uniform vec2 scroll_speed = vec2(0.2, 0.0); // Default scroll to the **left** at 0.5 units/sec
void vertex() {
// Apply initial UV scaling and offset
vec2 scaled_uv = UV * uv1_scale.xy + uv1_offset.xy;
// **Apply scrolling based on TIME and scroll_speed**
scaled_uv += scroll_speed * TIME;
// Assign the modified UV to be used in fragment shader
UV = scaled_uv;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo, base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel);
METALLIC = metallic_tex * metallic;
SPECULAR = specular;
vec4 roughness_texture_channel = vec4(1.0, 0.0, 0.0, 0.0);
float roughness_tex = dot(texture(texture_roughness, base_uv), roughness_texture_channel);
ROUGHNESS = roughness_tex * roughness;
// Emission: Enabled
vec3 emission_tex = texture(texture_emission, base_uv).rgb;
// Emission Operator: Add
EMISSION = (emission.rgb + emission_tex) * emission_energy;
ALPHA *= albedo.a * albedo_tex.a;
}
Pretty sure this is broken or missing something? Pasting just this into the shader field results in error. And the description makes it seem like theres a part 1 we are missing