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
1
Question by HansK · Aug 28, 2012 at 10:24 AM · terraindepthbuffer

ignore depth buffer for terrain

Hello. Is it possible to make one material render always over terrain (but below detail meshes and grass!). I want to achieve a situation where that green grid would never be cut away by terrain mesh, but still render below terrain grass, detail meshes and other objects. So it has to do something with depth buffer? Like set the grid material to ignore terrain textures' depth? but how..?

Thanks in advance!

alt text

bufferquestion.jpg (105.5 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
Best Answer

Answer by ScroodgeM · Aug 28, 2012 at 09:14 PM

solution 1

use projector for terrain-only layer

solution 2

paint grid on terrain as any other texture. this can be done also procedurally by scripting

solution 3

reproduce geometry of terrain to plain with grid

solution 4

improve shaders to draw grid between terrain and terrain details with ignoring z-buffer

Comment
Add comment · Show 9 · 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 jc_lvngstn · Aug 29, 2012 at 05:39 PM 0
Share

For #1...wouldn't the projector also project on any trees and details?

With #3, you would just create a mesh with the grid texture, modify the vertices to match the contour of the terrain, and place it just a little above it.

avatar image HansK · Aug 29, 2012 at 08:11 PM 0
Share

Thank you for the answers! solution 1 is quite good.. unfortunately the projector material doesn't work exactly as needed.. and jc_, no it won'd project on trees and other stuff. Solution 2 isn't that good in current scenario. About s.4 - unfortunately I nor somebody else form our $$anonymous$$m hasn't got enough shader scripting skills to change those shaders to achieve the z-buffer ignoring effect. So unless some nice guy wants to do that job (change shaders) for us, or at least give some clues how to do that, I'll stay with the easiest solution (which is 3). Actually I will just flatten the terrain in that area so it won't go above that grid plane.

avatar image ScroodgeM · Aug 29, 2012 at 08:36 PM 0
Share

@jc-lvngstn, for (1) needed to make separated layer for terrain and terrain details (trees and others).

@hansk, please explain doesn't work exactly as needed

avatar image HansK · Aug 30, 2012 at 11:33 AM 0
Share

projector has 2 possible shader options - additive or multiply. I just need a material with alpha channel, but when I set the projector material to be transparent/diffuse or whatever, it just fills the whole terrain with that texture, not the projector area

avatar image ScroodgeM · Aug 30, 2012 at 08:43 PM 0
Share

set texture as Clamp ins$$anonymous$$d of Repeat in texture import settings

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

9 People are following this question.

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

Related Questions

Retrieving depth buffer of a frame 2 Answers

Make a simple tree 1 Answer

I want to use depth value which is send by kinect 0 Answers

Multiple Terrain objects good practice? 1 Answer

Vuforia: How to hide terrain behind box-target? 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