|
Strana 1 z 2
Currently, we're finalizing trees and bushes for ARMA2. The biggest problem with vegetation is impact on game performance, so we develop a lot of new techniques on the side of the engine and on the side of LindaStudio as well. We make very deep analysis of performance problems in Armed assault and we find, that the main problem is overdraw in the first 20 meters of the scene. So it means, we needed to optimize the overall surface of trees and bushes and develop some more effective shaders and drawing techniques in the engine to reduce these aspects. So what did we do?
New trees can use a more accurate representation of "polyplanes" (geometry for replacing hires branches) this reduces the overall surface by about 30%, but increases the amount of vertices. We teach the engine to use double-sided faces to reduce this increase of vertices on vegetation models.
New shaders
The original trees used shaders that use texture, normal map and two maps for diffuse and ambient attenuation, that means four stages. Now we use a special tree shader with texture, normal map and macro map. This macro map has colorization information in the alpha channel as well as in RGB ambient lightmap. This solution gives to the artist a better overall control on a tree's look and saves one stage, that makes this shader faster and the trees are better looking then previous ones. We also developed a shader using a technique known as "pre-computed radiance transfer", that we want to use for far vegetation lods (this technique needs just two stages). All these new things required changes in LindaStudio. For example to have the possibility to generate multiple UVs on trees, export to formats that will allow render lightmaps in 3th party graphic software etc.
Changes in engine
The ArmA2 engine is able to use a method known as Z-priming, all vegetation is very quickly drawn with a simple shader as mask with transparency and the second step is to draw only non-masked pixels with a complex tree shader, this helps a lot to reduce overdraw and allows us to use more complex shaders in the future because it decreases performance dependency on shader complexity and model surface.
From measuring we learn that sometimes it's better to use hi-poly trees with the smallest surface, then use lods with a small amount of face but with a bigger surface. We develop tools to measure these parameters in Linda and allow the generation lods of vegetation to reflect these aspects.
Also new models of vegetation use a better algorithm for optimal using of vertices in plant structure, to reduce the performance impact on vertex shaders.
Visual aspect of vegetation
Armed assault used generated trees based on scripts version 1.5 (OFP elite used 1.0). ARMA2 uses the 4th generation of scripts, that allows us to generate much more realistic branching, more effective geometry representation (with ArmA it was not possible ho have life-size trees due to the performance impact), root system, correct leaf colorization, solitary branching with real like density, most of the control over trees is now based on real botanical aspects.
So, the last things for ARMA2, that's waiting for us is the automatic generation of special geometry, such as collision, view and fire geometry. This was always made manually and meant that often it was not precise enough for shooting, or the AI were able to spot you through vegetation. I hope that this last thing will be solved soon in a few weeks.
Clutter (grass surfaces)
From lessons that we learned about the performance impact of trees, we developed a new way of making a grass model that is more effective for drawing than in Armed Assault but looks much denser and better visually. This is also based on the knowledge that in the first lods we must target on surface reduction and in far lods on vertex reduction, because far lods are drawn with a very limited amount of pixels.
There is also a nice change in the engine, where we can now particularly colorize vegetation clutters by satellite map, this allows us to produce non-repetitive surface with a more realistic look that naturally fits to the landscape (see results in the picture at the top of this article).
Future

Click here for high-res screenshot (730Kb)
The immediate future will see us finalizing all key needed models and "tree" technology for ARMA2. After that, we will work on general polyplanes. That means, polyplane could be any king of geometry or model, controlled by O2 script. This will again help a lot to reduce the surface of trees, also it will give us better tree shape and less visible lod switching. This technique will also give us the possibility to have blossoms, fruits or other special geometry on trees. We'll also continue with geometry optimization, and making better control over tree growing.
Also it will be very important to have a more open pipeline for tree texture rendering, to allow render translucency, lightmaps and precomputed radiance transfer maps directly in LindaStudio. Development of a system for automatic generation of special lods is the first step towards a more general system that will one day allow tree skeleton creation and also a future system for physical interaction with vegetation.
Čtenáři napsali 12 komentářů. No.12 Question
Will we see the grass when viewing long distance using binocs or scopes? No.11 Re: polys
I just notice the tree has nearly 15000 polys:) I wonder how much polys there is in a forest then:P ![[smiley=think]](http://www.bistudio.com/components/com_jreactions/custom/templates/balloon/smileys/smiley_think.gif) — BerghoffIt difficult to say, after optimalisation best lod have around 10000 faces and 4 lods to 12 faces. Most of trees that you see in forest are in far lods. it will be hundret thousands of faces. No.10 cool
![[smiley=happy]](http://www.bistudio.com/components/com_jreactions/custom/templates/balloon/smileys/smiley_happy.gif) very good job, keep it up... No.9 polys
I just notice the tree has nearly 15000 polys:) I wonder how much polys there is in a forest then:P ![[smiley=think]](http://www.bistudio.com/components/com_jreactions/custom/templates/balloon/smileys/smiley_think.gif) No.8 Re: although..
Yes, we develop new shader called multimaterial, you can imagine it like shader for layer merging. This shader alow as to use more repetitive textures with good visual result. So we can save with this technique some video memory, hopefully this will help to reduce texture popping in urban areas. No.7 Offtopic about ArmA2
What about "object filtering glasses" (OFP bug)? Will it be possible to "merge" magazines, for example - to resupply MP5 with ammo taken from M9 magazines? Or cut several rounds from PK belt and fire them off with SVD? Also - will heavy gear affect soldier's performance? No.6 Don't forget zoom
Sweet work guys! I hope this will fix the huge slowdown we get when going into zoom on a gun in ArmA. No.5 although..
just one question. are you developing/implementing any new tech for urban environments too? something to stop Arma's LOD texture popping would be awesome :) No.4 Great stuff!
another great little blog. new terrain is one of the things making me excited for arma2. seems like the rendering distance for grass has increase lots. keep it up! No.3 Simply Amazing
One more for the ArmA2 Team! Magnificent! It looks very very well, and as I read; you're not even done yet! :-)
|