dynamic decal effect on unity

what i want to do now based on a game: unfinished swan.

the first step of course, is to shoot something( blood, water) on an object and let it looks like it adhere to the object. the skill needed here is decal.

sadly, the decal effect in unity is either too simple( can only support wall and floor) or expensive($95 !!), so I referred some code and create this effect:Untitled

the basic idea is, when you click, create a mesh on the place of the camera and “push” it forward. Push is actually using raycasting, do raycast from camera to each vertices, and see if collide with something, if so, put the vertices to the collide point. after relocate each vertices, draw the mesh again.

The main problem with this way is, if one of the vertices is far away from others, there will be weird lines linked between these vertices. Need to fix this but i’m satisfy with this effect now.

This entry was posted in decal and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s