Yes, I also have a greyscale heightmap I'm using. I just rendered it in blender because I'm using mesh + custom terrain shader. The code does just use the red channel, this is the function to get the height at the current position:
float get_height(vec2 pos) {
pos -= 0.5 * heightmap_size;
pos /= heightmap_size;
return amplitude * texture(heightmap, pos).r;
}
The pos parameter should be the x and z position of the current grass blade.
BPC is the amout of different colors a texture will store per channel, correct? And is that what the 8 is in "RGB8"?
Also, how do I add code? I tried with that function, but it only recognized the last line.