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
3
Question by Redlazer · Mar 18, 2012 at 10:17 PM · pixelgetpixelcoordinate

Add "burn marks" on hit directly to a texture using pixel coordinates

Hey guys,

I'm working on a school project, and I'm having some trouble getting some of the final touches done.

We were using textured planes to apply bullet and burn marks to things, but frankly it just doesn't look very good, and get's expensive pretty quickly.

I've read as much as I can about getting a UV coordinate from a raycast, but I haven't found any examples in C#, so I'm not quite sure how to proceed. Can anyone point me in the right direction or provide any tips?

I found this example, and although I can read JS pretty well, I'm not entirely certain what's going on: http://unity3d.com/support/documentation/ScriptReference/RaycastHit-textureCoord.html

For one thing, that'll paint individual pixels, and I want to load a bullet texture in. How do I do that? What should it (the texture) look like - will it be full colour? What about transparency?

Any help would be appreciated!

Thanks,

Fred

Comment
Add comment · Show 12
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 Dakwamine · Mar 19, 2012 at 02:34 AM 0
Share

it just doesn't look very good, and get's expensive pretty quickly

Can we have a screenshot to know exactly which effect you do not want to get ?

avatar image Eric5h5 · Mar 19, 2012 at 03:08 AM 0
Share

Using geometry to apply decals is standard. (Naturally you don't want a separate gameobject for each one, ins$$anonymous$$d you use the $$anonymous$$esh class.) Trying to write directly to the textures won't work except for very small areas, because the entire area must be uniquely textured, which means 1) no tiling, therefore 2) large memory usage, especially since 3) no compressed textures and 4) they have to be set to read/write enabled, which means using both RA$$anonymous$$ and VRA$$anonymous$$. Plus uploading the changed textures is relatively slow.

avatar image Redlazer · Mar 19, 2012 at 03:10 AM 0
Share

Well, they can hang off the corners of objects for one thing. There's also sometimes a z-fighting issue, but I realize the position just needs to be played with.

It's also a whole plane laid on top of another object - a whole other gameobject, renderer, and transform.

Why doesn't anyone seem to know about the SetPixel? Am I crazy in trying to use it?

avatar image Eric5h5 · Mar 19, 2012 at 03:14 AM 0
Share

As I said, you don't use separate gameobjects. And yes, you're crazy trying to use SetPixel for this. ;)

avatar image Redlazer · Mar 19, 2012 at 03:14 AM 0
Share

Our game currently uses no tiling, and all of the characters use mesh colliders. The requirements of SetPixel are not an issue. It even suggests in the Unity Docs to consider using it for bullet marks and whatnot.

As far as I'm aware, the texture changes are made directly in memory, which is a reasonably faster operation.

I am also not familiar with what you mean by "ins$$anonymous$$d you use the mesh class", could you explain that? $$anonymous$$aybe that's my problem - because using planes looks terrible!

Show more comments

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I select a sprite's pixel by mouse click? 1 Answer

getPixel co-ordinates not screen co-ordinates based on mouse position 2 Answers

How to pixelate an image texture for faster pixel color recognition? 2 Answers

Getting pixel color on ray hit 2 Answers

Can I get perfect 2d tile alignment using grid snap AND vertex snap on 1x1x1 unit cubes?? 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