Implementing a contact shader, which colors the object on the contact points

993 Views Asked by At

In a scene in VR I am trying to implement a shader with shader graph, where at each point of contact of my hand with a cube, the cube gets a simple red dot.

My idea was to create a texture where I changed the color of the concerned vertices and then applied it to the cube, but I didn't find any way to apply a texture to a cube. Then I tried to modify the vertices directly with the "VertexColor" node, but I don't know exactly how it works and the documentation is not very clear to me.

I had also considered using decals, but I am using the URP, for which Unity does not support projectors and would prefer to use a shader.

So if anybody could provide any help, I would be very greatfull.

0

There are 0 best solutions below