afs Advanced Foliage Package [released]

Version 2.0 now available

Including the latest version of the advanced foliage shader v. 2.02 bringing multi touch bending and advanced ground lighting Find out more!

Watch the package in action!
http://bit.ly/LlRwvU (Demo of v1.0)

Get it here:

Simply paint your plants on top of the terrain or any arbitrary geometry
Make sure you get the free “Geometry Brush AFS” tool: a very nice and handy tool that will help you to manually place any game object onto any terrain or geometry – originally posted by Matt McDonald, Owner, Chief Creative Officer and President of Heavy Water, www.heavyh2o.com, but optimized for the use with the advanced terrain shaders.
http://dl.dropboxusercontent.com/u/2322017/GeometryBrushAFS.v1.unitypackage

Main Features
The package will bring advanced foliage to your terrains supporting wind, bump mapping, specular lighting, translucency and ambient occlusion

• Use all the features mentioned above on any model – be it placed within the terrain engine or as a single game object.
• Take advantage of batching, occlusion culling and even mesh combining to get the best performance for your game.
• Includes version 2.02 of the afs Advanced foliage shaders which enhance the rendering of your foliage and grass.
• Demo terrain (without trees…) is included showing how to get the best out of the models and shaders.
• Full documentation on the shaders, how to set up your own models and how to speed up rendering is included.

New in version 2.0
• Improved normal maps
• Minor fixes on the vertex colors

Your demo is pretty nice but cut back on the bloom. :slight_smile:

I feel like it has too much exposure which is washing out the colors but that’s just me.

Good work!

Good work man

thanks a lot.
and i will have a look at the bloom if i get some time… :wink:

lars

Released!

hmm – any comments on the package?

lars

The framerate looks to be a concern. 10fps on such a small scene, is this correct?

this support SM2?

the framerate depends on your hardware – mine is pretty weak and the package was designed to be used on rather fast mashines.
anyway: have a look at all other specs like number of draw calls, tris and vertices and the vram usage – then you will see that all those numbers are quite moderate which should give you a decent framerate on modern hardware.

or just have a look at the demo to see how it performes on your computer: http://bit.ly/LlRwvU

lars

i guess it should – as i haven’t assigned any “#pragma target 3.0”

lars

I just bought this package and its great, but it looks like there is a white stripe down the stem of the nettle plant. Any idea what setting might need adjusting to fix this. The “CombineChildren” script didn’t import because it conflicted with existing unity sources. I decided to just ignore it and it mostly works. I will just not use the nettle plant for now, but it would be nice to get it working. The rest of the package is great though!

Very nice package. Runs a little poorly on my Win7 PC, but hopefully I’ll get better performance on my Mac. Maybe cut down on the bloom effect, or add an option to change it? Also, are you using SSAO?

thanks mark, but i can’t find the white stripe you talk about… it should be a texture problem, but my texture looks alright and so does the rendering of both nettle prefabs.

lars

Hey,

I just purchased this package a few moments ago, upon attempting to setup some meshes with the new shader i get this which looks terrible and i cannot change the color at all. Any idea why?

http://legacyonlineentertainment.com/GameImages/Unity 2012-07-11 11-51-36-53.jpg
!(http://legacyonlineentertainment.com/GameImages/Unity 2012-07-11 11-51-36-53.jpg)

any reason why it would cause those plants to look extremely bright like that? as i said we dont have access to any color properties so i cannot change it O.o

Nice, looks good

hi Legacy,
i am sorry that the package does not do what you would expect, but i am pretty sure that it exactly does what it was made for.
please not: the advanced foliage shader needs carefully adjusted models with vertex colors assigned which control the bending and a special setup of the used texture-atlas. you will find further information in the documentation: http://bit.ly/JkLwD1.

in case you want to use the shader within the terrain engine you will loose the built in “Hidden/TerrainEngine/Details/Vertexlit” shader or any hack of it as the “advancedFoliageShader for Terrainengine.shader” just overwrites it.
next to that you will have to create a texture atlas including all meshes you would like to use within the terrain engine and map your models to this atlas. but using a manually generated atlas won’t let you use any grass rendered as billboard or simple texture, as adding this kind of grass would add a second texture to the internal texture atlas of the terrain engine and corrupt the texture lookup within the manually setup atlas.

in case you do not want to use the shader within the terrain engine but only on manually added plants just rename the shader “advancedFoliageShader for Terrainengine.shader” to “advancedFoliageShader for Terrainengine.__shader” so it will not get compiled.

As far as colors are concerned: all models should share the same material. this is the reason why you can’t change the color on any individual plant/model. colors assigned in the “edit detail mesh”-dialog of the terrain engine are used to control bending as they are added to the manually assigned vertex colors of your models by the terrain engine. but there is one exclusion which is red/vertex color red which controls the bending phase and also adds different shades of the main texture in the surf function of the shaders which might lead to very bright results:

 o.Albedo = c.rgb * IN.color.a * (IN.color.r + 0.6);

if you do not want this just replace the line by:

 o.Albedo = c.rgb;

but the brightness you have mentioned just could be caused by the fact that the shaders support specular lighting… and to be honest: assuming that the 2 plants next to your character are some kind of “agave” they look pretty cool to me and much better than all other plants.

i hope this helps. otherwise do not stop to ask,

lars

btw: your scene looks pretty cool. i hope we will see a webplayer soon…

Update
Bugfix in order to make foliage placed within the terrain engine bend correctly on windows.

Strange…the shaders work fine inside the “Play Mode” but when I build the game it doesn’t work…any ideas?

Looks realistic and beautiful !