Customizable Vending Pack
Cans and Bottles are combined into a 'Soda' Blueprint
This Construction Script Blueprint can then be used to switch between the Can and Bottle models, via the Details window. This is also used to control the desired texture, custom base colours, and to 'crush' the can or bottle.
There is also the option to 'Force LODs', which forces a selected LOD onto the selected model(s) in the viewport and ingame, whilst also displaying the vertices count of the selected model's chosen LOD.
Vending Machines are a seperate 'Vending Machine' Blueprint
The Construction Script based blueprint controls the logo, base colour, levels of 'wear', emission strength, base color brightness,
and toggling of the per-instance randomised flicker.
The highly efficient and customizable nature of these assets make them ideal to fill scenes and to be used as background assets, with automatic and manual 'performance modes' which offer further shader optimisation. [at the cost of features]
Both Blueprints also feature independent APM [Asset Parameter Memory] and Randomisation buttons.
After changing parameters on the Soda or Vending Machine instances, the next one spawned will have those same parameters. Meaning if you set a vending machine to pink and then place another Vending Machine, it will start as pink. [this also works for wear, crush, logos and most other parameters]
There are two buttons on both of the blueprints named, 'Randomise Self' and 'Randomise All'. Clicking 'Randomise Self' will randomise the parameters on the selected Soda or Vending Machine assets. Clicking ' Randomise All' will randomise all of the assets of the selected type that exist in the level [all Soda will be randomised or all the Vending Machines]. This does not randomise whether a Soda blueprint is a Can or Bottle, as doing so may result in the assets intersecting other world geometry.
Transparency and Material switching
One of the more challenging aspects in the creation of this pack was creating a suitable bottle material.
Using various techniques I quickly discovered that it was incredibly expensive to create a realistic transparent material, especially for assets intended for background use, or use in large quantities. By disabling unnecessary features, switching to a less intensive shading mode, and using pre-baked reflections, I managed to create a material with a base shader instruction count of just 62. The main downside being that, as a transparent material it is additive.
Meaning that when looking through this material at another material, the performance costs are added, rapidly increases the overall cost.
So I created an alternative material, one which is not transparent and is automatically applied by the construction script when the secondary (plastic) colour has an alpha of 1.
So what does this look like for the user?
Enabling transparency of bottles is incredibly simple. Using the construction script a user can simply set the Secondary Colour (for the plastic) to an alpha less than 1. This ensures that each individual Bottle in the scene is using the most efficient material possible.