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 dotSnipe · Sep 08, 2014 at 08:19 PM · textureterrain

Apply Texture to Custom Mesh (Terrain)

Hello All,

I have an issue I am trying to figure out how to approach best.

Situation (with Images):

I have a flat Mesh (plane) with 100 Quads (10x10). I have a script that raises a Quad and creates the quads that make the walls of this newly raised Quad. Now I have a pillar like thing on my terrain. The top side is always a grass texture, while the walls should be dirt or rock textures. This all seems to work for now (with small glitches :) ), but I would like this Mesh to look more realistic.

I create my mesh by generating it procedurally and creating the triangles & quads and applying texture to them using the uv coordinates. My actual texture file is a 64x64 image. It has 4 tiles (32x32 each). One grass, one dirt, one rock & one snow.

Problem:

How do I make the texture from the top Quad (grass) spill over to the walls a little bit ?

Currently is like this :

alt text

Would like it like this :

alt text

Side Note : In the above I drew a black line on the edge to demonstrate the idea, but ideally the edges of the cubes would not be so visible in order to make the terrain more life like. It would be perfect if i could make it look more rounded around the edges ( from my research I suppose I can do that with Normal Maps. )

Back to the texture spilling over : I tried searching for other approaches all together, but did not find them or could not wrap my mind around them.

Question:

  1. How can I achieve the desired effect described above, or

  2. Considering what I am trying to do, what other approaches are there for creating a more realistic textured terrain.

I am assuming that a programatic solution would be best because the tile types might increase, so creating textures for all possible combinations and applying them would be a bit too much (ex. rock with spilled over snow or grass, sand with spilled over grass, snow or dirt and so on.

I hope I explained the situation clear. Please help. Any input is highly appreciated.

rightnow.png (280.5 kB)
wouldlike.png (263.4 kB)
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
0

Answer by khenkel · Sep 08, 2014 at 08:42 PM

This is quite hard to achieve from scratch imo and unfortunately I can't provide a perfect solution. But I can give you some ideas about this:

  • This programmatic blending requires a custom shader. I don't know about your skills in shading language, but this would be something like multiplying two textures depending on the Y coordinate. Also I am not sure how this would work combined with your procedural mesh generation.

  • The rounded edges you want are almost impossible to achieve with a blocky mesh like this. (at least as far as I know) This would only work with 1. no light (therefore no shadows) and 2. from only one special point of view (or MAYBE with Parallax occlusion mapping ...). As soon as you changed the point of view, you would see the edges.

The fastest, easiest and best looking solution here most likely is to create different textures for all those combinations. Minecraft did the same. ;)

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 dotSnipe · Sep 08, 2014 at 08:48 PM 0
Share

Hey khenkel,

Thank you for the reply. As I mentioned, I am still researching for the best approach. Really appreciate the input.

Hopefully will get a few more ideas thrown at this post soon :)

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

23 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

Related Questions

How do I go about texturing a flat-shaded generated mesh? 1 Answer

Question about a good textures / terrain shader 1 Answer

Paint Grid Texture 1 Answer

Copying sections of terrain textures 0 Answers

Terrain - m_PreloadTextureAtlasData.size () == m_DetailPrototypes.size () 2 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