About Store Forum Documentation Contact



Post Reply 
Tree billboard generation
Author Message
Demostenes2 Offline
Member

Post: #1
Tree billboard generation
Hello,

When I am generating billboard for tree from test blend leaf material, it behaves like this:

http://forum.mymmo.cz/demo/alfates.jpg and it results into:

http://forum.mymmo.cz/demo/normal2.jpg

I can render billboard with leaf shader and then swith tree to test+blend leaf, but it quite spoils visual quality:

http://forum.mymmo.cz/demo/normal.jpg

Other problem is, when bilboard is rendered with test+blend shader, whole tree, especially bark is quite transparent (leaf vs test+blend leaf):

http://forum.mymmo.cz/demo/tree3.jpg

I dont know what is going inside of engine, so I dont know if this is how it was meant to be. Or am I doing something wrong?

Thanks.
(This post was last modified: 12-11-2011 05:03 PM by Demostenes2.)
12-11-2011 05:17 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Tree billboard generation
can you send me the original model plus generated billboard (with unmodified material parameters) files? (to PM or email)
I'll check them
thanks
12-12-2011 09:52 PM
Find all posts by this user Quote this message in a reply
Demostenes Offline
Banned

Post: #3
RE: Tree billboard generation
I ve just made simple experiment in editor. I ve put hundreds of trees into scene (and set camera to see the biggest number possible). First I put billboards (2 quads) on distance 400. Each tree is quite heavy - 2441 tris, so performance was quite bad, as expected.
Then I changed billborand distance to 40. What happened? Performance difference was almost zero, cca 1,5% gain. This is very wierd, I would expect far bigger gain.

When building the scene, there was far bigger gain (framerate was 50-100% better). Anyway AFAIK building is doing no optimizations for trees, why billboarding in editor has almost no effect?
If it had, it would be significant performance boost for editor.

And one question just from curiosity. I tried to optimize test+blended textures. I took one 1024*512 texture, where leaf was occuping only lower 512*512 space (rest was something unused in scene). So I cut it away and used only that 512*512 part. But there was zero performance gain, even after build (I used same scene with hundreds, maybe thousands of trees). So what does it mean? There is already some optimization based on UvMapping? Normally I would expect some gain, because there is far less pixels to test/blend.
(This post was last modified: 12-26-2011 08:29 PM by Demostenes.)
12-26-2011 08:19 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: Tree billboard generation
I've tested your model again, please open up the tree trunk material in material editor, and press "A" button to display the alpha channel of the texture.
You will notice that the trunk has transparent alpha channel which is causing your issue.
Your alpha channel texture is incorrect.

Also for next SDK I will make the generated billboard to be brighter (now it's incorrectly a little too dark)
01-05-2012 10:53 PM
Find all posts by this user Quote this message in a reply
Demostenes Offline
Banned

Post: #5
RE: Tree billboard generation
(01-05-2012 10:53 PM)Esenthel Wrote:  I've tested your model again, please open up the tree trunk material in material editor, and press "A" button to display the alpha channel of the texture.
You will notice that the trunk has transparent alpha channel which is causing your issue.
Your alpha channel texture is incorrect.

Also for next SDK I will make the generated billboard to be brighter (now it's incorrectly a little too dark)

Thanks! Maybe it is stupid question, but what should alfa channel contain to successfuly generate billboard? I ve tried several possibilites (empty alfa channel, some mask, etc...), but it seems to have no effect.

Do you have any sample texture, how it should look, how should look alfa for bark and for leaves?

And I have other question regarding performance, it is impossible to have material for leaves just diffuse and for bark with bump + nm, if I am using one texture for bark and leaves (atlas). When material is set it for bark it destroys leaves and opposite. It makes sense, because of how is EE grouping textures and how it generates GFX files. So it seems, that I have to use bump + nm even for leaves.
I dont know how to solve this problem, because having two separate textures for this is wasting (in case of vegetation I have to really really optimize) and having bump + nm for leaves is in most cases wasting too.

Or I can ask other way, how you intented to properly use leave shader? Use it for both bark and leaves and prevent blending of bark by alfa?
Anyway I will do some test, if having whole tree in one material/drawcall compensates more heavier shader (because of bark I need to have nm + bump).
(This post was last modified: 01-06-2012 09:23 AM by Demostenes.)
01-06-2012 02:06 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: Tree billboard generation
the alpha channel for the bark should be fully white (opaque)

you can set bump+roughness material parameters for leaves to zero, to disable normal/parallax shaders (this will have very small impact on performace)
01-09-2012 05:42 PM
Find all posts by this user Quote this message in a reply
Post Reply