I am new to web programming and I need to do real time rendering of large DEM datasets using openGL.
Please guide me how to achieve it using WebGL and javascript.
the approach i am using for rendering is tiling the data and loading the tiles wen needed.
Also, would any server side scripting be involved in this ?If so, which language should I use?
Ok, this is quite a big question. I’ve done some terrain rendering using JS, although it was limited to one tile.
I think what you describe is certainly possible with WebGL and Javascript, and arguably better than the alternatives. There are many tutorials on getting started with WebGL (e.g. this one, based on the original NeHe OpenGL tutorials). Javascript is a flexible and expressive language, which you can find a lot of resources on (Doug Crockford having some of the best insights and guidelines).
As for your particular problem, I would generate a number of descriptors for your tiles, including size, position and maximum and minimum heights within each tile. Then use the viewing frustrum (the area visible in front of your ‘camera’) and the bounding cuboid of your tiles (given by their position and max/min heights) to determine which ones are visible. You may choose to discard any after a given maximum viewing distance.
Having got a set of visible tiles, you can now render them individually.
I don’t know what format your tiles are in, either a grid of heights (which can conveniently be stored as standard images) or a vector description, but that determines how you will be rendering them. For the grid of heights, the simplest way to render them is as several strips of triangles. That means creating some large vertex buffers, but you may be able to do something clever. Beyond a certain number of tiles, you’ll have to manage which ones are kept as WebGL buffer data (and uncompressed images) and which ones are freed.
Since your question is quite general and high level, I’ll keep my answer similar. This sounds like an interesting project and I’d be happy to any more specific questions you might have.