Many of you may know the famous example "Glitter" from Rendermonkey. Unfortunately it is too complicated and heavy for a mobile device and some of the prototypes do not work on GLES 2.0.
There is a clever trick anyway - we can mask the object. As a mask we use the alpha channel of the texture. This mask will not be black and white, but gradient. If this gradient is well done, it can be used for parallax mapping. There is nothing special in the vertex shader.
This is the GLSL version of the fragment shader: :
This is the texture that corresponds to the GlitterSampler:
If rim is used as an additional mask we add specular mapping and we get the same visible result. The difference of using this approach is that it operates tens of times faster. As further optimization we can transfer the calculations with texture coordinates in the vertex shader.