The International Simutrans Forum

PakSets and Customization => Pak128.Britain => Topic started by: jamespetts on December 20, 2016, 09:20:55 PM

Title: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 20, 2016, 09:20:55 PM
Now that we have full support in the Simutrans graphics engine for proper alpha transparency, I wonder whether it is worthwhile to switch the standard graphical workflow for making objects for this pakset to export with a transparent background in Blender and abolish all of the post-processing steps (except for multi-tile buildings). I should be interested in people's views on this, especially those of the Standard pakset maintainers.

I set out what I believe to be the advantages and disadvantages below.

Advantages
DisadvantagesMy current preliminary view is tentatively in favour of adopting the transparent workflow because of the huge time saving of time that not having to post-process the graphics will yield. This will also make it much easier for new contributors to get started and will not require the use of an outdated version of Blender.

My Christmas pakset project this year is road vehicles, and I plan to produce all of those using the new workflow to see how well that it works as a test. I should be interested in people's views on this subject in the meantime.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: The Hood on December 22, 2016, 10:41:10 PM
I'd be interested in the results; I tend to agree with you but as I doubt anyone is up for redoing all the existing graphics it would be interesting to see how the new workflow results fit in alongside the existing stuff.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 22, 2016, 10:47:52 PM
You can have a look if you like: see the new graphics being added on this (https://github.com/jamespetts/simutrans-pak128.britain/commits/road-vehicle-rescaling) special branch of my Github repository.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: The Hood on December 23, 2016, 10:52:13 AM
That would imply I had time! I'm afraid all I'll get chance to do is look at some screenshots...
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 23, 2016, 11:26:49 AM
Here is a preview of some of the newly produced 'buses, alongside two trams produced in the traditional way:

(http://bridgewater-brunel.me.uk/screenshots/bus-and-tram-comparison.png)

By comparison, here is an old screenshot showing the scale problems with the 'buses, featuring a tram and a routemaster 'bus, both before and after rescaling, using the traditional method in both cases:

(http://bridgewater-brunel.me.uk/screenshots/bus-scale-issue.png)

The depots will clearly benefit from some alpha to produce the shadows (there is rather an inconsistent way of handling shadows at present, from solid (as on the tram depot) to dithered (as with the road depots) to non-existent (as on the rail depots). Also, I wonder whether the catenary and power lines would look rather better with alpha rendering.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: Spenk009 on December 24, 2016, 10:09:44 AM
Reducing the amount of steps required to add something to the pakset will lower the hurdle for people looking to contribute. I've had trouble with alignments, orientations, transparency/edges and workflow logic.

Transparency on "thin" cables could allow them to blend in more naturally. Maybe a poll with screenshots of both could provide the community's opinion.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 26, 2016, 01:47:21 AM
Here are some more 'buses:

(http://bridgewater-brunel.me.uk/screenshots/new-buses.png)

All but the newer 'bus (the RT-type) have been rendered using the new transparent method. Note how the snowy road behind is visible through the gaps in the slatted covers to the upper decks of the B-type and X-type 'buses in their earlier (dark red) LGOC livery: that effect would nt have been possible (or, at least, practical) with the old workflow.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 26, 2016, 06:15:42 PM
Here is an example of alpha being used to improve the depot graphics to get rid of that awful dithering that we had to use before we had the alpha system: a definite improvement, I think.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: Jim Knopf on December 26, 2016, 06:28:24 PM
great work :top:

I can't await the next version of experimental
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 26, 2016, 06:37:18 PM
May I suggest trying the development builds?

***

Edit: The graphics for this are now on the road-vehicle-rescaling branch on Github. So far, I have converted the early and modern road depots to the alpha graphics. I have also switched the shadows from the back image to the front image so that a shadow is cast on the vehicles themselves as they emerge from and enter the depots.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: The Hood on December 27, 2016, 11:19:27 AM
Certainly looks good to me. For reference, what is your workflow now from blender to pak?
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 27, 2016, 11:49:39 AM
Render in Blender with RGBA (rather than RGB), with Quadratic anti-aliasing at 11 ("full sample" seems to make no difference that I can detect), then place the images produced thus by Blender straight in the relevant /images directory, and refer to them in the .dat files. For road vehicles, which is what I am doing at present, I use the "normal" rather than the "vehicle" 8 view rendering, and apply offsets. An example of the file names and offsets are as follows (note that this includes livery definitions which are unique to Experimental; they can be removed by deleting zero in square brackets before the = sign.


EmptyImage[E][0]=./images/aec-rml-trolley_E.0.0,-33,14
EmptyImage[SE][0]=./images/aec-rml-trolley_SE.0.0,-13,0
EmptyImage[S][0]=./images/aec-rml-trolley_S.0.0,4,0
EmptyImage[SW][0]=./images/aec-rml-trolley_SW.0.0,-8,10
EmptyImage[W][0]=./images/aec-rml-trolley_W.0.0,4,5
EmptyImage[NW][0]=./images/aec-rml-trolley_NW.0.0,12,10
EmptyImage[N][0]=./images/aec-rml-trolley_N.0.0,0,33
EmptyImage[NE][0]=./images/aec-rml-trolley_NE.0.0,0,24


For rail and other types of vehicles, use the "vehicle" setting in the script and apply no offsets.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on December 31, 2016, 01:54:46 AM
The transparent rendering system seems to work very well for horse drawn vehicles, many of which I have been producing or modifying in recent days, as it really shows the spoked wheels to good effect, which are now partly transparent:

(http://bridgewater-brunel.me.uk/screenshots/horse-demonstration.png)
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on January 03, 2017, 10:16:14 PM
There were some requests for seeing how electrification looks with alpha graphics. Since I am working on re-scaling road vehicles, and the re-scaled trolleybuses' trolley poles did not visually come into contact with the existing trolley wires, I took the opportunity of re-rendering the trolley wire graphics using the new alpha system, also lowering them to match the scale of the trolleybuses as well as adding insulators where the wires crossed.

Here are two screenshots of that:

(http://bridgewater-brunel.me.uk/screenshots/trolley-wires-1.png)

(http://bridgewater-brunel.me.uk/screenshots/trolley-wires-2.png)

I think that this is an improvement. I should be interested in people's views.
Title: Switching to a transparent workflow for the pakset?
Post by: Ves on January 03, 2017, 11:24:27 PM
James, that is fantastic result! Now it really looks like there is a real cable above the road!
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on January 04, 2017, 12:30:41 AM
Thank you! That was rather the plan. Here is another screenshot of the newly re-scaled AEC 663T/A1 "Diddler" trolleybus, the first type used in London, with its new (original) LUT livery:

(http://bridgewater-brunel.me.uk/screenshots/diddler.png)

You will also see some recently re-scaled steam lorries in the background.

The tram wires would probably look rather better with this technique, too, although it took me all day to do just the trolley wires; I imagine that some of the older trams will probably look better re-rendered using the new transparent technique, too.

Out of interest, do you use Blender for the Swedish pakset? If so, are you planning to switch to a transparent workflow?

Edit: Incidentally, here is a direct comparison between the trolleybus (new) and the tram (old) electrification graphics:

(http://bridgewater-brunel.me.uk/screenshots/transparent-wires-comparison.png)
Title: Re: Switching to a transparent workflow for the pakset?
Post by: Ves on January 04, 2017, 11:02:16 AM
I'm only using gimp and have manually painted the transparency. I plan to incorporate transparency to all places I can think of, especially the pantographs and under the carriages.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on January 04, 2017, 06:52:18 PM
Interesting - I shall be intrigued to see the results.

Meanwhile, here is a screenshot of the MCW Q1 trolleybus in both London Transport and Glasgow Corporation liveries:
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on January 06, 2017, 12:45:24 AM
Borrowing an idea from the Swedish pakset, here are some new traffic lights with a glow to show the aspect of traffic lights facing away from the player. The previous traffic lights seem as if they had been hand-drawn rather than rendered, and did not fit into the look of the pakset very well.

I have produced graphics for three different sets of traffic lights for different eras (1920s-1970s, 1970s-2000s, and 2000s onwards). The traffic lights featured below are the middle of the three.

They are pictured next to a newly rescaled Dennis Dominator 'bus in South Yorkshire PTE livery.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: Ves on January 06, 2017, 10:38:18 AM
Very nice!  :thumbsup:

Did you make the flare in blender or added it in gimp?
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on January 06, 2017, 11:49:11 AM
I made it in Blender - this glow was achieved by switching the material rendering to "halo" and setting the alpha to 0.002.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: Sarlock on January 06, 2017, 06:07:02 PM
Wow, that looks great!  What a good use of the alpha blending capabilities... I am excited about the many ideas people come up with over time.
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on January 06, 2017, 10:13:04 PM
I have now re-rendered the first generation trams using the new transparent method (the earlier trams had many spindly appendages, so they look better thus rendered, I think), and I have also produced new tram wire graphics to go with them using the alpha method. Here are some screenshots:

(http://bridgewater-brunel.me.uk/screenshots/tram-wires-demonstration-1.png)

(http://bridgewater-brunel.me.uk/screenshots/tram-wires-demonstration-2.png)

(http://bridgewater-brunel.me.uk/screenshots/tram-wires-demonstration-3.png)
Title: Re: Switching to a transparent workflow for the pakset?
Post by: jamespetts on July 16, 2017, 12:38:02 PM
I have recently been applying alpha blending to the graphics of a number of ships, and it greatly improves the appearance of ships with masts. Here are some examples.

Before

(http://bridgewater-brunel.me.uk/screenshots/ships-before-1.png)

(http://bridgewater-brunel.me.uk/screenshots/ships-before-2.png)

After

(http://bridgewater-brunel.me.uk/screenshots/ships-after-1.png)

(http://bridgewater-brunel.me.uk/screenshots/ships-after-2.png)