I am developing a 2d mobile game that has a large deformable terrain (a lot like worms). I am rendering the terrain using a gray scale bitmap (in a fragment shader) which serves as a texture position map. If the pixel in the bitmap is black i render the pixel with a ground (tiled) texture else i render the background texture.
This works very well but now i would like to add rocks and static images to the terrain. The rocks will look like this
So my idea was to extend the grayscale bitmap to a RGB bitmap and use the green channel to mark the rock shape and the blue channel to mark the location of static images (which are not tiled).
Since the static images are not repeatable i would have to create blue rectangles which are exactly the same size as the static image. Could this be done any other way?
For the rocks i would use a similar approach but with the green channel so if the pixel in the bitmap is green i would render that pixel with a rock texture (the bitmap shape is blurred on the edge to render the black border). The rock texture is the dark gray color close to the black border on the picture. But the problem is that the rock is now a solid color with a black border and i would like to get as close to the picture as possible. Is it possible to create a texture to get the same type of shading as on the picture? Or is there any other way of doing this?
Thanks!