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 /
avatar image
0
Question by Curaus · Mar 08, 2020 at 03:11 AM · textureterraintexturesterraintextureterrain generation

TriPlanar Textures Not Working Properly

I recently implemented a Triplanar Shader to the terrain generator that I'm working on by following this tutorial: https://www.youtube.com/watch?v=XU0r-Xh-Jgc

The material with the shader attached to it seems to be working fine (as seen by the capsule in the image) but whenever I apply the material to my terrain it just maps some greenish color to the top and a grayish color to the sides. While this is the effect I was looking for I was wanting the actual textures to be mapped so I can see them rather than just a color. I don't know whether this is just because the texture is extremely stretched across a large part of the terrain or if the problem is elsewhere. Anyway, could somebody help me resolve this issue or at least point me to the source of the problem?

As a side note, I'm using 3D Perlin Noise with the Marching Cubes algorithm to generate the terrain if that helps at all.

Any help is appreciated so thank you very much in advance!alt text

capture.png (363.0 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
1
Best Answer

Answer by Namey5 · Mar 08, 2020 at 03:47 AM

At a glance, that doesn't look like triplanar texturing at all - it just looks like regular UV mapped texturing (see the stretching at the top of the capsule). This would also explain why you would get a single colour instead of the actual texture input on your model (the UVs would default to [0,0] and just return the top-left pixel of the texture). Instead of using UVs to sample the texture, use world-space position, matching the primary axis to the texture (i.e. surface facing up on the y-axis use the .xz components of the world position, etc).

Comment
Add comment · Show 5 · 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 Curaus · Mar 08, 2020 at 07:04 AM 0
Share

Okay so I followed your advice but now I have run into another issue. The textures are working properly and actually mapping but they are being mapped in an odd way. Ins$$anonymous$$d of mapping straight from the top (or the side) they are swirling and for$$anonymous$$g these circles on the ground. You can see it in the previews in the shader. Thank you for your help from before but can you still help me understand where I went wrong here?alt text

capture3.png (213.7 kB)
avatar image Namey5 Curaus · Mar 08, 2020 at 07:39 AM 0
Share

I'm a shader programmer (I've never used shader graph before), but below is an image of a basic graph that will work. Unfortunately, unity answers isn't cooperating today, so I'm unable to actually send any images or attachments directly. Ins$$anonymous$$d, here's a link to a lower resolution version on my website;

graph screenshot

I would also send a copy of the graph, but I can't. Let me know if it's not readable and I'll try and explain what each part does.

avatar image Curaus Namey5 · Mar 08, 2020 at 04:29 PM 0
Share

So turns out that the issue I was having with the textures looking "spherical" on the ground was a problem with the actual textures I was using and not the shader. I fixed my own shader to work with the absolute world position of the object but I have taken parts of yours because it is in fact better. $$anonymous$$ine was also less versatile as it technically was a "biplanar" shader so yours gives me more control. The graph is readable and just by working through it I was able to make sense of most of it. Thank you so much for all of your help, your answers were amazing and really helped out!

Also, the reason I wanted to work with a shader graph is because I had never made one so I figured this might be the best opportunity to try to do so.

Show more comments

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

172 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 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

Terrain look 1 Answer

how do I add texture to the terrain? 1 Answer

How to get cracked road textures?? 0 Answers

A question for someone who understands alphamaps. 0 Answers

How do I edit a terrain's texture in the new versions of Unity?,How do I add a texture to my terrain? 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