Graviteam

English-speaking community => Steel Fury: Kharkov 1942 => Topic started by: Kyth on September 04, 2012, 04:23:54 AM



Title: 3 LOD's
Post by: Kyth on September 04, 2012, 04:23:54 AM
Good evening gentlemen,

I'd like to address another pet peeve of mine, namely the absence of 3 LODs in many of the newer tank models. I believe the additional workload on the GPU puts a big cramp on framerates. Some of the worst offenders in this respect are the Soviet multi-turret tanks and German big-cat tanks. Surprisingly, the number of rivets on the Panzer 38t also puts this little tank over the top.  :o

This is a call to arms! Who would like to join me in revising / reworking those models?


Title: Re: 3 LOD's
Post by: Donken on September 04, 2012, 12:46:49 PM
Sign me in Sir!


Title: Re: 3 LOD's
Post by: Littlebro on September 04, 2012, 02:45:31 PM
Great to hear as ive noticed some slow downs in some of my larger battles,also does all the flora have 3 LOD's as ive noticed some difference when using different season mods.


Title: Re: 3 LOD's
Post by: Donken on September 04, 2012, 02:56:32 PM
Great to hear as ive noticed some slow downs in some of my larger battles,also does all the flora have 3 LOD's as ive noticed some difference when using different season mods.

What i have seen grass is using 2 lods, most bigger stuff like tree:s is using 3 lods


Title: Re: 3 LOD's
Post by: frinik on September 04, 2012, 04:42:43 PM
Would love to join but I have no knowledge in such matters so unless somebody can tutor me.....


Title: Re: 3 LOD's
Post by: Kyth on September 07, 2012, 04:19:40 AM
Okay, here's the plan:

We'll work our way down the most popular tanks, which happen to be the heavy tanks (both sides!) This should help the greatest number of players in the shortest amount of time.

Timeline: Indefinite. All I can promise is that something will be done!


Title: Re: 3 LOD's
Post by: frinik on September 07, 2012, 04:07:15 PM
How big is the drag on fps between models with 2 LODs vs those with 3?????


Title: Re: 3 LOD's
Post by: Kyth on September 07, 2012, 04:15:53 PM
How big is the drag on fps between models with 2 LODs vs those with 3?????

No idea, it seems to be an overall effect. However, you could try it out by changing the tech config files, each of them has a line with the number of LOD's, 


Title: Re: 3 LOD's
Post by: Rends on September 07, 2012, 04:41:32 PM
Guess it would be easier to check the LOD switch distances.
Next place let say 30 tanks in the distance of LOD1 in a Test mission. Then in LOD2 and last in LOD3.
Compare the fps of each mission and you have the differences.

But having more than one LOD is not a framerate only thing. More LODs means also less Gpu RAM usage and more stable running missions.


Title: Re: 3 LOD's
Post by: frinik on September 08, 2012, 01:38:44 AM
Actually that was my next question.I have noticed that you can change the LODS but the change is not permanent I assume????Otherwise all we would have to do would be to manually modify the number of LODs and you guys wouldn't have to work on it right???? ;D


Title: Re: 3 LOD's
Post by: Kyth on September 08, 2012, 02:27:01 AM
The LODs are switched based on distance from the viewer. The standard settings in config.engcfg are 25m and 150m. It might be possible to add yet another LOD distance after that, but apparently it isn't used:

