Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by multinfs · May 31, 2015 at 03:38 PM · textureterrainmeshblend

How do I blend multiple textures on a mesh?

I have made a custom terrain that simply creates a plane mesh with it's vertices set according to a heightmap(not in shader!). The reason I do not use the built in Terrain objects is that this approach is faster in my case even though texture blending might be easier on the terrain objects.

Now I want to blend multiple textures according to a reference map, it can be a texture used as an alphamap or any other possible approach that you know of. Note that I would like both diffuse and normalmaps to be applied to the mesh.

I did read up a little on splatmaps but I'm not sure if I can use them on anything other than terrain objects or even how to use them. Are they a possible solution?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Owen-Reynolds · May 31, 2015 at 05:56 PM

A shader can be written to blend multiple textures. The built-in unity terrain shader does this - it reads four textures, and blends them based on the fifth "splat map" texture (which is often called a control texture.) That's partly why Terrain is special - so the system knows to use this shader, with textures loaded in groups of 4 on multiple passes.

You can get the terrain shader and read the code, or just read up on shaders and control textures in general. The basic idea is colFinal=col1*splatCol.r + col2*splatCol.g ... (where splatCol RGBA adds up to 100%.)

I haven't seen the new U5 universal shader, so it may have some shortcuts to do this (or not.)

Comment
Add comment · Show 1 · 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
avatar image multinfs · May 31, 2015 at 07:01 PM 0
Share

I know this can be done easily with shaders though I'm a bit intimidated by the shader code used in unitys standard shader, because I want the shader to work and be as efficient as possible.

I was hoping the standard shader would do this automatically with no shader coding necessary though it doesn't seem like that.

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

20 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

Related Questions

How to rotate only the mesh and not texture/material in Unity 1 Answer

Splatmapping / blending between two textures in an atlas? 0 Answers

How can I blend a lot of textures on one mesh ? 5 Answers

Paint textures like on terrain but without terrain? 0 Answers

Generate collision mesh from 2d texture? 0 Answers


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