Jump to content
XCOMUFO & Xenocide

2d&3d References: merged topics


Crix Dorius

Recommended Posts

Ok, my head is full to bursting with questions about the textures.

Will we use 512x512 textures? I have seen the argument that some cards can't handle textures of that size. Does this include our minimum spec. card Geforce 2?

How much video ram does a texture take? I have no idea of how this works.

Are all textures in a scene loaded into the 3dcards ram and then shown on screen?

Is the textures file size directly proportional to the amount of 3dcard ram used by the texture?

 

Can we use multiple layers of textures for objects? For showing bullet holes, dents and such?

How about bump-mapping? Is it possible? How does it work (if possible) ingame? Do you have a separate texture just for bump-mapping?

 

How does alpha work ingame? Should we save an alpha channel in the textures? Or a separate texture? Can we use "true" alpha, or just the one-color GIF kind?

 

Are we going to use the .png format ingame? Or something else?

 

This is quite a lot of questions. No-one needs to answer all of them by him/herself, but I would really appreciate some answers.

 

 

And I apologize in advance if any or all :P of these questions has been answered before.

Edited by Cubik
Link to comment
Share on other sites

Well I will try to give a little detail on all of those. There is no point into use 512x512 if you are texturing a small object (primarily if it doesnt need so much detail) or a low detail one. For soldiers and aliens it is a good bet because of the detail.

 

About how much memory space suppose you have a 512x512 texture, each pixel needs 3 channels (RGB) or 4 (RGBA, A for Alpha). And every channel is encoded in 8 bits = 1 byte. So the grand total is 512x512x3 bytes... However big texture maps can show problems when the object is far away so you have to use MipMapping to avoid those artifacts... that means you are using program generated textures. Suppose you use 3 levels mipmapping, then you have 3 textures, 1 512x512, 1 256x256 and 1 128x128 (do the math)...

 

About layers, yes we can every or our target video cards support multitexturing, however try not to overuse that, cause for example you need 1 additional texture for the bump mapping normal encoded texture, another 1 if you want to use gloss map, and every new texture adds hw rendering pass... If I recall right GF2 can do 4 textures in 1 pass, then 5 to 8 textures will took twice to render.

 

The idea of bump mapping is simple, instead of using geometry (which is expesive for high level detail) you use an encoded texture for the surface normals (as you should know the normal of a surface points where the surface is looking at the point). And then you do some mathematics taking in account the direction from the light and surface properties. The result is that after applying that function you get roughness in the surface caused by sporadical fake shadows on the surface.

 

You can use alpha channels for several things, the most important use is transparencies... But sometimes you use that extra channel to encode some special attributes of the surface to use in shaders. True alpha 8 bits depth. And yes you can use it.

 

PNG is the file format where you store the data, nothing prevent programmers modify the data format in runtime, in fact we use only the raw data after we read the important part of the PNG header and decompress it.

 

I hope this can clarify your questions... I had replied some of this before, so better if someone from documentation can start a Technical FAQ it would be better...

 

Greetings

Red Knight

Link to comment
Share on other sites

Thank you for these excellent answers, red knight.

 

So, four textures is the maximum if we want everything to run at the same speed? I was thinking of bullet-holes and other things that should appear on the models ingame. Or could we just slap on textures the way that HalfLife (and other FPS) did? A alphamapped texture which just were added where bullet and otehr things hit. It was called decals in the editor.

 

A technical faq would be great, since it would (hopefully) eliminate the further need for posts such as this.

Link to comment
Share on other sites

There shouldnt be more than 4 textures... but you can use more, I wanted to show you that there is a significant difference, so to be aware of the limitations (not everything can be fixed with textures)...

 

Greetings

Red Knight

Link to comment
Share on other sites

Hey -

 

Do any of you know of a good tutorial for GMax, or even Milkshake, that explains how to create a room interior? Like that of any old house, just need to know how to make a room that I can put things in like desks and tables, etc. But I have no clue, so I need a tutorial.

 

Any help would be really great, I'm desperate!

Gold

Link to comment
Share on other sites

Guest drewid

