Jump to content
Official BF Editor Forums
Sign in to follow this  
[BF:A] Croupier

Vegitation info.

Recommended Posts

This is not a tutorial on how to model vegitation, this is more of a information sheet. I have not created any vegitation but I have dissected the workings for you.

For feature static veg you have alot of room to play with the polys have a look at this baby:

Oak.jpg

You can see that the poly count culling for lod1 is quite dramatic, dropping to 600.

I get the feeling that veg use's a slightly different lod switching method than regular statics, but evidence to suggest this apart from the fact that they have a specific _lod mesh for each item, every one of them has it from the tree stump to the flower pot to the dead tree.

The _lod mesh for the Oak tree is puny at 90 polys.

Here's an example with the bamboo cluster:

bamboo.jpg

bamboo_lod.jpg

Also another major difference is collision mesh's. The collision mesh is its own object and has its own .con and tweak. After a bit more digging I have come to the conclusion that this seperate collison may have something to do with overgrowth and the way that the collison mesh's coordinates are set in the OvergrowthCollision.con in your map.

In most instance's the collision mesh can be very basic especially for something like the bambo clump that you cannot walk through, thats pretty much just a box, here's the oak tree col's:

Oak_col2.jpg

The physics, soldier and AI mesh are the same, but you could model each one different if you wanted.

Oak_col1.jpg

Export your collision mesh as you normally would with your main object not the _lod object, then you will need to manually create the .con, the tweak most likely can be done in the editor. Here's an example of the con and tweak. I am pretty sure that you will need the _col naming for the objects files ie: nc_oak01_col (same applies to the _lod, the game engine must recognise these extensions much like the texture suffix)

.con

GeometryTemplate.create StaticMesh nc_oak01



CollisionManager.createTemplate nc_oak01







ObjectTemplate.create SimpleObject nc_oak01



ObjectTemplate.saveInSeparateFile 1



ObjectTemplate.creator JLU-1:jlu



ObjectTemplate.collisionMesh nc_oak01



ObjectTemplate.mapMaterial 0 wood_col 0



ObjectTemplate.mapMaterial 1 leaf_col 0



ObjectTemplate.hasCollisionPhysics 1



ObjectTemplate.physicsType 3



ObjectTemplate.geometry nc_oak01



ObjectTemplate.anchor 1.2409/-6.8375/-1.0090







include nc_oak01.tweak

.tweak

rem *** Generated with Bf2Editor.exe [created: 2005/4/10 10:26]



GeometryTemplate.setSubGeometryLodDistance 0 0 1000



GeometryTemplate.doNotGenerateLightmaps 0



GeometryTemplate.lightmapOverride 0



GeometryTemplate.compressVertexData 1



GeometryTemplate.maxTextureRepeat 16



ObjectTemplate.activeSafe SimpleObject nc_oak01



ObjectTemplate.creator JLU-1:jlu



ObjectTemplate.modifiedByUser jlu



ObjectTemplate.saveInSeparateFile 1



ObjectTemplate.geometry nc_oak01



ObjectTemplate.setCollisionMesh nc_oak01



ObjectTemplate.mapMaterial 0 wood_col 93



ObjectTemplate.mapMaterial 1 leaf_col 16



ObjectTemplate.hasMobilePhysics 0



ObjectTemplate.hasCollisionPhysics 1



ObjectTemplate.physicsType Mesh

The last thing we need to know is the material setup, I posted some code in a earlier thread, but what the heck, here's the setup for the oak tree.

// FILE: C:Documents and SettingsCroupierDesktopBF2 MATERIALSnc_oak01.staticmesh







geom0



lod0







 Shader: StaticMesh.fx



 Technique: Base



 Type: 2



  Texture: objects/vegitation/asia/textures/leaf_ncoak01_mix_de.dds



  Texture: CommonTexturesSpecularLUT_pow36.dds







 Shader: StaticMesh.fx



 Technique: BaseDetailNDetail



 Type: 0



  Texture: objects/vegitation/asia/textures/nccolor.dds



  Texture: objects/vegitation/asia/textures/tile_ncbark01de.dds



  Texture: objects/vegitation/asia/textures/tile_ncbark01deb.dds



  Texture: CommonTexturesSpecularLUT_pow36.dds







lod1







 Shader: StaticMesh.fx



 Technique: BaseDetailNDetail



 Type: 0



  Texture: objects/vegitation/asia/textures/nccolor.dds



  Texture: objects/vegitation/asia/textures/tile_ncbark01de.dds



  Texture: objects/vegitation/asia/textures/tile_ncbark01deb.dds



  Texture: CommonTexturesSpecularLUT_pow36.dds







 Shader: StaticMesh.fx



 Technique: Base



 Type: 2



  Texture: objects/vegitation/asia/textures/leaf_ncoak01de_le.dds

So you can see that it only uses a color, and detail + detail bump, pretty easy. You can also see how it's leaf's use's a base technique or the color slot for its leaf texture, this is because the base slot translates alpha as transparency unlike if its used say in the detail slot. And we all know how important alpha is in vegitation. :)

leafalpha.jpg

Hope you find this information usefull.

Please feel free to add info, ask questions or correct any error's or miss information if detected. (except spelling or gramatical error's please, I hate the spelling police's, this is afterall the internet and not a piece of literary art, K)

Cheer's

Croupier..... :)

Share this post


Link to post
Share on other sites

We have a very clever script writer on our team by the name of Freeze, whom has made it as easy as a click. You could also import using Rex's 3ds max tools BF2 lightmapping.

Check my post HERE for more info.

PS: down the bottom of that thread BEEX has supplied a link to a page where you can download some similar tools to what Freeze has made.

Share this post


Link to post
Share on other sites

Good god those trees are nearly 3000 Tri's!?

my treees are hovering between 250-400, granted it looks a bit more primitive but I dont think it looks like one tenth the detail IMHO

tree22dy.jpg

tree35ra.jpg

I keep finding bf2's efficiency a bit suspect lacking detail in some areas and indulging in polygons in others.

Share this post


Link to post
Share on other sites

You'll also notice that they cut out the shapes of the leaf branches. Although this adds triangles, today's video cards are more than capable of handling them, and I would think DICE made a decision to reduce alpha bit comparisons since they're still really expensive, at the cost of increased vertex count.

For instance, if you look at your wireframe of your tree, that's a lot of negative space, and unnecessary alpha comparisons. The engine may perform better with reduced alpha comparisons.

But other than that, I like your tree too.

Share this post


Link to post
Share on other sites

Croupier, is there any chance that you can post a picture of the _lod mesh for nc_oak01? I have a hunch that the _lod mesh may be used as a "vector field" to describe what parts of the tree are labeled as "swayable", or do you think it that is determined by the texture?

Share this post


Link to post
Share on other sites

I am begining to belive that is is a combination of the nc_ file naming and the Type 2 alpha leafy veg texture that is applied to the planes, possibly also the collison material assigned to the leaves (16 Bushes_leaves).

I did a test where I renamed the tree by removing all instances of the nc_ the tree's leaves stopped moving.

I have a feeling though that it is a combination of these thing's.

what parts of the tree are labeled as "swayable", or do you think it that is determined by the texture?

The only real labeling difference is with the assigned material's:

The trunk gets Tree_trunk 93

The leaves get Bushes_leaves 16

Share this post


Link to post
Share on other sites

Is there any way somebody could write a small tut on Overgrowth vegetation? I've got it exporting a nc_yourvegiehere.staticmesh and a nc_yourgeggiehere_col.staticmesh but I dont know how to create the nc_yourvegiehere_lod.staticmesh. Ive got a lod1 set as a child of the geom0 but it doesnt create the staticmesh for it? Also my materials seem to not be exporting correctly. The whole tree sways as apposed to just the leafs and all of the textures are VERY contrasty (really bright where the sun hits them and really dark where the sun doesnt hit them). Or if somebody would be willing to help me through this I will write up a step by step tutorial on setting upexporting vegitation myself. Either PM me or add me to MSN if you are willing to help.

Thanks!

Ship (markus_brutus@hotmail.com)

Share this post


Link to post
Share on other sites
I've got it exporting a nc_yourvegiehere.staticmesh and a nc_yourgeggiehere_col.staticmesh but I dont know how to create the nc_yourvegiehere_lod.staticmesh.

Ive got a lod1 set as a child of the geom0 but it doesnt create the staticmesh for it? Also my materials seem to not be exporting correctly.

You have to have a completely new heriachy for the _lod geometry, consider it a seperate model.

The hierachy is simple.

-root_staticMesh_your_plant_lod

--geom0

---lod0

----your_plant_lod

You said you were having texture contrast problems? make sure you set the type to 2 for the leaf. The trick is to get your material file looking exactly like the one below. You can see it's a base technique type 2 for the leafs and base type 0 for the trunk.

Here's the material file for the lod geom for the oak may be also helpful.

MATERIAL

// FILE: C:Documents and SettingsCroupierDesktopBF2 MATERIALSnc_oak01_lod.staticmesh

geom0

lod0

Shader: StaticMesh.fx

Technique: Base

Type: 2

Texture: objects/vegitation/asia/textures/leaf_nc_oakde_lod.dds

Texture: CommonTexturesSpecularLUT_pow36.dds

Shader: StaticMesh.fx

Technique: Base

Type: 0

Texture: objects/vegitation/asia/textures/tile_ncbark01de_lod.dds

Texture: CommonTexturesSpecularLUT_pow36.dds

Share this post


Link to post
Share on other sites

So for the _lod mesh I create a new heirarchy and export it and move the meshs and .con files to the folder with the other meshs?

