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 gsagostinho » Wed Oct 24, 2018 3:04 pm

Hi Thorsten,

I think using a square grid would be a big waste of space since the cars themselves are already quite long in the vertical direction and the lights just add to that direction. By moving them to the centre of their rectangular slots, I managed to fit the light map without any issues. I used the blue channel for the front lights and the red channels for the back lights, since they will need to be tinted with two different colours in the sim (yellowish for front light and reddish for back lights). I tried using the green channel for the heightmap, but since I have to create that manually and it is a lot of work I did it just for one single car so that we can test how it looks like. If it looks good then I would gladly do the same for all other cars. And then we still have the alpha channel to be used in the future.

Here is what I got:

Image

Image

What do you think? Let me know if this works better.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Thorsten » Thu Oct 25, 2018 6:12 pm

I used the blue channel for the front lights and the red channels for the back lights, since they will need to be tinted with two different colours in the sim


My idea was to use the two different color channels to distinguish between the lights themselves (drawn rather brightly) and the region on the ground that is illuminated by them. The reason is that if you approach a car from behind, you can still see the area in front of it illuminated, but you won't be able to see the front lights themselves.

Encoding light color on this particular lightmap via an extra channel is wasteful - we know from the position on the texture sheet whether a light is a front or a back light, so assigning the right color is easy.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Fri Oct 26, 2018 9:13 pm

Hi Thorsten, see if this is what you have in mind:

* red channel: front and back lights
* blue channel: illuminated ground
* green channel: height map

Image

Let me know if I am on the right track.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Thorsten » Sat Oct 27, 2018 7:41 am

Thanks, I'll give that one a try, it looks like what I need. We'll see about the heightmap - at this point I have no idea whether it looks like crap or gives a decent impression - I suppose we'll just have to try.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sat Oct 27, 2018 7:24 pm

Great, let me know if you need any more modifications. As for the heightmap, give it a try and if you think there is potential to it then I can possibly improve it a lot and add all other cars too.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Hooray » Sun Oct 28, 2018 9:48 am

gsagostinho wrote in Wed Oct 24, 2018 3:04 pm:I think using a square grid would be a big waste of space since the cars themselves are already quite long in the vertical direction and the lights just add to that direction.


Actually, I think Thorsten's idea should still work - Thorsten mentioned in his original posting that he wanted to cram as much info into the texture as possible, and he also spoke about "stretching" vehicles on demand. With that in mind, vehicles could be split into 3 distinct parts, i.e. the front, middle and rear section - and the middle section could be procedurally repeated (stretched) as needed, like Thorsten suggested once.

At that point, it might even be possible to reuse this approach for other vector data, at the mere cost of changing the input textures (think railways or rivers)

Of course, Thorsten would be in a much better position to judge if/when any of this makes sense or not, but looking at the artwork that you have created so far, I think the texture could be simplified accordingly, so that it could accommodate more information for additional features, i.e. "slots" that may come in handy in the future.
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Sun Oct 28, 2018 1:42 pm

Hooray, I might have misunderstood something but I do not recall Thorsten suggesting that I would stretch the textures to avoid leaving any empty space. Stretching the textures to fit a different format and then unstretching them in the sim seems unnecessary since the textures are already in the correct proportion and applying these two operations will only make things look worse. I also do not see the need to optimize this to the maximum, this is just one single small png file amidst a bunch of textures in the sim. Finally, when you consider the meta information for the lgihts and heightmap, there is barely any empty space left since most of the space in front and in the back of the cars now contain light information. I am quite happy with the direction he and I took so far and I am really not sure it would make sense to ditch it and try to break cars into three sections, stretch them at will and try to procedurally combine them. IMO, that would at best create something that looks as decent as these textures look right now, and at worse create some very weird cars. My 2 cents, of course.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Hooray » Sun Oct 28, 2018 1:58 pm

I certainly didn't mean to suggest to ditch your current work.
I might have just as well misunderstood something, so there might be a misconception here.

I was specifically referring to Thorsten's earlier comments quoted below:

Subject: ALS traffic shader -artwork needed
Thorsten wrote:getting eight different shapes is probably better than just four - we can always stretch runtime if needed.

So ideally 8 car images of 1:2 aspect ratio on a texture strip (which then has 4:1 aspect ratio). it's not terribly important in detail, I know how to re-arrange images on a sheet once I have them.


Subject: ALS traffic shader -artwork needed
Thorsten wrote: I guess once we're reading a (small) texture, we might as well cram as much detail into it as the texture can hold.

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...)



If this approach is used, there is quite a bit of redundant info (space) being used, because the texture could encode repeated patterns.

But like you rightly said, the direction is promising "as is", I was merely commenting on your progress with the quoted comments in mind, because there would quite a bit of space left to extend the system and use it for additional features, or even just provide ground traffic with additional features if the textures provide sufficient space to encode other meta info.

Anyway, please disregard for now, didn't want to hijack this or even just cause any misunderstandings.
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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Mon Oct 29, 2018 1:41 pm

No worries, Hooray, let's see what Thorsten can do from what we have here.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: ALS traffic shader -artwork needed

Postby Thorsten » Fri Nov 02, 2018 2:35 pm

I have this now working with the lightmap and (yay) the problem of cars too close by is also gone, but I seem to have lost the dual carriageways on the way, so I'll need one more session to go through the sign conventions for those.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS traffic shader -artwork needed

Postby Thorsten » Mon Jan 14, 2019 1:01 pm

My apologies for the long wait - I've now pushed this to next.

I'm not 100% sure the traffic directionality of everything works out, but then again I'm also not sure my testcase is sound (and I don't remember how we agreed with the OSM2City folks to handle dual carriageways...)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: ALS traffic shader -artwork needed

Postby gsagostinho » Mon Jan 14, 2019 1:24 pm

No worries about it, Thorsten. I will check it as soon as I get a chance.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Previous

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 5 guests