terrain texturing

Started by
11 comments, last by lesni_bleble 19 years, 10 months ago
quote:Original post by oconnellseanm
Actually, the memory bandwidth stays the same I think no matter how many pixels are blocked by the alpha test. The alpha test isn''t performed until halfway into the pipeline, so its already been passed through memory into the GPU''s processor.


Not if you do the additive blending with the framebuffer.
The alpha-test prevents the blending from being performed for black pixels and saves you a read-from-fb, write-to-fb, which are quite costly.
You are right in saying that the AGP-bandwidth stays the same.

quote:Original post by lesni_bleble
i see.
but roam algorithm split far triangles, which uv and texture i have to use then?
or should i look for another terrain visualisation algorithm, which will be better suitable with texturing?

eL


You can use an object-linear texgen mode. This lets the OpenGL calculate the texure-coordinates from the object-space vertex positions.
You basicly scale the x/z-coordinate (assuming your terrain lies in the x/z-plane).
Google for automatic texture generation OpenGL or look it up in the red book.

Jan
Advertisement
lesli_beble has mentioned that he has to bind a large number of textures.That means that jeickmann''s solution needs one pass per texture,so I don''t think it''s very viable.I think the best solution,as okonomiyaki suggested,is batching and it can work in combination with ROAM and VBOs.You just have to use one VBO for each texture.When you calculate the triangles on the fly,you put the data in the correct VBO,according to the texture index.In the end,you just render the VBOs with the appropriate texture binding.
Yes, but if you only sort the triangles by texture, you will get very weird popping once a triangle with texture A splits into two triangles with textures A and B.

You could always go for a hybrid approach by sorting by texture but putting a triangle into the VBO''s for all textures that influence it and then use the alpha-texture. This way, you save the T&L for the vertices that aren''t used at all by the texture.
Additionally, you get nice fading where different textures meet if you also add triangles close to the textured area.

Jan

This topic is closed to new replies.

Advertisement