Archived

This topic is now archived and is closed to further replies.

vijaykiran

Problem with Texture mapping & GL_POINTS

Recommended Posts

Hi all, I have been doing some terrain visualization with physical mass flows running over the terrain. I have developed my own routines to visualize the terrain with texture mapping using GL_TRIANGLES. I was successful until that point seamlessly. Depending upon the massflow data files I have been given, I would just need to display the points over the terrain. For example, I have a static terrain texture map rendering properly. I have say 10 data files containing the x,y,z location of say 5000 points in each data file. I had this necessity of reading first datafile set, display it. Then read the second datafile, display it, so on until the 10th file is read in and displayed over the terrain. The mass flow datasets are so pre-calculated so that they run either on the surface or slightly above, but they dont reach below the surface at any cost. I would need to build this application in SGIs, Solaris, Windows and Linux platforms. I am successful in getting outputs in these platforms, but each one of them shows a different kind of outputs when it comes to the massflows over the terrain. I get a perfectly correct simulation that I wanted and expected on SGI Octane, SGI Octane2 and SGI Fuel. All these massflow points from the datafiles flow above the terrain. But in all other machines - SGI O2, Windows(VC ++ executable), and Linux, I can see points diving under the terrain, which should not happen. I use OpenGL API using C for coding. I enable lighting when terrain is displayed, and disable it when I display the mass flow over the terrain. I use GL_POINTS for points(mass flow) flowing over the terrain. When I read the datafiles to obtain the x,y,z location of points, I first read them as strings, and using atof, I convert them to doubles. I double checked that the x,y,z values in the data files are the same precision numbers when I display them too. I have no clue as to whether its a problem with the code or a hardware issue. I am sure many people might have encountered such issues. Could anyone throw me some light on this issue. It is very important that the massflow points shouldnt go under the terrain. Thanks in advance, Vijay.

Share this post


Link to post
Share on other sites
Sounds like a z-buffer precision error. Either requerst a higher precision z-buffer (you seem to need it) or push your near plane out. Do a search for "z fighting" and I''m sure you''ll find lots of info.

Share this post


Link to post
Share on other sites