GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

autobillboard size on imposters does not save #1941

Open ghost opened 7 years ago

ghost commented 7 years ago

When you setup autobillboard size in the shape editor for trees like this. %this.addImposter("32", "6", "0", "0", "128", "1", "0"); The "size" (first number) of the billboard level determines how much buffer zone there is until it pops to the imposters. So for example if your imposter level is 128 pixel and you have 32 imposter size then it will start to fade at 160 pixel and on 128 pixels it is fully faded out. It works when you set it up in shape editor and then test it, but the problem is that after you saved it and load another level it no longer works, there will be no fade and they all will just pop instantly. Even if you set your imposter fade level to something, the imposter detail level will show 0 polys the next time you open your shape, it works though in the game, but it does not show, if you then set your imposter size again and save it will work again, but will be lost when you quit and load the level again.

It does not happen with the defaulttree because that setting is set in the model file using a node called: "bb__autobillboard25" this will set this setting in the engine directly. When you set it in the shape editor it will create a yourtreename.cs file that determines extra options on load, the file will be read correctly it seems, because you can see that it sets the imposter size you set in it in the shape editor, but it does not work in the actual game then.

ghost commented 7 years ago

Hm I really don't know what bbautobillboard25 is supposed to mean anyway, since there is no reference in the engine for it. Those are the only I could find https://github.com/GarageGames/Torque3D/blob/development/Engine/source/ts/tsShape.h#L269-L274 There is nothing there to determine the autobillboard "size" or whatever it is, but somehow the use of "bbautobillboard25" makes it work. Setting up LOD levels and imposters in shape editor works, except that one feature that activates the fizzle fade.

ghost commented 7 years ago

In the pacific demo in the canopy tree they used "BB__detail1" and it still works with a fizzle fade, so this confuses me now a bit, since it seems that you just need to add a node in your model balled BB_randomnumber and it works?! I just tested it and the number does not seem to have anything to do with the fizzle fade. The levels on the canopy are 700 200 and on 350 it starts to fade and on 200 the imposterization is completed, independend from the number I enter as "size".

ghost commented 7 years ago

The size of the fade seems to be dependend on the previous LOD level size and it seems to be one third of the value mines the next value so: 700 - 200 = 500 and one third of 500 is 150 and that is exactly the time it fades away. So fade begins at 350 and is done at 200 pixels.

ghost commented 7 years ago

In this thread he also suggests to use the shape editor to find good values and then set it manually in the model file. https://www.garagegames.com/community/forums/viewthread/111441 I find this is not an optimal workflow, especially as most of the features work now in the shape editor, except the fading stuff.