Code:
i_scene:scene()
{
//äèñòàíöèÿ ñìåíû îäíîãî óðîâíÿ íà äðóãîé, ì
lod_dist0 = 25.000000;
lod_dist1 = 150.000000;
lod_dist2 = 0.000000;

The 3-D model has to contain those LODs, otherwise the switches wouldn't happen.
 
Also, the tech_cfg files have a line to specify the number of LODs in the model:
Code:
	mesh_lods=	3;

It you have a 'mesh_lod' setting of 1 for a 3-LOD model, the switching doesn't happen. If you try the reverse, a 'mesh_lod' setting of 3 for a 1-LOD model, the mission simply fails to load up.



Title: Re: 3 LOD's
Post by: frinik on September 08, 2012, 07:36:13 AM
OK so what happens if you enter a value for the lod_dist2 for example?Let's say you ascribed a value of 500.000000; and then save the change????

Wasn't there a guy last year who suggested changing the lod distance value for the flora or something????


Title: Re: 3 LOD's
Post by: Kyth on September 08, 2012, 08:23:22 AM
OK so what happens if you enter a value for the lod_dist2 for example?Let's say you ascribed a value of 500.000000; and then save the change????


Say, could you try it out and see what happens?  ;D


Title: Re: 3 LOD's
Post by: murkz on September 08, 2012, 10:51:06 AM
with this setting, not a lot of difference after a quick test (1min)

   lod_dist0   =   250.000000;
   lod_dist1   =   500.000000;
   lod_dist2   =   0.000000;


(http://farm9.staticflickr.com/8029/7954648354_f66e412d1e_b.jpg)

(http://farm9.staticflickr.com/8460/7954580788_e3300ab130_b.jpg)


Title: Re: 3 LOD's
Post by: Kyth on September 08, 2012, 11:20:49 AM
with this setting, not a lot of difference after a quick test (1min)

   lod_dist0   =   250.000000;
   lod_dist1   =   500.000000;
   lod_dist2   =   0.000000;



The tank models in the pictures have only 1 LOD; the lod_dist settings probably won't have any effect on them. The trees and grass are low-poly, so the settings won't produce much of a change.

I think that with the original 3-LOD tanks like the Panzer III, IV, T-34 and KV-1, you might start to see some effect,


Title: Re: 3 LOD's
Post by: frinik on September 08, 2012, 11:28:34 AM
OK did my own test.

I added the value 500.000000 to the lod_dist2 left the default values of 25 and 125to lod_dist0 and 1 and played the 5 October Tiger II Ultimate mission for 10 minutes  before and after making the change.I picked that one because it's got shelling, planes strafing, lots of trees, grey cloudy weather and lots of trees, vehicles, infantry and artillery. I could see a difference; a gain of my be 10% in fps from an average of 24 to 26 and above... I would need to test more to see if it's merely normal fluctuation or a real permanent improvement....

My suggestion is for 4 or 5 of us to make the same changes , test with the same missions and then compare notes to see if there are consistent results or if Murkz' and my own results are just fluke....


Title: Re: 3 LOD's
Post by: Littlebro on September 08, 2012, 12:08:46 PM
Hi ive just tried it my self and i saw an 8%increase.


Title: Re: 3 LOD's
Post by: Littlebro on September 08, 2012, 12:13:09 PM
think i will try these settings in my modded hertzer mission,ive noticed a few slow downs and had a couple of rtd's as its a very intense mission with a lot of added shelling and more russian mixed tank platoons.


Title: Re: 3 LOD's
Post by: Kyth on September 08, 2012, 12:53:31 PM
I'm guessing that with lod_dist2 set at 500, many objects will start disappearing at 500m or greater.
That could account for the slight inprovement in performance,  :D


Title: Re: 3 LOD's
Post by: frinik on September 08, 2012, 02:49:27 PM
MMMMMM if you theory is correct Kyth then the default value which is set at 0.00000000 would mean what?????? That none disappears no matter the distance.....


Title: Re: 3 LOD's
Post by: murkz on September 08, 2012, 03:05:34 PM
are there separate lod settings for trees and grass?


Title: Re: 3 LOD's
Post by: frinik on September 08, 2012, 03:13:07 PM
Y es there is if I remember correctly....


Title: Re: 3 LOD's
Post by: Kyth on September 08, 2012, 03:24:09 PM
MMMMMM if you theory is correct Kyth then the default value which is set at 0.00000000 would mean what??????

Simply that it's not in use. Dont take my word for it, try it yourself,


Title: Re: 3 LOD's
Post by: frinik on September 08, 2012, 05:12:07 PM
I think it might be a good idea to ask Iceman since he is one of guys who designed the game.


Title: Easy way to make a second LOD.
Post by: lockie on December 02, 2012, 03:37:52 PM
Thanks to happy accident, I've discovered for myself a very easy way - how to make and add a second LOD to the original model.
It's very easy. Here's instruction:
1. Pick up model, i.e. Marder II 132
2. Select and delete all unnecessary (as your point) parts of model. (s_*** and p_*** dummies must be deleted)
3. Save it as marder2lods.
4. Open original model Marder II 132.
5. Select all (Ctr+Shift+A)
6. Open ->File-> Add Lod (Ctr+Alt+L) and add marder2lods.
7. Save it.
8. Write down in cfg file, that model has 2 LOD's

(http://s5.postimage.org/vz80viemr/2lod_marder.jpg) (http://postimage.org/image/vz80viemr/)

As we can see a quantity of triangles has been reduced from ~20200 to 15500. It is a profit 4700 ~5000. Not bad :)
There's one restriction. All models must has NO more than 60 000 triangles (should be confirmed).
Well, may be this method being already known, but I hadn't seen it and that's why decided to share my experiences.


Title: Re: Easy way to make a second LOD.
Post by: Aces on December 02, 2012, 04:21:24 PM
Now THAT's very interesting indeed, great find Alex.

Cheers

Aces


Title: Re: Easy way to make a second LOD.
Post by: lockie on December 02, 2012, 04:51:12 PM
Here's what I got(all model parts), after my adjustments were applied to the second LOD.
(http://s5.postimage.org/ijl06264z/fin_02lod.jpg) (http://postimage.org/image/ijl06264z/)

 


Title: Re: Easy way to make a second LOD.
Post by: Mistwalker on December 02, 2012, 05:50:35 PM
This is the way SHUN used on sukhoi forum for some models.
The problem is many models are constantly updated, so you need to make the second lod for them every time.

How does framerate change? I doubt it's even worth the effort in case of Marder. You'll win maybe +1 fps at best.
In case of 38(t) or Tiger it could be good though.


Title: Re: Easy way to make a second LOD.
Post by: lockie on December 02, 2012, 06:50:46 PM
This is the way SHUN used on sukhoi forum for some models.
OK, I'm not original :)

Quote
The problem is many models are constantly updated, so you need to make the second lod for them every time.
Don't see any problems, except lazy of model author.

Quote
How does framerate change?
I don't know, but I'm pretty sure, that game engine will work MUCH smoothly with 2 LODs. Which has 5000 triangles less, than with model which has 5000 triangles more.

Quote
I doubt it's even worth the effort in case of Marder.
Then don't do it. It's easy.

Quote
You'll win maybe +1 fps at best.
May be YES. May be NO. But as my point 1 fps cost to spend a bit efforts. We'are not forced and it's a hobby. No need to be in rush.

Quote
In case of 38(t) or Tiger it could be good though.
At least, it won't be bad.


Title: Re: Easy way to make a second LOD.
Post by: Mistwalker on December 02, 2012, 07:02:17 PM
Don't see any problems, except lazy of model author..
Yep.  If the author feels that creating lods will be a waste of his time then let him be.

Quote
I don't know, but I'm pretty sure, that game engine will work MUCH smoothly with 2 LODs. Which has 5000 triangles less, than with model which has 5000 triangles more.
I most likely won't see any difference, so I don't care.
 Anyway if someone is ready to spent a little of his time on small improvements - that's great.  :)


Title: Re: Easy way to make a second LOD.
Post by: lockie on December 02, 2012, 07:20:13 PM
Yep.  If the author feels that creating lods will be a waste of his time then let him be.
Agree. It calls exactly lazy.

Quote
I most likely won't see any difference, so I don't care.
Me either.

Quote
Anyway if someone is ready to spent a little of his time on small improvements - that's great.  :)
Let's say HU-U-RA-A to this person!


Title: Re: Easy way to make a second LOD.
Post by: frinik on December 03, 2012, 12:51:43 PM
Anyway if someone is ready to spent a little of his time on small improvements - that's great. 
Let's say HU-U-RA-A to this person!


Ok to stay in the mood of World War II we will call it " Operation OverLOD "..... ;)


Title: Re: Easy way to make a second LOD.
Post by: Rends on December 07, 2012, 05:25:45 PM
The game engine isn't the fastest sure it will help and it's usefull.
Don't forget that you have more than a single tank on the battlefield.
With 10 20 or more units you will save a lot of cpu/gpu time !