Script – UnityAssetVamifier

UnityAssetVamifier is a simple plugin to convert Materials used in Unity Asset Bundles (.assetbundle) from Unity default shaders (Roughness setup preferred) to the builtin VaM shader and expose the shader properties in the UI.

How to use (VaM 1.19):

  • Make sure you have at least VaM Version 1.19 (Beta Opt-in required)
  • Download NoStage3.UnityAssetVamifier.xx.var from the Link below and put it in the AddonPackages folder in your VaM directory
  • Follow steps below

How to use (VaM 1.20, No download required as UnityAssetVamifier is included in VaM):

  • Add a Misc/UnityCustomAsset Atom
  • Load your .assetbundle on the Atom and select a prop from the Asset dropdown
  • Add "UnityAssetVamifier.cs" as plugin to the Atom
  • Tweak the plugin options
  • Play around with the Global Illumination sliders and skyboxes in the Scene Lighting settings

Update guide from .cs file to .var package:

  • Remove Custom/Scripts/NoStage3/UnityAssetVamifier.cs
  • Install new .var file from link below
  • Manually change all references in scenes to new package or open the scene json files in a text editor and replace "Custom/Scripts/NoStage3/UnityAssetVamifier.cs" with "NoStage3.UnityAssetVamifier.19:/Custom/Scripts/NoStage3/UnityAssetVamifier.cs" (make sure you have the correct version number in the path)

Changes in 1.10:

  • message logging is now an option
  • VaM 1.20 and higher - automatically applies to new asset when asset is changed

 New in Version 1.9:

  • bug fix for IBLFilter slider not setting initially

New in Version 1.8:

  • added sliders for diffuse and specular bumpiness

New in Version 1.7:

  • fix: shaders with alphatest/alphablend keywords no longer get converted

New in Version 1.6:

  • material colors from unity are now converted better by default
  • manual color inputs now only work when "Colorize" is toggled on

New in Version 1.5:

  • Fixed bug where only first material of each renderer was converted

New in Version 1.4:

  • Fixed loading bug for very large assets

New in Version 1.3:

  • Texture tiling/scaling/offset are now all taken from main texture

New in Version 1.2:

  • Support for texture tiling/scaling/offset

New in Version 1.1:

  • Improved waiting for Asset Bundle solution
  • Reordered UI to match VaM UI (sliders left, colors right)

Legacy versions 

Why this plugin exists:

VaM currently imports Materials in Asset Bundles with whatever shader you have defined in Unity. This is in some cases wanted, but results in lighting problems most of the time. VaMs GI system does only work with a set of custom shaders, leaving all assets from Unity unaffected by the GI Sliders and the GI skybox. This is especially noticable when you have reflective materials.

Some technical notes:

  • If you have materials on your prop that use something else than the Unity Standard shaders, that material will be skipped and left untouched. The same goes for transparent materials (even if they use the Unity Standard shader).
  • If you have multiple assets per .assetbundle, the plugin option tweaks are reset when you switch to another asset. The same goes for when you reload the plugin.
  • If your asset has multiple materials, changes made in the plugin options will affect all of the materials at the same time. There are no separate sliders per material. For performance reasons (especially in VR), you should only use one material per asset anyway :-P