Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by supereq · Apr 09, 2017 at 02:09 AM · texturematerialssubstance

Blend materials/substances?

I have some big areas so when I apply a substance it has a obvious repeating pattern.

I would like to merge two substances using a mask that I can tile and rotate independently to add some variation in a similar way the Terrain Toolkit does. Is there a simple way to do this? A special shader maybe? Any push to the right direction?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image toddisarockstar · Apr 09, 2017 at 11:36 PM 0
Share

you have to write or find a custom shader script. I wrote one for my game cause i couldn't find one.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by toddisarockstar · Apr 09, 2017 at 11:42 PM

Actually here is what i wrote for my game. it blends three textures on a surface. you have to make a map texture in paint. Use black red and blue color on the map to assign where the textures go. hopefully it helps

 Shader "todds/3Textures" {
     Properties {
        // _Color ("Overall Color", Color) = (1,0.5,0.5,1)
         _t1 ("texture in white", 2D) = "white" {}
         _tint1 ("Tint1", Color) = (1.0, 0.6, 0.6, 1.0)
         
         _t2 ("texture in red", 2D) = "white" {}
         _tint2 ("Tint2", Color) = (1.0, 0.6, 0.6, 1.0)
         _rc ("low cutoff", Range(1,80)) = 0.0 
         _t3 ("texture in blue", 2D) = "white" {}
         _tint3 ("Tint3", Color) = (1.0, 0.6, 0.6, 1.0)
         _rb ("low cutoff", Range(1,80)) = 0.0 
         _t4 ("texture map", 2D) = "white" {}
         
         
     }
     SubShader {
         //Tags { "RenderType"="Opaque" }
         LOD 200
         
         CGPROGRAM
         #pragma surface surf Lambert
         float _rc;
         float _rb;
         sampler2D _t1;
         sampler2D _t2;
         sampler2D _t3;
         sampler2D _t4;
         
         fixed4 _tint1;
         fixed4 _tint2;
         fixed4 _tint3;
         
         struct Input {
             
             float2 uv_t1;
             float2 uv_t2;
             float2 uv_t3;
             float2 uv_t4;
             
         };
       
 
         void surf (Input IN, inout SurfaceOutput o) {
             
             float f;
             
             half4 pix = tex2D (_t1, IN.uv_t1)*_tint1;
             half4 map = tex2D (_t4, IN.uv_t4);
             f=map.r;
             
             f=f*_rc;
             if(f>1){f=1;}
             f=1-f;
             pix=pix*f;
             f=1-f;
             pix=pix+tex2D (_t2, IN.uv_t2)*f*_tint2;
             
             f=map.b;
             f=f*_rb;
             if(f>1){f=1;}
             f=1-f;
             pix=pix*f;
             f=1-f;
             pix=pix+tex2D (_t3, IN.uv_t3)*f*_tint3;
             
             o.Albedo = pix.rgb;
             
         }
         ENDCG
     } 
     FallBack "Diffuse"
 }
 

 
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

112 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Imported material with texture transparency 0 Answers

Applying PNG as material goes partly wrong 0 Answers

What right way to SetTextureOffset of material which has dynamic count owners? 0 Answers

Looking for help with creating a gold texture/reflection for mobile games 0 Answers

Textures, Materials, Meshs and Maps? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges