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 Gamershaze · Jan 07, 2014 at 11:37 PM · proceduralpainting

Procedural Surface Painting

Procedural Surface Painting~ You can most easily picture this by imagining a paintball gun. Shoot at a wall, it leaves a paint splatter against the wall. Shoot it at the floor, leaves one at the floor. Shoot it at an object- it splatters across the object, around the corners and etc.

Anyone know how to achieve this? I know I'm not the only one that has/will want to achieve something like this, rather for blood splatters or actual paintball simulators~ whichever.

After a lot of researching I have found two things however. One, an asset on the store called 'TexturePaint'. I purchased it and gave it a look, but it is fairly glitchy and does not purpose the usefulness of something like this out of the box. It'd be much easier and less buggy to simply start from scratch.

I also found a guide here, by Morgan Davidson on exactly how to do this. It was posted about two years ago, with no follow-up. You can see exactly what is meant to be achieved by the demo project attached. As said however, unless he posted the full guide somewhere else I couldn't find; the actual implementation of this is lost. I've even tried contacting him, it's been about three weeks now with no response- So I come to Unity Answers.

Any sources/ideas?

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 iwaldrop · Jan 08, 2014 at 04:35 AM 0
Share

Better than procedurally 'painting' would be to apply decals. You'd have prefabs that have a texture applied to a plane of what you want to 'paint' that would be instantiated and applied to the point on which the impact occurred. That would be this simplest approach, but wouldn't handle corners very well, for instance.

Another approach is to take the same texture, without creating a prefab or applying it to a plane, and actually modifying the pixels of the texture at runtime. This is very expensive and should only be contemplated on a pc or console (or, in other words, not mobile). The reason it is expensive is two fold. A, you'd need your textures to be read-write enabled, so they'd require at least twice the memory footprint that the texture would actually need (one original, and reserved memory for instancing it, then instances of it). B, you'd need to actually do the setting of pixel colors based on the texel coordinates, which takes time.

Long and short of it is that you'd probably want to go with the first approach, but possibly add in some geometry clipping so as to remove parts of the prefabbed plane that would just be sticking out into the world. However it would be super fast to implement placement of those decals without any fanciness to deal with corners. Depending on the size of your 'splat', you might actually be able to get away with not doing any geometry manipulation.

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

21 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

Related Questions

Why is my mesh getting messed up 1 Answer

Procedural Skyboxes Based on Scene Data 1 Answer

Creating caves in voxel procedural mesh 0 Answers

Material(string) is obsolete. How else can a shader be loaded at runtime? 2 Answers

Triangulation for my procedural 2D Polygon Collider is different than that of my Mesh, does anyone know why? 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