0
\$\begingroup\$

I can lerp between colors just fine, but lerping between textures just doesn't seem to work. What am I doing wrong?

Here's my code:

 Shader "Custom/Terrain1"
    {
        Properties
        {
            _RockInnerShallow ("Rock Inner Shallow", 2D) = "white" {}
            _RockInnerDeep ("Rock Inner Deep", 2D) = "white" {}
            _RockLight ("Rock Light", Color) = (1,1,1,1)
            _RockDark ("Rock Dark", Color) = (1,1,1,1)
            _GrassLight ("Grass Light", 2D) = "white" {}
            _GrassDark ("Grass Dark", 2D) = "white" {}
    

        _Color ("Color", Color) = (1,1,1,1)
        _Blend ("Texture Blend", Range(0,1)) = 0.0
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _Glossiness ("Smoothness", Range(0,1)) = 0.5
        _Test ("Test", Float) = 0.0

        _NoiseTex("Noise Texture", 2D) = "White" {}
    }


 void surf (Input IN, inout SurfaceOutputStandard o)
    {
fixed4 c  = lerp(tex2D (_RockInnerShallow, IN.uv_RockInnerShallow),
                 tex2D (_RockInnerDeep, IN.uv_RockInnerDeep), rockDepthT) * _Color;

   o.Albedo = c.rgb;
   o.Alpha = c.a;

This last bit is the lerping part.

\$\endgroup\$
2
  • \$\begingroup\$ This looks very similar to your previous question — did you mean to edit and clarify the existing question, instead of posting a new one? Note that making substantial constructive edits bumps the question up in the feed, so it gains visibility just like a new question, just without leaving dead ends as land mines for future searchers. \$\endgroup\$
    – DMGregory
    Jul 28 at 17:04
  • \$\begingroup\$ Can you clarify what output this shader produces, and how that differs from what you want? \$\endgroup\$
    – DMGregory
    Aug 10 at 4:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.