I'm working on drawing a terrain in WebGL. The problem is that I'm only using 4 vertices to draw a single quad by using indices to share vertices. So I can't upload unique baricentric coordinates for each vertex, because it's shared.
Here's a picture that shows the problem more clearly.
There's no barycentric coordinate that I can use for the question mark. (0,1,0) is used top left, (0,0,1) is used above and (1,0,0) is used to the left. So there's absolutely no way I can do this when I'm using indices to save vertex count.
Do I really save that much performance drawing a quad using 4 vertices instead of 6? If not then that's the easiest way to fix my problem. But I'm still curious if there's a way I can do it with shared vertices.
I'm aware that I can draw my terrain in wireframe using GL_LINES but I don't like that method, I want to have more control over my wireframe (e.g. not make it transparent).
Some people might ask why I'm using barycentric coordinates to draw my terrain in wireframe mode, it's because it works nicely in this demo:
http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/
So it's basically two things I'm looking for:
- Do I lose much performance drawing my terrain where each quad is using 6 vertices instead of 4? Because if not, then that would solve my problem by not sharing vertices.
- Is it possible to have unique barycentric coordinate for 4 vertices that are shared to draw a single quad?
Thanks!