The different layers may use different sized textures. environment maps, tend to be small.

 

we shouldn't need to use 4 for most things. maps take space.

 

This is what has to fit on the video card - depends on res.

 

Front screen, (32 bit frame buffer) , width x height x 4 bytes so 800 x 600 = 1.9mb, 1600 x 1200 = 7.6mb !!!

screen back buffer - same again, 1.9mb / 7.6mb

same again if we enable triple buffering. 1.9mb / 7.6mb

z buffer - (distance from the camera for each pixel) screen width x screen height x 4 bytes 800 x 600 = 1.9mb, 1600 x 1200 = 7.6mb

 

Stencil buffer 1 or 8 bits per screenpixel, can sometimes be included in zbuff space, but if not up to 480k / 2.1 mb

 

so 800 x 600 = 8mb, 1600 x 1200 = 32mb, just for the screen.

 

 

for each object- lets assume an object with 500 verts, mesh data is pretty small so:

 

vertex buffer, x y z coords, 32 bit float per coordinate 12 bytes per vertex.

a single vertex in your modelling package may be split into many vertices in ram in order to hold uv/colour/other data, lets assume 4 verts for each original as an average. so thats 24K for our objects 2000 vertices

 

A single vertex can have multiple UVs lets assume 4 as an average and 2 layers. = 64k

 

material colour, RGBA - 4 bytes = 8k - (can be packed on some cards)

 

vertex normal, x y z rotation = 24k

 

index buffers 8 k again? ( guess)

 

so that 128k for eack object (tiny)

 

deformable mesh objects also have bone and animation data, and vertex per bone data - this is very very variable. but for a reasonably sized object you can assume 250k

 

So 10 troopers = 2.5mb 10 aliens = 2.5mb

 

texture space and mips

a 512 x 512 x 4 byte alpha map takes (gasp) 1mb, add in a mip and thats 1.5mb

256 x 256 = 390k

128 x 128 = 98k

etc.

 

How many do you want per object?

 

vertex and pixel shaders - negligible.

 

 

I've said it before and I'll say it again.

Ideally everything needed within a world needs to fit on the videocard all at once. (all background objects, drawn or not, all textures , all animation)

 

Sending textures from AGP ram to the card is S - L - O - W, even with 8x AGP. running out of space on the card and having to thrash textures from AGP on the fly is VERY VERY BAD. The NUMBER ONE cause of frame-outs, and we should fight to avoid it.

Link to comment
Share on other sites

Guest Jim69

3Dcafe.com helped me a little with 3DSMAX, maybe they have some info u could use?

 

BTW, What's project Phoenex?

Edited by Jim69
Link to comment
Share on other sites

Milkshape has tutorials linked on their website, but it's mostly for making unit models. What are having trouble with? The one thing I think lacking in Milkshape is lighting sources, it's not designed as a rendering tool. So if you're wanting to make some shots of that room you'd need to export to another app.
Link to comment
Share on other sites

drew, thanks for that detailed explanation on sizes...

 

So as drew had shown, vertex data is far more space efficient that textures... however, it is more complex for the Video Card to handle that... Textures are an expensive way to add detail where a little more polys would have done a better job.

 

As I stated in other posts, Do not waste polygons, but do not underuse them... It is easy to notice when adding more polygons is not helping at all, in that case you need textures. If you do need them, you have to live with their innefficience, cause you know there is not another way.

 

Greetings

Red Knight

Link to comment
Share on other sites

This site has video training videos for a few major platforms. They do require you to sign up for a free account but overall the videos are effective with orienting you with the features of the platform.

 

http://sv2.3dbuzz.com/vbforum/uunr_vtmlist.php?c=2

 

Have fun.

Link to comment
Share on other sites

Thanks for the info, drewid. The picture below is a quickie I did to see how different textures work at different sizes.

 

32x32: If you squint, you can almost believe it's wood.

64x64: Getting better, could actually work on the lowest zoom level.

128x128: I think that this should be the standard level for Battlescape building textures. It works.

256x256: Maybe something for the highest zoom level?

512x512 (Not pictured): Overkill.

post-29-1059312952_thumb.jpg

