PDA

View Full Version : texture mapping versus vertex coloring in an octree.



wildeyedboyfromfreecloud
02-28-2002, 04:50 PM
heres the story. i have written a program that generates pseudorandom terrain within an octree with vertex arrays. i have the option of using either a compted texture map or computed vertex colors. now when i use the vertex colors things go rather fast and without FPS lock, performance is obviously dependent upon how many octree nodes are in view. hovering around 45-65FPS (65 being the highest i ever get). but when i use the texture map, my FPS are about a constant 35FPS regardless of where i'm at even if my back is completely turned to the entire octree outside of it. is this normal? it is an array of 255X256 chararacters. with support for mipmapping. on a side note the terrain also has a water table. i wrote some code that blits a 32X32 raindrop animation to its texture. which are actually rather huge on a 256X256 texture map. anyhow this drags the porformance rather hard for the effect. i realize i could do particles that are flat but that would only work on water that is flat... and i wanted to add waves to the water. i can't wait for some graphics cards with more upmf. i emptied my pockets for a geforce3 maybe i should look in to a larger processor. any thoughts?

zeckensack
02-28-2002, 05:02 PM
with support for mipmapping.Now do you use mipmapping? Support means nothing ...


wrote some code that blits a 32X32 raindrop animation to its texture. which are actually rather huge on a 256X256 texture map.Aha, you don't use mipmapping. Do so. And don't blit your animation to the main texture. Very bad. Have you benchmarked it without the water animation?

wildeyedboyfromfreecloud
02-28-2002, 05:13 PM
Now do you use mipmapping? Support means nothing ...

i suppose. this is the routine i use gluBuild2DMipmaps() because i was told it looks good. but i imagine the mipmaps really drag performance. why not blit to the main texture? where else the texture buffer?

chxfryer
02-28-2002, 06:40 PM
Originally posted by wildeyedboyfromfreecloud:
i suppose. this is the routine i use gluBuild2DMipmaps() because i was told it looks good. but i imagine the mipmaps really drag performance. why not blit to the main texture? where else the texture buffer?

I dont know why, but my card (intel 82810) gets a higher FPS with MipMapping than without. Maybe its just my card or the preogram.

wildeyedboyfromfreecloud
02-28-2002, 06:46 PM
actually mip maps should speed up the program i imagine. because the idea is to create less detailed textures for viewing when the point of interest is further away. well i'm no expert on the matter. i was just considering using maybe a lower quality texture mode to get performance, i did just come across a paletted and 3d texture extension.

zeckensack
02-28-2002, 07:17 PM
To actually benefit from mipmapping you must specify a mipmapping texture filter, like eg

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR_MIPMAP_LINEAR); <- for full trilinear filtering

And if you use gluBuild2dMipMaps (or whatever it's called) each time you blit your rain stuff into the texture, it's obvious why your performance drops so low. This is most likely software downsampling and will kill your performance if you use it every frame.

Try to take your water animation out and benchmark it again. You can likely get much better performance if you overlay the animated parts with multitexturing - and don't mipmap the overlay!

wildeyedboyfromfreecloud
03-01-2002, 12:41 PM
i probably do use that call. i'm relatively new to openGL so i don't have all the syntax burned into my memory as of yet. i'm not using the animation currently. i still get 35fps with a 256X256 texture map over a heightmap with say round 1600 verticies in an octree. i'm emplementing ROAM into my terrain engine tonight. right now it runs fast with vertex coloring but you get a bit of a vertex gradient look if you get too close. so i definately want to use textures. i'm sure there is a good reason it is so slow. the only part i don't understand is why the fps change little if none when texture mapping is on. even if none of the terrain is being drawn.

knackered
03-01-2002, 01:55 PM
Use this extension:-
SGIS_generate_mipmap

instead of that glubuild2dmipmaps malarky.

It's supported in hardware on nvidia cards (so I believe).

richardve
03-01-2002, 02:33 PM
Wasn't that GeForce3+ only?

Dodger
03-01-2002, 02:38 PM
Nope, available from GF2 up if I'm not mistaken.

Overmind
03-02-2002, 06:27 AM
That would mean from gf1 up, since there is technically no difference between gf1 and gf2 except memory and speed. At least this is what I heard from various sources (including this board).

wildeyedboyfromfreecloud
03-03-2002, 10:35 AM
ok will use the extension. can i ask a question. in order to utilize the extensions are there library files one would need somewhere or should they already be in the latest opengl standard libraries. also i'm new to this. i was using the maya generate texture UVs function. i literally tried everything i could think of. but i couldn't get the texture to stay put. any suggestions.

Humus
03-03-2002, 11:29 AM
You need those:

#define GL_GENERATE_MIPMAP_SGIS 0x8191
#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192


Then call glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE) before uploading the texture.

This extension is also supported by the whole Radeon series cards too btw.