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
6
Question by Albert · Dec 21, 2010 at 08:10 AM · watercullingship

How would you cull a water intersecting a ship when viewing inside?

I don't really know how to explain it, im going to post a pic for illustration. If im going to use a plane, the water then would go through the ship's inside. How would I hide it? alt text

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

2 Replies

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

Answer by ina · Dec 21, 2010 at 09:19 AM

Try using a DepthMask shader.

Comment
Add comment · Show 4 · 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 Statement · Dec 21, 2010 at 09:25 AM 0
Share

$$anonymous$$nowledge is king, and you has it. :)

avatar image ina · Dec 21, 2010 at 09:29 AM 0
Share

even more misc. knowledge: learned about depthmasks in http://bit.ly/arsdklecture where they created the Penelope canyons on a table AR ImageTarget printout! ;)

avatar image Statement · Dec 21, 2010 at 09:37 AM 0
Share

I'll have to check that out once I get a little bit more free time on my hands. :) Working day has begun.

avatar image Albert · Dec 21, 2010 at 09:48 AM 0
Share

Im not able to access my project right now but just apply the shader on the water? and that's it? :)

avatar image
2

Answer by Statement · Dec 21, 2010 at 09:21 AM

At first glance it looks like an easy problem, but it becomes harder once you start to appreciate it. I guess I have come up with three approaches that doesn't involve changing the mesh runtime.

  1. You could draw the water first and then clear Z buffer before rendering the ship. This won't look good if you're viewing the ship from outside. Maybe you could switch to clearing Z buffer only if you're looking from the interior of the ship to reduce this effect.

  2. You could perhaps draw the interior of the ship first using scissoring (if that is available in Unity, I don't know) to clip the sea rendering. Finally you could apply the boat. In fact I see now at my final touches to my answer that ina already posted a DepthMask shader that seems to achieve this.

  3. You could use render to texture to render the inside of the ship through a portal. This is probably somewhat more complex and I am not entirely sure how to go about it best. Basically you'd have the inside of the ship modeled somewhere else and have another camera mimic the main camera to render the insides and apply the resulting texture to the boats main surface plane. Think of it like a mirror, but not really a mirror. More of a portal.

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

No one has followed this question yet.

Related Questions

Hide water 1 Answer

Reduce FPS Overhead using Unity3D Pro Daylight Water 1 Answer

ship trail on water 1 Answer

Can't stand on the boat(but it already have collider) 1 Answer

How do i make floating ship ? 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