Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
1
Question by element271 · Oct 17, 2015 at 05:11 AM · shaderstexturesoffset

Uniformly spreading a texture across multiple objects

Hello, what I am looking to accomplish is having one texture appear over the course of a number of objects uninterrupted. For example in the image below the hexagons are my tilled objects and for the sake of this question the orange shape is the texture I want to uniformly spread across the objects.

alt text

There are hundreds of these hexagons in my scene and they all need to remain separate yet appear as one. Having many material instances with different offsets leads to way to many materials in the scene so I was wondering if anyone had any other solutions?

ss-2015-10-17-at-024845.png (24.3 kB)
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 sandeepsmartest · Oct 17, 2015 at 05:21 AM 0
Share

Have you checked "Decals"??Decals may help you I guess. Check this and this link aswell. Nsks

2 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by tanoshimi · Oct 17, 2015 at 05:53 AM

3 options come to mind:

  • Use worldPos in your shader to apply the material in world position

  • Use screenPos in your shader to apply the material in screen space

  • Write a script to combine the UVs of your hex models and then apply material in (shared) model space

Which is best depends on how your game scene is setup. You can find details of 1 and 2 at http://docs.unity3d.com/Manual/SL-SurfaceShaders.html. For 3, look for the MeshCombine script in standard assets.

Comment
Add comment · Show 2 · 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 element271 · Oct 17, 2015 at 06:00 AM 0
Share

$$anonymous$$y hexagons need to work independently of each other and thus I think option one would work the best, thanks for the input, I'll play around with worldPos.

avatar image element271 · Oct 17, 2015 at 06:27 AM 2
Share

By updating my shaders to use worldPos I solved my problem, thanks for the help. For anyone else trying to do this and having some problems, here is a simple tutorial I found that helped me out. https://www.youtube.com/watch?v=s79Zu0F8fuY alt text

ss-2015-10-17-at-042037.png (303.3 kB)
avatar image
0

Answer by davitsedrakian · Apr 27, 2020 at 06:24 PM

Hello man, I just came to that problem that I need shader like that, can you share it with me? @element271

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

31 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

Related Questions

Uniformly spreading a texture across multiple objects using the Unity standard shader 0 Answers

Changing HDRP Material's Texture At Runtime Not Working? 2 Answers

Having texture problem in Safari iMac 0 Answers

shaders question (3DS Max involved) 0 Answers

Can anybody give me clues on masking a texture in a shader with an animated mask? 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