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 Quelfth · Oct 15, 2020 at 02:42 AM · renderingpost processing

Best implementation for spraying water on a surface like in Super Mario Sunshine.

To be clear, I'm not talking about the goop from Mario Sunshine. I'm referring to the fact that when you spray water, it creates puddles on the ground and walls which Mario can slide around in. I currently have an implementation of this which uses a texture to store which pixels on the surface are wet and which are dry. Then a compute shader runs every frame to set any wet pixels which neighbor dry pixels to be dry. While this does work, it needs to be segmented into chunks in order to not hinder performance, and I'm not sure quite how I would add the water to a spot where there is a border between chunks. All the water would go on the chunk where the center of the puddle was. I would need to do some kind of sphere-cast to find all the chunks within range of the puddle, then find a pixel that was on the chunk and the right distance away.

So, I was re thinking it, and I believe the implementation Mario Sunshine uses creates a bunch of spheres that represent wet places. I had thought of this implementation earlier, but had thought that it would look bad unless I used odd capsules, but I'm now thinking spheres would be fine. I can see exactly how to implement this in terms of making the surface slippery to my character, but I'm not quite sure how to render it. I think I would need to generate some kind of screen texture representing all pixels where the exterior of a wetness sphere is visible, and one representing all pixels where the interior of a wetness sphere is visible (or maybe they could be different channels of the same texture). Then I could apply a wet-looking post-processing effect to all pixels for which the exterior of a wetness sphere is visible but not the interior (representing that the pixel that the camera sees is inside a wetness sphere). The issue I believe that I would run into is that if there are multiple spheres overlapping, the camera might see the interior of a wetness sphere that is inside another one. Thus, only the closest wetness sphere would work for a given pixel. This makes me think I would need to count the number of wetness spheres I had entered, and then the number I had exited, so as to know if I was really in one or not. Then I foresee the problem of what would happen if my camera is in a wetness sphere. I would need to know how many I was in at a given time, since the camera wouldn't see the exterior a wetness sphere that it was inside of.

I'm open to other possible implementations, or ideas on how to apply a post-processing shader to pixels only within some bounds.

As of now, I'm thinking the second implementation will be easier to implement and more scalable, but I'm still not quite sure how to do the graphical part of it.

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

0 Replies

· Add your reply
  • Sort: 

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

159 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

Related Questions

Post Processing Layer Turns Scene and Game Black 0 Answers

URP Custom volume overrides 0 Answers

Multiple post processing profiles? 2 Answers

How to get quality Depth Of Field effect with Post Processing Stack V2? 1 Answer

How to disable post-processing in the editor view? 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