Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Damage Should Create Paint Scratches #9

Open
JustInvoke opened this issue Jan 7, 2017 · 0 comments
Open

Damage Should Create Paint Scratches #9

JustInvoke opened this issue Jan 7, 2017 · 0 comments

Comments

@JustInvoke
Copy link
Owner

JustInvoke commented Jan 7, 2017

The VehicleDamage script only takes care of deforming meshes and detaching parts of vehicles. It should scratch the paint too. I haven't been able to think of a good way to go about this, beyond perhaps using a method similar to the way tire marks are created.

The scratch generations must be handled with care as to not lead to excessive garbage collection.


Another idea I got from a comment on a YouTube on a video about car damage in Unity is to use the vertex colors as a mask to reveal a texture containing scratches. The vertices that are displaced in a collision could have their colors changed. This method would also require a custom shader.

Each channel of the vertex color could correspond to a unique texture representing the direction of the scratches. For example, you could have vertical and horizontal paint scratch textures on the material, corresponding to the U and V directions in texture space. The R and G or B values of the vertex colors could be linked to each of the textures, and the shader could blend between the scratch textures based on the colors. Upon collision, the relative velocity of the impact could somehow be transformed into texture space/UV coordinates and stored in the RG values of the colors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant