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 Danirey · May 06, 2015 at 12:45 PM · shaderskinnedmeshrendererdecal

Shader to paint at coords?

Hi, Is it possible to write a shader to create wound marks on a character at a certain position. Like the bullet decals but through a shader. In the forums someone suggested that, so i'm looking for an efficient way to paint wounds over skinned meshes. I've tried a couple of ways but not efficient at all. Decals are a bad idea over a character. Baking meshes are quite slow. I don't have a clue about shaders, so anyone can iluminate this a bit?

Thanks guys!

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
2

Answer by komodor · May 06, 2015 at 12:57 PM

generally it's possible

theoretically (i can't prepare the shader right now):

along with the properties you already have on your shader you'll need properties for wound textures of the wounds and properties for the actual wound positions

you have to Raycast the position where wound will be and RaycastHit.textureCoord (or other RaycastHit.textureCoordN) will tell you UV coordinates on the texture and you can send them to the shader and use it to place the wound

Comment
Add comment · Show 3 · 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 Danirey · May 06, 2015 at 01:12 PM 0
Share

Great! Thanks komodor.

I will not ask for a shader example, but for someone with no experience at all with shaders, do you think this is a too much advanced job? Or with some advices it could be done? I want the best performance solution, but only if I can get it working in a near future... ;)

I'm thinking in just paint blood by zones, limiting the wound positions to head, torso, and one for each arm and leg. $$anonymous$$aybe 6 predefined areas with a blood wound texture.

Some time ago I tried modifying a shader I found in the web to do almost the same thing, but there was a limit with the detail textures you can use. And with the new standard shader I don't know how to solve that. Any idea/advice?

Thanks

avatar image komodor · May 06, 2015 at 01:16 PM 0
Share

it's very simple - i am shader noob so i use shaderforge and i can write just the code i can't make by dragging nodes

edit: actually not so simple you need to learn lot's of things however with shaderforge i was able to understand the stuff needed for this ... in our 2d game we are using similar technique to make something like bumpmap without normals

avatar image Danirey · May 07, 2015 at 06:47 AM 0
Share

Hey,

I know about shaderforge, but unfortunately i don't have that money to spend now. I'll have to keep loocking for a way to get this...

Thanks!

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

2 People are following this question.

avatar image avatar image

Related Questions

Add decal parameter to shader 1 Answer

Detail to Decal Unity 5.x Standard Shader 0 Answers

Fading off texture and multiple instances 0 Answers

Applying decals / textures to uneven surfaces runtime 1 Answer

a shader or decal that only renders the normal map 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