opengl - Million mesh programatically? -


i have flat surface drawn single fullscreen gl_quad.

i want deform surface @ each point specified gl_texture2d, preferably through kind of shader.

in mind, black correspond flat , white correspond hill.

i want have 4 million points on terrain , update them @ each step in program.

how use geometry shader this? shader able generate new veritices?

the simplest way generate large triangle strip grid, upload vbo , draw it, using vertex shader alter coordinate. vertex shader can generate normals heightmap (or supply normal map), passed fragment shader lighting.

to avoid storing huge amount of data vertices, use glvertexid generate vertex positions scratch in vertex shader. don't bind buffers, call gldrawarrays(gl_triangle_strip, 0, lots).

as guyrt mentioned, tessellation shader , allow vary tessellation detail based on camera's distance mesh. more work though.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -