Board index FlightGear Development Effects and shaders

ALS traffic shader -artwork needed

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: ALS traffic shader -artwork needed

Postby vnts » Wed Mar 08, 2017 11:11 pm

Thorsten wrote in Wed Mar 08, 2017 12:22 pm:Also, greyscale image is fine, because the shader supplies color already (we could probably encode the glass areas in the alpha channel and pass it to the reflection map for added effect...)

Vehicles can have non-specular areas belonging to trailers/hoods/wheels/bumper/etc that stand out from metallic, window & light glassy surfaces. Perhaps tagging in a channel would work with those as well. Tagging 4 different sides might allow rough shading. Tagging for a secondary colour might be appropriate on big non-car vehicles - like stripes/markings (could be randomly turned off by setting to primary colour).
Thorsten wrote in Wed Mar 08, 2017 7:28 am:Also, at this point some input on what ought to be configurable where (runtime/design time/hard-coded/...) would be good.

Congestion / traffic could be seen to vary depending on weekday/week end/time of the year/festivals, or might be very low away from population centers. A runtime override to regional definitions might end up being used?

The small insignificant digits of the same random number used to determine vehicle presence in a domain could possibly be used, without correlation problems, to control the percentage of different types of vehicles on different types of road (e.g. more trucks on larger motorways). (Lack of roads on nightly builds, but from following the math/logic in road shader instead). Vehicle frequencies would vary from region to region.

I guess it could be done manually, but an option to automatically turn off when the illusion is completely broken might be convenient (at night time it probably matters less).

Not sure it's worth performance hit of having an extra branch, or is possible, but perhaps relaxing lighting at large distances so headlights flatly light the whole street at night might stop (possible?) flickering at low lod due to points being sampled, or simulate very small relatively bright sources being visible. From far away there would be bright points moving back and forth through each other.
Thorsten wrote in Wed Mar 08, 2017 2:23 pm:
it's the car's shadow that is the most obvious optical component when in the air.

That's a toughie, because the shadow might be outside the road polygons.

Perhaps (?) lack of shadow won't be noticeable if shadows were faded out as they get really long. Perhaps lack of shorter day time shadows on adjacent material won't be noticeable - because grass etc. reflects less and is less uniform (maybe cars closer to one edge can get away with not casting shadows at all). Then again, maybe there is just no way around it in current scenery format (until transition metadata is available).

The occluded space underneath cars stands out a bit from the road and shiny car at shallower angles, as well.

Perhaps a strip of the image at the boundary of the texture can be interpreted as relative height of the occluder that casts the shadow (e.g. lengthwise profile is 2x higher in the middle section of a car than at ends). It does create problem towards the back/front of the car at lower sun angles where the high midsection casts the shadow. Data in the other two channels could reference midsection height and ratio of depth of bonnet/boot to midsection height-boot height, or the midsection height could be read at an appropriate place for low sun angles. There probably isn't an easy solution.
CaptB wrote in Wed Mar 08, 2017 8:46 pm:Three versions so far, a city hatchback, pickup and a lorry.

Looked at SVGs on public domain clip art, but it seems you are modeling it in 3d, which is better as a heightmap could be extracted. Looks good.

Kind regards,
vnts
vnts
 
Posts: 60
Joined: Thu Apr 02, 2015 12:29 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sun Oct 14, 2018 12:22 am

Hi Thorsten, apologies for resurrecting this old post but do you still need textures for the cars? I would be happy to make some. I tried looking for the current textures in FGData but I could not find them, could you please point me to where they are?
User avatar
gsagostinho
 
Posts: 1789
Joined: Thu Jan 15, 2015 6:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Thorsten » Sun Oct 14, 2018 4:16 am

It's currently texture-less, the cars are drawn by evaluating a function - which we could change if we had textures 8)
Thorsten
 
Posts: 9801
Joined: Mon Nov 02, 2009 8:33 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sun Oct 14, 2018 12:52 pm

Great, I will work on a sheet with car textures and send it to you as soon as I have something. Should I also create a lightmap variation of this sheet similarly to the textures on FGDATA/Textures/osm2city? And if so, what channels should I use for the forward yellow lights and red back lights? Or do you prefer to only have the car textures and handle the lights in a different way?
User avatar
gsagostinho
 
Posts: 1789
Joined: Thu Jan 15, 2015 6:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Thorsten » Sun Oct 14, 2018 1:11 pm

I'm... not sure. Maybe we just start with car textures and see whether something is required in addition? Assuming you're willing to go through a few iterations - I haven't worked out all the details myself yet...
Thorsten
 
Posts: 9801
Joined: Mon Nov 02, 2009 8:33 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sun Oct 14, 2018 1:26 pm

Sounds good, and I don't mind to go through as many iterations as necessary.
User avatar
gsagostinho
 
Posts: 1789
Joined: Thu Jan 15, 2015 6:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sun Oct 14, 2018 3:34 pm

Thorsten, this is my first try:

Image

Link: https://i.postimg.cc/yNRvH725/cars.png

I used a grid of 32 x 128 pixels per car as to be able to accommodate trucks and buses as well. Let me know if I am on the right track.
User avatar
gsagostinho
 
Posts: 1789
Joined: Thu Jan 15, 2015 6:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Thorsten » Sun Oct 14, 2018 4:47 pm

It looks nice - I'll give it a try (might be a few days though I hope we can clear the release soon, but right now it has priority...)
Thorsten
 
Posts: 9801
Joined: Mon Nov 02, 2009 8:33 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sun Oct 14, 2018 5:07 pm

Great, let me know if you need any other changes, and no rush. Cheers!
User avatar
gsagostinho
 
Posts: 1789
Joined: Thu Jan 15, 2015 6:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Hooray » Sun Oct 14, 2018 6:04 pm

This could look really neat, especially if this could be made to work in conjunction with FredB's original Urban/relief shader approach to give vehicles an appropriate shape.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11119
Joined: Tue Mar 25, 2008 8:40 am

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests