Skip to main content
GameDev.net gamedev.net
šŸ”’ Locked

Drawing several grids of points

Started by aarbron May 11, 2014 at 11:40 PM 0 replies 1.1k views
Original Post
aarbron
aarbron

Hello, I'm wondering what's the proper approach to draw grids of different sizes. So far I'm using a buffer for grid transforms, another for point info.


for (size_t i=0;i<NUMGRIDS;i++)
{
	size_t numpoints=grids[i].w*grids[i].h;
	glVertexAttrib4f(gridAttrib,grids[i].x,grids[i].y.....);// grid pos&scale
	glDrawArrays(GL_POINTS,offset,numpoints);
	offset+=numpoints;
}

I don't think instancing is an option since grids don't have the same number of points.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.