Link to comment
Share on other sites

I have parquay (sp?) flooring like you picture there, and each small sqare is 6 inches across. So the size of those in-game would be pretty small, even when zoomed in. Attached is IMO probably as close as you'd zoom in during gameplay, and the 64x64 looks quite good at that resolution as well. Even if you do zoom in super close, people expect the textures to be little rougher at that point. Playing Battlefield1942, the textures aren't great when you're right on top of them, but they work very well. I guess I mean that textures don't necessarily need to be perfect at any zoom.

1.jpg

Link to comment
Share on other sites

  • 2 weeks later...
The only 1 that I am awere of is Milkshape, do a search on Google.

 

That's shareware unfortunately, well, you ofcourse can take up GMax, the game development oriented little brother of 3DSMax... But converting from .gmax to .3ds is a pain...

Link to comment
Share on other sites

I use Milkshape, while it is a 30 day shareware, it's only $25 to register if you like it. Blender would be the totally free version, all go to sourceforge.net and search for 3d modeling, there might be some others in various stages to try out.
Link to comment
Share on other sites

  • 4 months later...
This page is on the forums for Milkshape3D, and is an extensive list of artistic references for modeling. It's worth a look if you need some inspiration.
Link to comment
Share on other sites

  • 1 month later...

www.wings3d.com has a free 3d app called wings3d, it supports 3ds format among others, so it might be a good candidate for a new modeler. The site has tutorials and manuals on using it as well.

 

Edit: The web site seemed slow to come up for me at this posting. It came up one time, and timed out a second time. The link is valid, just give it another try later if it doesn't work for you right away.

Edited by Breunor
Link to comment
Share on other sites

I had probs opening that wings3d site at all but now it worked slowly and I got the prog and manual. So it works.
Link to comment
Share on other sites

  • 2 weeks later...

Recently I found some photorealistic textures on the web in a file some guy offering for HL2 purposes.

 

So I wrote to him:

 

Hi there,

>

>I'm really impressed by your textures and I thought I'd write to you on

>behalf of project xenocide, www.projectxenocide.com, which is a open source

>remake of the classic computer game UFO:Enemy Unknown / UFO:Defense.

>

>We are currently trying to locate resources which are free to use in a

>non-commerical, open source way. Are your textures in this catagory and can

>they be freely re-distributed with our project?

>

>very nice work again,

>

>Regards,

>

>Andy

 

And he wrote back:

 

Hi Andy,

 

These textures may be freely used and distributed, under the following

conditions:

 

- My name (BerneyBoy) and website (http://www.planetquake.com/berneyboy/) is

  mentioned in the credits section of your readme file or text file

distributed

  with your map/mod...

 

- The website where one can find these textures is mentioned, so other

people

  will find them: http://www.planetquake.com/berneyboy/

 

- No money is charged for distributing this texture set or ANY PRODUCT USING

  THESE TEXTURES. You distribute them free!

 

Have fun Andy...

 

BerneyBoy

 

So here they are all 124MB of them:

 

http://www.planetquake.com/berneyboy/textures.htm

 

It will take me forever to get them, so if someone wants to look into this...

 

Enjoy! :D

Link to comment
Share on other sites

I'm downloading them to take a look, they appear to be very nice. One of the senior staff here will likely send an email to be sure that using these textures in a GPL/LGPL fashion would not violate any agreements he has for their use.
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

This is for all modeller/animators out there. Make sure to read them..

 

http://www.gdconf.com/archives/2001/index.htm

The first part is programmers stuff, but at the bottom there is a artists and even sound stuff. Any admin can crosspost this in the sound dept forums?

 

Greetings

Red Knight

Link to comment
Share on other sites

  • 1 month later...
In case this wasn't mentioned earlier, it was brought to my attention that the dark model renders in opengl can be due to the low poly nature of the model and the resulting lack of verts for lighting calculations to use. A pdf by nvidia found here goes into various details, and point #2 might be relevent to the "dim model" issue using the 3D web viewer page. It's a good resource to check out in any case, although with our using Ogre and its lighting system, I'm not sure how much of that will translate.
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...