PDA

View Full Version : Bezier-Surface == terrain?



mathias_123
01-26-2002, 04:31 AM
Hello,
once more I'd like to know some opinions of you advanced gl-people, to avoid spending too much time in doing stupid things.

I'd like to build a terrain for a 3D-game, and I heard several times about height-maps to do that. But in my gl-Book (superbible) I didn't find sth. about that, but about bezier-surfaces and nurbs. So I built some beatiful bezier surfaces with lots of control-points and texture, and now I'd like to know if there is a reason to prefer height-maps (whatever they are).
I've just had a problem with these bezier-surfaces, but I dont know If it's because of them or because of my glBlendFunc: I could not put a blended quad under the surface to make some water (in the regions of the surface that are lower than this blended quad).
However, thanks for opinions and tips!

mathias_123

Spartacus
01-26-2002, 12:28 PM
I can't really say that bezier surfaces are wrong way to create terrain, but I would prefer heightfields because it's much more simpler and easier method to implement. Also with heightfields you could create your own maps with for example Paint shop pro, etc...
About your water quad problem: it could be blending problem. What glBlendFunc you are using? Also water quad could be backface culled, if you have declared vertices in wrong order.

Elixer
01-26-2002, 12:55 PM
I'd say that using bezier-surfaces and nurbs can be slow on most hardware that is out now, and it also depends on how many control points and so on.

Most people use height fields, and tris or quads.

mathias_123
01-26-2002, 02:24 PM
My depth func is (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and I first draw the quad with depth-testing turned off and then the surface. But I can see the water only on places where no surface is.

thx, mathias

Hull
01-26-2002, 02:33 PM
Dont get discouraged.

Beizer curves and nurbs is the way of the future and you can combine maps of controlpoints with maps of heightdata (Could perhaps be the same).

Problems can always be solved, even so if you have to do it yourself in software http://www.opengl.org/discussion_boards/ubb/smile.gif .

Graphics hardware evolve so rapidly that in a month or two, GeForce4 is here and there is less need of ugly stuff just to make those extra fps.

Think about this:
What would you choose in a video-game store, a game that uses features that makes it almost perfectly real, but needs the absolute newest hardware... or a fast plain game that doesnt show anything new?

Yep, it is YOU and the rest of the game developers that sets the standard for tomorrows hardware. Not the other way around.

And your game will be advanced enough to keep selling way beyond those 6 months of an average Quake3 equal....

I rather play your game when GeForce5 and AMD 3ghz processors are out there, than any quake3 replika....

Good luck. Time is on your side.

Spartacus
01-27-2002, 12:01 AM
Originally posted by mathias_123:
My depth func is (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and I first draw the quad with depth-testing turned off and then the surface. But I can see the water only on places where no surface is.

thx, mathias

Your BlendFunc is correct, however you must first render your terrain and then render the water quad. Blended polygons are always rendered last, otherwise the blending is incorrect. Depth-testing can be enabled all the time and should not be disabled, this is the reason why water quad is visible only in parts where is no terrain is visible. Blending is enabled only when water quad is being renderd.


[This message has been edited by Spartacus (edited 01-27-2002).]

mathias_123
01-27-2002, 05:44 AM
Hi,
thanx to you all for anwering my question!
The blending works fine now, thanx spartacus!
...but I've just become another problem with surfaces and blending, but I'll post it into a new topic because it doesn't really fit in here.

bye,
mathias_123