Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Mon Feb 22, 2010 3:24 am Post subject:
Please, help me with a survey on how to skin in Generals!
Hey guys,
I'm working on a feature for Voxel Section Editor III that will transform the voxel based models of the program into geometric 3D fully textured models. Here's the roadmap of this feature:
-> The program works out each mesh separetely and it does follow the following procedures in the following order:
- Clean up objects inside the volume [Completed]
- Generate planar faces, making it look like cubes [Completed]
- Collect data about remappable faces [Not Done]
- Use image processing techniques to smooth the mesh [Completed]
- Transform the mesh into triangles [Completed]
- [Optional] Do aditional smooth to the mesh [Completed]
- Detect the normals of each face [Completed]
- Convert face normals to vertex normals [Completed]
- Convert face colours to vertex colours [Completed]
- Build a texture atlas using the collected data. [Coded, but not tested]
- Generate Diffuse (Colour) Map [Coded but not tested]
- Build mipmaps for the diffuse texture [Not Done]
- Build normal map [Coded, but not tested]
- Build relief map [Coded, but not tested]
- Build house colour texture [Not coded]
- Save all textures with DXT3 compressed DDS files [Completed]
- Optimize the mesh [Completed, but it is still under tests]
- Save it with the w3d format [Not Coded]
Is this roadmap ok? Or am I missing any important stage?
And also, there are some important information that I need to make it better:
1) What kind of texture maps am I missing? Does Generals use specular maps?
2) If Generals uses specular, how do you do it?
3) Are these numbers correct for acceptable polycount?
300-500 Infantry
400-600 Light vehicles
500-800 Tanks & medium vehicles
600-1000 Heavy units
1200 One off units
600-1200 Defence structures
1200-2000 Structures
4000 One off structures
4) Is Generals able to handle DXT5 compression for DDS files?
5) Which shaders am I missing and are relevant for unit creation?
6) How many mipmaps does it use for the following situations:
-> 256x256 small textures
-> 512x512 medium textures
-> 1024x1024 large textures
7) What kind of unit, structure, etc uses large textures, medium and small (with the sizes mentioned in the question 6)?
And if I have any other question, I'll ask later. QUICK_EDIT
admitantly, this is my weakest area. However, remap, or housecolor, in generals is not a texture but rather a seperate object. I hope that doesn't complicate the models too much, but for each moving part, you get 1 housecolor attached to it. So for most things it'll be 1 for the chassis and 1 for the 1 turret. So you'll have to make the thing make all voxels colored remapable a seperate object from the rest of the model.
Just giving a quick glance in XCC Mixer, most units use a 256x256 texture (one normal one damaged), Mip Map Count of 9*, and a pixel format of DXT5**.
Infantry use TGAs that are 64x64. IIRC these are the only textures that can be remap.
*10 for 512x512, which was only for a huge b2 bomber. I didn't see anything larger.
**some textures use DXT1, but they look like they are overlays to make lights look on for night times. _________________ Please, read the signature rules of the forum. QUICK_EDIT
2) He's using some plugins, but it's possible and please add I can ask him if you wish
3) they are acceptable, but we can have some tanks with 1200 polys and it won't lagg the game (don't make this a limit ) See Contra Mod, with 3d tank treads.
4) No.
5) Nowadays, some mods uses the ENB Series Shader 2.0 for CnC Generals. It has a nice effect, and gives to SAGE a new look.
6 & 7) EA made all textures at 256X256 format. It's very undetailled and not recommended. Generals Modders usually prefer to use 512x512 texture for tanks. For structures, it depends...
EDIT: I'm just afraid that Voxel's texture are in very low quality, compared to CnC Generals...let's see how this will work out. _________________ QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Mon Feb 22, 2010 3:37 pm Post subject:
So, considering the information collected so far, we have the following road map:
-> The program works out each mesh separetely and it does follow the following procedures in the following order:
- Clean up objects inside the volume [Completed]
- Generate planar faces, making it look like cubes [Completed]
- Collect data about remappable faces [Not Done]
- Use image processing techniques to smooth the mesh [Completed]
- Transform the mesh into triangles [Completed]
- [Optional] Do aditional smooth to the mesh [Completed]
- Detect the normals of each face [Completed]
- Convert face normals to vertex normals [Completed]
- Convert face colours to vertex colours [Completed]
- Build a texture atlas using the collected data. [Coded, but not tested]
- Generate Diffuse (Colour) Map [Coded but not tested]
- Build mipmaps for the diffuse texture [Not Done]
- Build normal map [Coded, but not tested]
- Build specular map [Not coded]
- Build relief map [Coded, but not tested]
- Build house colour texture [Not coded]
- Save all textures with DXT3 compressed DDS files [Completed]
- Optimize the mesh [Completed, but it is still under tests]
- Save it with the w3d format [Not Coded]
The change is that I've included specular maps.
Also, by default, textures wil be 512x512 with 9 mipmaps. Infantry will use 64x64 with no mipmaps.
Also, the max polycount options for Generals should be:
Regarding ENB Series Shader, I'll have a little problem with that: OpenGL does not to accept to load pre-compiled shaders. I'm trying to figure out a way to do it, without rewriting the VXLSE III rendering engine. QUICK_EDIT
2) If you open the American Ranger texture zhca_airanger.tga You'll see that the texture has an Alpha Layer. This Alpha is the House Collor that you see ingame at the Ranger. You can do that with any unit, as long as the texture has zhca_*texturename*.tga And an Alpha section
Re-Map is the process that we open an unit into 3ds max and Re-UV Unwrap it, rendering the template as we wish, 256x256, 512x512, 1024x1024, depeding about what we want to do _________________ QUICK_EDIT
CCG itself uses DXT5, why you say it wouldn't support it? (abpwrplant.dds for example is in DXT5, also DXT5 is way superior towards DXT3)
This specular stuff is done with some tricky tweaks in the shader options. There is no native specular map. In Renegade this effect was used by some windows.
Polycount can be bigger as computers nowdays are way faster. Generals has no problems in handling 20 Models with 40k polygons (a friend rebuilt the Renegade 2 Kirov some years ago for fun with this polycount and it didn't lagged). Just don't split it in a huge number of subobjects and its fine. (A maximum of 2 or 3 subobjects (1 for the model and 1 for housecolor is best in CCG) and your models can have 10k polys without a problem) only thing you must have in mind is if its really necessary.
CCG doesn't natively support normal maps.
CCG doesn't natively support relief maps. _________________ QUICK_EDIT
@Ju-Jin: I tried all DXT formats when exporting one re-skin that i did and it just worked with DXT3, that's why i said it that Generals don't support DXT5. _________________ QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Wed Feb 24, 2010 3:08 am Post subject:
Today I took a look at the Generals textures and shaders and I'm surprised with what I've seen.
Correct me, if I'm wrong, but there is no normal map or specular map. The shaders are only special effects such as blur and stuff like that. They are all compiled in a format that I don't know.
And finally, there is only diffuse texture (which may have remappable in the alpha layer as Kenobi explained), the damaged stage 1 'd' texture and damage stage 2 'd1' texture.
The damage effect is done with dodge tools from photoshop or stuff like that. It just makes random regions a lot darker. I guess it is easy to program this thing.
How do people use specular maps or bump map effects in Generals? QUICK_EDIT
Its nice to see how Banshee ignored my post completely.
The shaders are just compiled pixel .pso and vertex .vso shaders, written in assembler, nothing special there, just a bit aged as nowadays everyone just packs them in a complete .fxo file. But the game is from 2003, not even shooters had normal maps these days. BfME2 was one of the first RTS using normal mapping.
All alpha in .dds textures is used for transparency. _________________ QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Wed Feb 24, 2010 1:48 pm Post subject:
I didn't ignore your post. You said that Generals does not use normal and relief maps natively. Specular maps required some shading tricks, but what of tricks are that when the shaders are blur, terrain noise, terrain or trees?
Also, there is a contradicting idea in these posts which is confusing me. The alpha layer from textures
Gen.Kenobi wrote:
2) If you open the American Ranger texture zhca_airanger.tga You'll see that the texture has an Alpha Layer. This Alpha is the House Collor that you see ingame at the Ranger. You can do that with any unit, as long as the texture has zhca_*texturename*.tga And an Alpha section
Ju-Jin wrote:
All alpha in .dds textures is used for transparency.
Considering Ju-Jin's post, the remaps must be done in a different way than what Kenobi said, because if the alpha layer is transparency and we have only one texture for diffuse (and other two for damaged diffused state which works in the same way than the diffuse) and RGB is already used for the colours and there are only 4 layers... I'm confused.
And finally, the roadmap for Generals, considering the information placed so far:
-> The program works out each mesh separetely and it does follow the following procedures in the following order:
- Clean up objects inside the volume [Completed]
- Generate planar faces, making it look like cubes [Completed]
- Collect data about remappable faces [Not Done]
- Use image processing techniques to smooth the mesh [Completed]
- Transform the mesh into triangles [Completed]
- [Optional] Do aditional smooth to the mesh [Completed]
- Detect the normals of each face [Completed]
- Convert face normals to vertex normals [Completed]
- Convert face colours to vertex colours [Completed]
- Build a texture atlas using the collected data. [Coded, but not tested]
- Generate 512x512 Diffuse (Colour) Map [Coded but not tested]
- Generate 512x512 Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Heavily Damaged Diffuse (Colour) Map [Not Done]
- Build 9 mipmaps for each diffuse texture [Not Done]
- Save all textures with DXT5 compressed DDS files [Completed]
- Optimize the mesh [Completed, but it is still under tests]
- Save it with the w3d format [Not Coded] QUICK_EDIT
infantry, trees, and terrain use TGAs, everything else uses .DDS.
The standard textures are DXT5, and there are overlay ones for night time which are pretty much used to make it look like someone turned the lights on.
Making housecolor a seperate object could easily be done by hand if need be, either with the voxel or the 3d model. _________________ Please, read the signature rules of the forum. QUICK_EDIT
all zhca_[something].tga are for housecolors. dunno what the z and a stands for but hc = housecolor in most cases ^^ thats what he said in the last sentence you quoted. Afaik it uses the Alpha based on the texture naming.
But yeah, CCG's standard shader seems hardcoded in the .dat - I keep forgetting about that.
For the settings: as far as I remember it is abusing the environment map. In that RenX material editor window you can select a pass 2 texture and how it is computed on the object so you can set it to something that looks a bit like specular light. Just use some black texture with a white dot or streak on it, set it to additive and there was some other settings that it gets positioned based on the viewer (imo the result is very crappy compared to a real specular map) _________________ QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Thu Feb 25, 2010 5:05 am Post subject:
So, excuse if I'm being dumb, but let me try to understand exactly what we have in each texture:
{NameOfUnit}.dds --> Diffuse map for the unit when HP is high:
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
{NameOfUnit}_d.dds --> Diffuse map for the unit when HP is below 50%, but probably higher than 25% (note: percentages doesn't make a difference for me):
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
{NameOfUnit}_d1.dds --> Diffuse map for the unit when HP is below 25%:
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
zhca_{NameOfUnit}.tga --> Hold house colour information
Red -> ???
Green -> ???
Blue -> ???
Alpha -> House Colour
The s ending means snow, so we can have stuff like:
{NameOfUnit}_ds.dds --> Diffuse map for something on snow terrain and damage between 25% and 50%:
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
The n ending, probably means night. So, we can have something like:
{NameOfUnit}_n.dds --> Diffuse map for night time, when the lights are turned on:
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
I don't know what does the e ending mean. Anyway, we can have something like:
{NameOfUnit}_e.dds --> Diffuse map for something I couldn't figure out in temperate terrain
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
The g ending means garrisoned. So, we can have something like:
{NameOfBuilding}_g.dds --> Diffuse map for the building when HP is high and it is garrisoned:
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
The r ending is unknown. Perhaps it is related to radiation, but it's a wild guess.
{NameOfUnit}_r.dds --> Diffuse map for the unit when HP is high and it is... under the influence of radiation?
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
The l ending, I've seen in only one thing and it made it increase the resolution of the texture.
And there is this zb and zt prefixes:
zb{NameOfSomething}.dds --> No clue, but probably diffuse texture as well
Red -> Red
Green -> Green
Blue -> Blue
Alpha -> Transparency
Can you guys correct me with these things? QUICK_EDIT
Units use different models based off of their condition state. So when a unit is damaged, it uses a different model. So damaged textures are no different than normal textures as far as I can tell. _________________ Please, read the signature rules of the forum. QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sat Feb 27, 2010 5:26 am Post subject:
And how does the program chooses between using zhca_ textures and the traditional diffuse maps? If the unit is owned by some factions, does it use zhca_? QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Fri Jun 25, 2010 12:36 am Post subject:
Hey guys, I'm bumping this topic just to say that I'm still working on it. Here's my progress:
- Clean up objects inside the volume [Completed]
- Generate planar faces, making it look like cubes [Completed]
- Collect data about remappable faces [Not Done]
- Use image processing techniques to smooth the mesh [Completed]
- Transform the mesh into triangles [Completed]
- [Optional] Do aditional smooth to the mesh [Completed]
- Detect the normals of each face [Completed]
- Convert face normals to vertex normals [Completed]
- Convert face colours to vertex colours [Completed]
- Build a texture atlas using the collected data. [Completed]
- Generate 512x512 Diffuse (Colour) Map [Completed]
- Generate 512x512 Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Heavily Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Snow Diffuse (Colour) Map [Not Done]
- Generate 512x512 Snow Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Snow Heavily Damaged Diffuse (Colour) Map [Not Done]
- Build 9 mipmaps for each diffuse texture [Not Done]
- Save all textures with DXT5 compressed DDS files [Completed]
- Optimize the mesh [Working, but it still needs a couple of bug fixes]
- Save it with the w3d format [Not Coded]
Extracting the texture atlas was a hard job, but it is working fine for over a month already. I'm stuck with the mesh optimization. I've got several improvements, but it still screws up the textures occasionally. Once I'm done with it, the other tasks will be done quicker. QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sun Jan 02, 2011 3:01 pm Post subject:
Hey guys, I'm once again bumping it to post my progress so far:
- Clean up objects inside the volume [Completed]
- Generate planar faces, making it look like cubes [Completed]
- Collect data about remappable faces [Not Done]
- Use image processing techniques to smooth the mesh [Completed]
- Transform the mesh into triangles [Completed]
- [Optional] Do aditional smooth to the mesh [Completed]
- Detect the normals of each face [Completed]
- Convert face normals to vertex normals [Completed]
- Convert face colours to vertex colours [Completed]
- Build a texture atlas using the collected data. [Completed]
- Generate 512x512 Diffuse (Colour) Map [Completed]
- Generate 512x512 Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Heavily Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Snow Diffuse (Colour) Map [Not Done]
- Generate 512x512 Snow Damaged Diffuse (Colour) Map [Not Done]
- Generate 512x512 Snow Heavily Damaged Diffuse (Colour) Map [Not Done]
- Build 9 mipmaps for each diffuse texture [Completed]
- Save all textures with DXT5 compressed DDS files [Completed]
- Optimize the mesh [Working, but it still needs a couple of bug fixes]
- Save it with the w3d format [Not Coded]
And also, the quality of the normals in the model improved a lot in december. Most of the progress that happened on the last 6 months were the normals, mipmaps... and things that are not related to Generals, such as bump mapping (which is still not supported by VXLSE III, but it will be fixed soon).
And finally, I'll make it export .collada before .w3d. QUICK_EDIT
the only textures with zhca_ are infantry textures and a few subfaction logos (which I think are only superimposes on other models). All vehicles use the .dds format, not the .tga (all zhca_ textures are in .tga).
Remapables should be their own objects, as should the chassis, treads, wheels, turrets, and barrels. Another important part of the process is bones, and I don't know if you want to work that logic into the voxel editor, maybe with the addition of special voxels that you can name? _________________ Please, read the signature rules of the forum. QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sun Jan 02, 2011 5:29 pm Post subject:
Hmmmm... yea, bones will be a tough subject. But, at some point, I'll probably figure out a way to make it done automatically, as long as it receives few parameters. QUICK_EDIT
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 You cannot attach files in this forum You can download files in this forum