Quote:
|
The bit 2 in the polygon struct should be taken as temporary...at some point we'll need a full-blown alpha setting to handle semitransparency (e.g. windows), but this will do for now.
|
Quote:
|
Quote:
|
I don't know...we should probably talk about it. That's the way it's done in WLD, but I'm not sure it's the best way. Is it better to tie alpha to polygons or textures? When rendering, alpha is done at the poly level.
Edit: Here's what I've got so far: Code:
Unit XWFFiles; |
Quote:
|
Well...there's more than one kind of alpha we're dealing with. There's alpha in the texture data, for instance tree leaves have the transparent bits with alpha = 0, and there's also overall polygon alpha (for semitransparency). It's possible to have masked textures with transparent bits that also use polygon alpha. A good example is a texture that represents glass -- most of the texture has the alpha at 0, but those parts that don't should be semitransparent. It can be done either in the texture or in the polygon, but not supporting both means needing a separate texture for every different overall alpha level you want to use in a zone.
|
Quote:
Can we put that off until the second revision of the file format? :) |
You're going to want alpha in the textures, at least allowing 0% and 100% transparency so you can texture things like leaves on trees that have gaps between them.
Using values inbetween is of course harder as it required you to depth sort the polygons before drawing them to work right. On the Vertex format - you might want to have location, normal, texture coordinates in that order rather that the one you have now. I know you're using opengl but if it doesn't matter for opengl then you might as well well make it as easy to use for all possible platforms. As for the main file format, it would seem easier to me to load an index to all the file fragments rather than have to skip through the file looking for what you wanted. That's really what I mentioned zip for, was the index at the end of the file EDIT: I meant to say the DirectX is slightly easier if the vertex compoents are in that order so why make it harder if it doesn't matter to opengl |
One thing I'd like to point out is how the vertex group and polygon group structures all start with two ulongs, group ID and count. Tnis is a good thing because as I implement this I can implement them as one generic container class and use the same code for both (where the constructor takes an extra argument specifying the size in bytes of the individual records they contain).
|
Should we always insist that the first node in the tree is an octp node (that is, it's divided at least once), or should we allow the initial node to be an octe node if the zone is (very) small? For that matter, is it really necessary to have two types, or can we just have one type and know if it's the end node by the number of children (either 8 or 1)?
|
Quote:
|
Sorry, that's what I meant. I'm looking at integratnig this with OpenZone, after all. In a wld-, should we demand that the first node of the octree is an octp or can we allow it to be an octe? It relates to the logic when exporting the zone, whether or not to divide it based on the zone size. For instance, right now I do BSP division only if an extent is larger than some threshold. It seems to me that it would be a lot cleaner to just have octp nodes, since the renderer has to process them all anyway...but I'm more familiar with BSP trees so it's hard for me to say.
|
Quote:
So it's just the Octree header and then either 1 poly node or 2-8 other octr nodes. Simple enough. |
Okay, that's how I'll code it then.
|
All times are GMT -4. The time now is 11:55 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.