You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: