News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Switching to a transparent workflow for the pakset?

Started by jamespetts, December 20, 2016, 09:20:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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

       
  • Easier, quicker and simpler workflow - no post-processing (which can be arduous where there is complex transparency)
  • Many objects will look better (trees, sailing ships, etc.)
  • Can use versions of Blender more recent than 2.65, which is not possible with the old workflow
  • No need to use Windows specific software for post-processing, allowing easy graphics creation by Linux and Mac OS X users
Disadvantages

       
  • This may adversely affect in-game performance if used too much, but it is not clear whether this will make a significant difference
  • Some graphics (e.g. signal step-ladders) may look inconsistent with existing graphics unless all are re-processed with this method
  • A thin alpha halo around objects as generated by this method may not look good (albeit the difference seems negligible: see here for examples and further discussion).
  • 4-8 times as many graphics files in the source folders due to not consolidating the images
  • The software for post-processing multi-tile buildings may not support transparency (this will need to be checked).
  • Edit (added 22 December 2016): it is known that the alpha engine does not adjust for colour properly, so some colour artefacts may be visible in alpha blended areas on close inspection.
My 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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

The Hood

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.

jamespetts

You can have a look if you like: see the new graphics being added on this special branch of my Github repository.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

The Hood

That would imply I had time! I'm afraid all I'll get chance to do is look at some screenshots...

jamespetts

Here is a preview of some of the newly produced 'buses, alongside two trams produced in the traditional way:



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:



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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Spenk009

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.

jamespetts

Here are some more 'buses:



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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jim Knopf

great work :top:

I can't await the next version of experimental

jamespetts

#9
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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

The Hood

Certainly looks good to me. For reference, what is your workflow now from blender to pak?

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

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:

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

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:





I think that this is an improvement. I should be interested in people's views.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

James, that is fantastic result! Now it really looks like there is a real cable above the road!

jamespetts

#15
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:



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:

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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.

jamespetts

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:
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

Very nice!  :thumbsup:

Did you make the flare in blender or added it in gimp?

jamespetts

I made it in Blender - this glow was achieved by switching the material rendering to "halo" and setting the alpha to 0.002.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Sarlock

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.
Current projects: Pak128 Trees, blender graphics

jamespetts

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:





Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

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





After



Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.