• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Road Traffic Shenanigans

Heretic

Resource contributor
Messages
6,830
Country
germany
First foray into Blender and FSX' Living World System.

Unlike the default road traffic, this model only uses one drawcall* and two textures** (one for the diffuse, one for the nightmap).

Road_Traffic_1.png


Road_Traffic_2.png


Road_Traffic_3.png


The daylight lightcone is unfortunate, but there's no other way to do this efficiently.


Let's see how many different types of cars I can model until I lose motivation. :D


Regarding Blender:
I like it. If I've got a problem, I just google and almost immediately find my answer. Still need to memorize a lot of the procedutres and shortcuts though. UV mapping is way superior to 3ds Max and I generally get a better workflow than with the commercial stuff.
Thanks for the toolkit, thanks for the videos, thanks for talking about it.



*Default cars: 1 to 5
**Default cars: 1 to 8, with specular and night maps
 

Dutcheeseblend

Resource contributor
Messages
1,541
Country
netherlands
How nice!

Does it prove to be performance efficient so far, compared with FSX default traffic?

And a warm welcome to the world of Blender :D!
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Bedankt!

Does it prove to be performance efficient so far, compared with FSX default traffic?

I'm not sure yet.

By default, FSX uses 124 different vehicles (including color variations) per region. They come with about 40 texture sheets totalling 20 MB or so (estimation). That's 20 MB virtual address space used on vehicle textures. For my car, I've done the texture layout with four variations per sheet in mind. Format is 1024²px DXT1 which results in ~600 KB per texture (including mip maps). If I manage to create 10 distinct models with 4 variations each, I'd end up with 40 vehicles with 10 textures and 12 MB VAS use (600*2*10). Bit of an improvement, provided that the default library is removed and all references to it in the LWCFG.xml are purged.

At render time, an object with 1 drawcall puts less demands on the engine than an object with 4 drawcalls. But most of the time, you'll see the road traffic from higher up and thus at its lower LODs which most of the time only incur 1 or 2 drawcalls. So during flight differences in performance drain will be negligible. On final approach to airports surrounded by busy freeways, however, things get a bit more interesting as you are more likely to see the cars at their higher LODs. This might be the area where the impact of my simpler models could actually be felt.

Should drawcall batching be used by FSX for road vehicles, I am winning big time, as it makes displaying a lot of objects with less variety actually more efficient than less objects with a lot of variety*.


*Can be tried with autogen.
See here: http://simhq.com/forum/ubbthreads.php/topics/3407259/Re:_FSX_Trees#Post3407259
 
Messages
1,510
Country
unitedstates
That's weird, that time I was telling you about with the simulated LSD hallucinations in sim happened when I removed all the LODs from the default vehicles.bgl and batched all the models. Now you're batching these and not experiencing that? I wonder if it was a DX10 thing, are you using DX10? I assumed the vehicle traffic/AI engine or whatever it is just didn't take a shining to batched models.

Now about Blender, how do I turn the stupid cube into something useful? Any suggestions for a good starting tutorial for a gmax refugee? Ideally something like "in gmax you would go into sub-object/vertex mode, so the Blender equivalent would be..." So far I'm just a monkey f-ing a football in blender, lol.

Anyway here's three cheers for motivation, I hear ya and good luck!
 

Heretic

Resource contributor
Messages
6,830
Country
germany
That's weird, that time I was telling you about with the simulated LSD hallucinations in sim happened when I removed all the LODs from the default vehicles.bgl and batched all the models. Now you're batching these and not experiencing that? I wonder if it was a DX10 thing, are you using DX10? I assumed the vehicle traffic/AI engine or whatever it is just didn't take a shining to batched models.

Hah, I knew you'd chime in, Jim! :D
I've never had any luck with DX10. It always ran worse than DX9 for me. And as you can see, FSX' rendering engine didn't reject my one-LOD model s I don't know what's going on there.

Does road traffic really get batched despite being "animated"?

Now about Blender, how do I turn the stupid cube into something useful? Any suggestions for a good starting tutorial for a gmax refugee? Ideally something like "in gmax you would go into sub-object/vertex mode, so the Blender equivalent would be..." So far I'm just a monkey f-ing a football in blender, lol.

Try Krispy's tutorial videos or this one:
They're tailored to FSX, but some general modeling tutorials might be better to get acquainted to the UI. There are a few thouand of them on the web.



Press Tab and you can mess around with vertices, edges or faces.

Ah, ah, ah...CTRL+TAB! This much I've already learned. :D

Still need to figure out how I can move something to a specific location. Offsets are nice, but they somehow just don't cut it.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
You mean within Blender?

Aye. You can type something in when you move things, but that's just the distance from the current location.
The manual says that moving to a specific location is possible, but does not state how.
It would already help if I could only move the cursor to a specific location and then just use the snap functions (great function, by the way!).
 
Messages
1,510
Country
unitedstates
Hmm, according to Arno's drawcall monitor the models in vehicles_land.bgl are batched - but they have LODs. You can obviously see the LODs change as they approach enroute so yeah it must be that the AI engine or whatever it is that controls them as traffic breaks batching. I think batching only applies to XML placed objects, maybe autogen too, not sure. I think I still have that modified vehicles_land.bgl somewhere, I'll revisit that and try DX9 and 10 to see what happens.

BTW, what's the problem with the light cone that you can't make it transparent on the day texture? Extra drawcall or something?

Thanks Dutchcheeseblend I'll try Ctrl+tab. Man that's a crazy interface though when you're used to something completely different. Thanks for the vid Bjoern (and Krispy), bandwidth issues as always but I'll try to take in a couple during the wee hours when nobody's on the net.
 

Dutcheeseblend

Resource contributor
Messages
1,541
Country
netherlands
Aye. You can type something in when you move things, but that's just the distance from the current location.
The manual says that moving to a specific location is possible, but does not state how.
It would already help if I could only move the cursor to a specific location and then just use the snap functions (great function, by the way!).

- Of course you can use the 3D manipulator (Ctrl Space tells Blender me) to move things to some location manually.
- Try hitting N, that will give you a tab on the right of your 3D view. In the uppermost section, there's transform, which tells you the XYZ location of the selected object. You can type there as well.
- Cursor placement is done with right-click (not by default, RMB is default the selecting button but can be changed in the User Preferences) if you use LMB select.
- In the same N tab, the 3D cursor section can be found.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
I think I've optimized the car now as much as possible. The version from the screenshots had 320 triangles and 530 texture vertices. Both numbers are now down to 242 triangles and 390 texture vertices.


Hmm, according to Arno's drawcall monitor the models in vehicles_land.bgl are batched - but they have LODs. You can obviously see the LODs change as they approach enroute so yeah it must be that the AI engine or whatever it is that controls them as traffic breaks batching. I think batching only applies to XML placed objects, maybe autogen too, not sure. I think I still have that modified vehicles_land.bgl somewhere, I'll revisit that and try DX9 and 10 to see what happens.

Autogen definitely batches, so I'd say that every static object can be batched.

BTW, what's the problem with the light cone that you can't make it transparent on the day texture? Extra drawcall or something?

Basically, yes. The FSX cars use a universal texture for their lights, but this adds a drawcall to each model.
Once I'm done filling the bitmap with the other color variations, I'll see if I can get a larger area allocated to the light splash so that I can add an alpha channel to the texture to make the splash fade out at the edges a bit. Then I need to check if the alpha-fade still looks good when the texture is shrunk to 512² px. As GIMP is a bit wonky regarding fexporting lattened/merged images with alpha channel, I want to avoid the workflow-breaking run through DXTBMP each time I make a change to the master texture for as long as possible.

Thanks Dutchcheeseblend I'll try Ctrl+tab. Man that's a crazy interface though when you're used to something completely different. Thanks for the vid Bjoern (and Krispy), bandwidth issues as always but I'll try to take in a couple during the wee hours when nobody's on the net.

There are also tutorials in picture form out there if it helps.

If you've got the time, you are welcome to contribute a few models as long as they're freakin' efficient(TM).



- Of course you can use the 3D manipulator (Ctrl Space tells Blender me) to move things to some location manually.
- Try hitting N, that will give you a tab on the right of your 3D view. In the uppermost section, there's transform, which tells you the XYZ location of the selected object. You can type there as well.
- Cursor placement is done with right-click (not by default, RMB is default the selecting button but can be changed in the User Preferences) if you use LMB select.
- In the same N tab, the 3D cursor section can be found.

It's that easy?! Haha, thanks!



- E:
I've just created a blue variation of the car. Moving the UV maps for the variation to its proper position was much easier than in Max/GMax. Wow!
 
Last edited:
Messages
1,510
Country
unitedstates
freakin' efficient? :D

I'm a 2000+ triangle modeler and I'd probably want envmap on the rear view mirrors, lol.

I do have a Subaru Outback I'd throw at the cause though, 412 triangles, 2 drawcalls but drawcall #2 is an attached shadow which could be removed. Is that efficient enough? I think I may be able to consolidate the texture down to 512px, I'll play with it this evening.

subaru_outback.jpg
 

Heretic

Resource contributor
Messages
6,830
Country
germany
freakin' efficient? :D

I'm a 2000+ triangle modeler and I'd probably want envmap on the rear view mirrors, lol.

Well, we're talking a hundred vehicles here and not your EZDok-bait next to the hangar at a local GA field down in the swamps of FL. ;)

I do have a Subaru Outback I'd throw at the cause though, 412 triangles, 2 drawcalls but drawcall #2 is an attached shadow which could be removed. Is that efficient enough? I think I may be able to consolidate the texture down to 512px, I'll play with it this evening.

subaru_outback.jpg

Hm, well...412 triangles sounds a bit much, but it could be included as a special car of sorts as it would definitely not blend well with my hand drawn textures that a seven year old could do better.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Argh!

First of all, I've created all the color variations for the compact car. Then, I've created new light splashes with edges that fade out. I've put the cars into the library, did all the necessary referencing in LWcfg.xml and created FSX-compliant textures*.

Still, I end up with this:
Traffic_Draw_Bug.jpg


Something's wrong there. I've set the material properties for each car to z-test the alpha channel and the material is double-sided, so that could be quite an issue.


- Edit:

Removed the Z-Test. No better.

Draw_Bug2.png


Maybe it's this** bug at work (in DX9 no less), which would basically mean that cars are drawcall batched after all!

Probable conclusion: No transparency and thus ugly light splashes.



*The only way you can end up with ImageTool-compliant textures with an alpha channel is exporting to .psd from GIMP and then converting said texture with Imagetool into the desired format. Exporting as .dds from GIMP produces an "unknown" alpha channel, while adding an alpha channel in DXTBMP and then saving in the desired format results in a texture that can't be opened in ImageTool.

**http://stevesfsxanalysis.wordpress.com/2013/11/07/testing-drawcalls/
 
Last edited:

Heretic

Resource contributor
Messages
6,830
Country
germany
(Can't edit posts from my mobile.)

If this is indeed drawcall batching at work here, it would also explain the decent performance one gets with the relatively unoptimized default models.
Which means that my lo-fi ones would yield next to no impact at all at the same traffic levels. But this remains to be seen.
I'll remove the transparency next and see if this fixes it.

Jim, can you check the default models for the "drawcall batching" flag in MCX?
I'm in my way to a party...:)
 
Messages
1,510
Country
unitedstates
I just did that Bjoern, check my post above. I decompiled it and checked just a few and they were indeed batched according to Arno's drawcall monitor - but they had LODs - but we expected that from past experience with vehicles_aircraft.bgl.

If you can alter the shape of the beams presumably by editing the alpha channel why can't you just make it all black so you can't see them at all?

So how many triangles are we talking about here? I found Tic's low-poly car tutorial and I was thinking about having a go at one or two.

Have fun at the party, hope you didn't get elected "designated driver", I hate it when that happens, lol.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
I just did that Bjoern, check my post above. I decompiled it and checked just a few and they were indeed batched according to Arno's drawcall monitor - but they had LODs - but we expected that from past experience with vehicles_aircraft.bgl.

And removing the LODs turned them into a similar polygon nightmare like result above.

If you can alter the shape of the beams presumably by editing the alpha channel why can't you just make it all black so you can't see them at all?

That won't work as an invisible beam during daylight will stay invisible at night (Blend Mode: AdditiveNightOnly).
Also, what if the transparency really is the culprit?

So how many triangles are we talking about here? I found Tic's low-poly car tutorial and I was thinking about having a go at one or two.

As little as possible. The 400 triangles of the Subaru would be okay, yet I'm pretty sure that the UV layout only permits one color variation on the main texture.

Have fun at the party, hope you didn't get elected "designated driver", I hate it when that happens, lol.

One of the blessings of the bigger cities in "old Europe" is a public transport system that runs 24/7. :D
 
Messages
1,510
Country
unitedstates
So I just dug out the vehicles_land LOD removal project and gave it another try. From what I see the problem only exists in DX10 full screen, DX9 or DX10 windowed seems fine. What I'm seeing isn't anything like what you're showing in your screenshots, I can't get a screenshot of it, the V key produces a perfectly normal screenshot and print screen just gives me a black screen. I'm convinced what I'm seeing are textures from the effects\texture folder, like fx_2.bmp or something emanating from the vehicles in triangular "rays" that flicker and flash across the sky, the sky is black but the clouds look normal against it. It's like a bad remake of the Andromeda Strain (isn't that the one where the planet was blown off it's axis by a nuclear explosion?). Here's the .bgl if you want to play.

I tried a low-poly car last night, it came out worse than the Subaru at 568 triangles and looks like hell without spending a week adjusting textures, lol. I see, you're supplying multiple color variations on the same texture sheet. Hand painting does seem like a good approach, using photos consumes entirely too much time making edges blend well, I can see where painting a texture to match a UVW print screen or something would be much easier. I may have another go tonight.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
It's like a bad remake of the Andromeda Strain (isn't that the one where the planet was blown off it's axis by a nuclear explosion?).

Nope. Extraterrestrial virus.

I tried a low-poly car last night, it came out worse than the Subaru at 568 triangles and looks like hell without spending a week adjusting textures, lol. I see, you're supplying multiple color variations on the same texture sheet. Hand painting does seem like a good approach, using photos consumes entirely too much time making edges blend well, I can see where painting a texture to match a UVW print screen or something would be much easier. I may have another go tonight.

I can send you the .blend file(s) and source texture if you need a better low-poly reference. Hand-painting may look worse than photoreal, but it's 500% more adaptable.




- Edit:

These are your LOD-less vehicles:
traffic_nolods.png


They also show up fine at night.
 
Last edited:
Messages
1,510
Country
unitedstates
Just send me a model out of MCX and a texture so I can see what we're striving for. It'll take me a week to figure out how to get something out of Blender :) .

(The movie - Yes I vaguely remember now, I was like 8, the complete lack of "Rooster Cogburn" was very disappointing to me, lol.)
 
Top