I've got it set up exactly like that except that. In max I'm using 4 shader balls. The First one has my Trunks texture on it and is a bf2staticmesh shader and is applied only to the trunk on the visible mesh. The second one is my leafs texture and is a bf2staticmesh shader and is applied to the leafs only. The 3rd is a standard blinn wireframe named wood_col that is applied to all 3 col's trunks and the 4th one is a standard blinn wireframe named leaf_col that is applied to all 3 of the col's leaf sections.. Is this correct for export? Do the col's need to have uvmodfiers? Should they not have them? If somebody would like to take a look at my scene I would be more than happy to send it to them. Theres gottta be something simple that I'm missing. Thanks guys!

Ship

Share this post


Link to post
Share on other sites

Check in the channel info for not only additional map channels, but also for dead verts. The game doesn't like those. Not unwrapping your col's will probably flag those. Go ahead and unwrap all your col's just to remove that variable. I just apply a new unwrap and flatten and collapse and it's done. If you do get dead verts, search "dead verts". I mentioned a fix before.

Share this post


Link to post
Share on other sites
Check in the channel info for not only additional map channels, but also for dead verts. The game doesn't like those. Not unwrapping your col's will probably flag those. Go ahead and unwrap all your col's just to remove that variable. I just apply a new unwrap and flatten and collapse and it's done. If you do get dead verts, search "dead verts". I mentioned a fix before.

Sorry. I should have been more specific. :) The col's do have unwraps, but as mentioned before there is no texture assigned to them as they are just standard shaders with wireframe applied to them. Does anybody have a scene for their tree that they have exported that I could take a look at? I have a few really nice looking trees that I want to get in game properly and im really bangin my hea don this one.

Thanks!

Ship

Edit. Here is a pic of the tree in editor. The one on the left is imported as a STATIC object. The one on the right is imported as vegitation. You can see how the static one looks ok and the vegitation one is very dark at places and you can see a bit that is is "swaying" as the trunk is more bent than the other one. Oh. And dont mind the skins on the trees in the background as they arent even unwrapped yet. They simply have a uvmidifier added and a tepm texture applied to them for testing until I get the veg exporting correctly.

trees.jpg

Share this post


Link to post
Share on other sites

Just a guess, but since you imported teh tree as veg then it has seperate lighting values in the levels Lighting tweak. I'd chack that since veg and statics are assigned there own lighting.

Share this post


Link to post
Share on other sites

Thanks for the encouragement guys, now that my gun snafu is over with I can get back to making more vegitation. I create all my textures from scratch bf2's veg especialy looks a bit toonish to me.

good point about the alpha comparisons I should trim the corners of the planes, I already refined the shape of the trunk and branches since I now know I can easily afford to.

I'm realy curious about certain aspects of the engines efficiency like do the weapons polygons share the same pool of resources as the world static meshes? is there any crossover of shared resources between texture load and poly count? Sooo many questions....

Here's a pic of the tiled trunk texture, very easy to make, I realy encourage everybody to try their hand at custom textures too.

tree49ru.jpg

also when somebody figures out the whole vegitation thing please share I'm eager to know too.

Share this post


Link to post
Share on other sites
LexLuther]Just a guess, but since you imported teh tree as veg then it has seperate lighting values in the levels Lighting tweak.  I'd chack that since veg and statics are assigned there own lighting.

Good Guess, but no.

Share this post


Link to post
Share on other sites

Shipwreck, do you want to send me the files for the palm in that earlier pic, I'll take a look and see if I can get it looking ok, don't worry about us using the model, in BF:A there aint no palm's, well live one's anyways.

Share this post


Link to post
Share on other sites
Croupier]Shipwreck, do you want to send me the files for the palm in that earlier pic, I'll take a look and see if I can get it looking ok, don't worry about us using the model, in BF:A there aint no palm's, well live one's anyways.

Yeah. I'll send them to ya. If you can fix this prob, you can use whatever Veg I make if you can help me out. Add me to MSN if you can or PM me with info on where to send the veg. Thanks a ton dude!!

Ship

Share this post


Link to post
Share on other sites

LOL! After workin on this for weeks and banging my head on the desk I finally get a very generous offer of help from Croupier and not 3 hours after I send him the files to look at I figured the problem out. :( When exporting OVERGROWTH you must use 3 textures. First of all you need to select the polygonsfaces on the visible mesh that you want to be the wood part and apply a BASE texture and a DETAIL texture and thats it. Now selct the poliesfaces on the visible mesh that you want to be leaves(swaying part) and apply only a BASE texture. Now do the same for your col's assigning different materials to the leaves and the wood.

Share this post


Link to post
Share on other sites

Woo, Hoo, glad to hear that you have it sorted, I had a feeling it would be something simple, now where would we be without the bf2Materials.exe, I'm guessing after another look at a DICE material file it jumped out of the screen and slapped you in the face, lol......

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×