RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
RuneLancer
Mage


Joined: 17 Jun 2005
Posts: 441

PostPosted: Thu Mar 09, 2006 6:19 pm    Post subject: Enhancing graphics [quote]

Lately, I've been revamping a few things in Endless Saga's engine. For instance, I'm adding properly-calculated illumination (smooth-shading, to boot) instead of having my normals pointing straight up (which works, but isn't accurate and never was intended to be permanent anyhow.) The biggest change has been going from quads to tris (I knew that was coming and hate myself for putting it off for so long :P Luckily that was an easy switch.)

This opens up a lot of possibilities, because working with a three-sided polygon is much easier than a four-sided one (you usually have to subdivide a quad into two triangles to work with them.) Seeing as manipulating my map data became so much easier than it was before, I decided I'd go ahead and add the possibility of having a dynamic level of detail. Subdividing a polygon on the fly as the camera closes in on it is easy enough, after all. But...

1- Merely subdividing isn't enough. A flat plane pretty much looks the same wether it's a large quad or 50 small ones. Making a bezier curve out of it would be great, if I can make something that would be universal enough. This would allow hills to be hyper-smooth instead of blocky.

2- I'm using vertex arrays. While this isn't a problem in itself, manipulating the map data dynamically is. The overhead of inserting elements and removing them from my vertex array every frame would almost certainly kill any performance benefits I'd gain over immediate mode.

Does anyone have any experience with this? I'm hoping I could just set a flag for any given poly (I reserve 2 bytes per poly for flags, such as "this poly can be walked on" or "don't actually render this poly," etc.) and letting my engine deal with it, frankly, but if I don't want to have unecessary overhead in managing my vertex array's contents, it seems like some planning will be required. :x

The map format I've created stores polygons in different modules (sectors) and organises them by texture; the actual polygon is just 2 bytes of flag data, and texture/vertex coordinates for each point. The rest is calculated on the fly (ie, surface and vertex normals, for instance.)
_________________
Endless Saga
An OpenGL RPG in the making. Now with new hosting!

Back to top  
DrunkenCoder
Demon Hunter


Joined: 29 May 2002
Posts: 559

PostPosted: Fri Mar 10, 2006 7:30 am    Post subject: [quote]

Well you shouldn't be refilling your VBO's every frame anyhow and seriously immidate mode is for all serious applications not really an option.

Bezier curves are nice and can as you say give you arbitary precision and smoothness.

Generally you only want to recalculate geometry when something "intresting" happens and that should be quite seldom, if you want to get real snazzy I would advice you to create a background worker thread that tries to guess what LOD on what object is going to be needed and precalculate them.

Also always have collision work against a fixed model you don't want walkability to be determined by the actualy poly's on the screen. Imagine that you implement a zoomable camera then you could get funky stuff happening depending on the zoom level since diffrent LOD levels could potentially result in slightly diffrent terrain characteristics.
_________________
If there's life after death there is no death, if there's no death we never live. | ENTP
Back to top  
biggerUniverse
Mage


Joined: 18 Nov 2003
Posts: 326
Location: A small, b/g planet in the unfashionable arm of the galaxy

PostPosted: Wed Mar 15, 2006 12:21 pm    Post subject: [quote]

1. ROAM, or clipmaps

2. If you really need this, try GL_STREAM_DRAW

You really ought to make it sector-based, not per-poly. Per-poly anything will not scale well.
_________________
We are on the outer reaches of someone else's universe.
Back to top  
RuneLancer
Mage


Joined: 17 Jun 2005
Posts: 441

PostPosted: Wed Mar 15, 2006 11:15 pm    Post subject: [quote]

GL_STREAM_DRAW? Never heard of that. I'll look into it.

I figure I might simply do this at load time, since I'm no 3D modeler and my maps aren't very complex to begin with. It isn't the extra polygons that I'm worried about so much as the overall quality of the maps. (Right now I can very easily hit over 1800 FPS with everything turned on in immediate mode; hardly any performance problems there...)

I'll see what comes out of it.
_________________
Endless Saga
An OpenGL RPG in the making. Now with new hosting!

Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum