most officient way to represent a wireframe?

IceKnight

Newcomer
I am working ona simple 3d engine and have about 4 ideas on how to represent a wire frame with no textures aplied.

I am just wondering how do most 3d engines represent their geometry. I am almost certain that some of them sacrify performance for elegancy. I want more perfonmance at any price(No wonder I still do some code in assembly x86), but would like to see the different ideas.

I will start to check out some of the open source 3d engines that are on the web, I dont remember their names but I know I have seen some websites about them.

Hope this is a interesting thread.
 
I assume your asking how to store the model, i.e. the verts and lines?

In which case it depends.

How big is the model (are you trying to represent miles of terrain or a space ship)?
Is this for a software or hardware renderer?
Is offline compilation of the models possible?

There are probably other issues that effect the answer, but those are the ones that pop to mind.

FWIW we used 21 different vertex formats in the last game I worked on.
If your building a generic game engine you probably want to design it in such a fashion that different formats can be used.
 
ERP

Thats what I thought, about making different formats for different purposes.

Anyway, its for large and detailed models. I am working by myself, I find this entertaining. I am an EE, so sofftware is not my area, but I have a minor and enjoy coding, always keeping in mind the hardware I use.

In this case just an amd cpu, I just need the general idea and then I can change the code to work with a gpu, not like its easy. Keeping in mind how long this is going to take me I dont mind having very complex objects since the technology is going to get a lot better, meaning more raw power.

Anyway, I found a lot of information in the web, thanks.
 
If your software rendering then you'll want to minimise the transformation overhead, which means an indexed list.

The easiest solution is an list of indexed line segments. You could potentially reduce the number of indices by generating line strips, but it's probably more work than it's worth.

so you'd have an array of vertices, and an array of index pairs.

If it's a software renderer you'll want to transform all of the verts (or a portion of them based on cache size), and then draw the line segments. You probably won't want to comlicate things by dealing with fixed point verts (thry're only really useful when the model is spacially small).

The only other issue is formatting for things like SSE if you want to go that way.
 
Back
Top