Unity3d material fading transitions on transparent and opaque materials.
Transition space can be any surface that can be given by equation:
Current demo includes cube plane/sphere.
Relative to: gizmo/camera.
The space - position and orientation - can be manipulated with gizmo or tied to camera.
Colors/alpha along the transition can be passed with transition textures.
Fading done with transparency or dissolving.
demo: http://virtualplayground.d2.pl/transitions/
The demo uses the simplest setup of surface shaders.
The PBR metall/specular channels were disabled just to expose transition effects.
I had submitted the package to the store, but The Asset Store Team found some reference errors.
I have removed the errors and resubmitted again. In order to check I have imported the package it to the car scene of the Unity Standard Project Demo before the resubmission:
What functionalities you mean?
Could you give me a more specific suggestion?
The purpose of UI elements is just to manage the shaders variants and variables.
Well, for instance, you can only modify the transition distance by using the on-screen UI. There’s no editor slider to be able to modify it on the Fading Transition script. Basically, instead of having to use the on-screen UI, being able to make the same kinds of changes on the editor component directly.
Sounds good idea.
To make all the settings doable in inspector.
So the demo builds would remain unchanged, but the scene setups in editor and the scripts would change.
I would be going to make the changes and resubmit to the store, and post here when I’m done.
I have actually split the FadingTransition script into four separate scripts.
Two of them execute in edit mode and you can tweak the settings on them in inspector.
You can use the UI the same way as before, and you can remove UI and use the inspector settings on the edit mode scripts only.
I expect the package should get updated on the Asset Store soon, because I have submitted it some days ago. These were just minor changes, so it shouldn’t take long for them to accept.
As I use the asset more and become familiar with it, I may find some ways of improving it myself. I will be sure to pass that on to you!
If you’re curious to what I’m using it for, I want to use it as a way of fading away parts of walls or other obstructions that get in-between the camera and the player character, very similar to how it’s done in Divinity: Original Sin. This screenshot is a very good example of what I am aiming for:
Thanks. I hope my asset will be a right choice for you.
My update got accepted by the AssetStrore, so you can see if the recent changes meet your (and then probably other’s) expectations.
IMG
Unity 2017.3.0f3
Assets/WorldSpaceTransitions/fading/Editor/InspectorTestEditor.cs(4,23): error CS0246: The type or namespace name InspectorTest' could not be found. Are you missing an assembly reference? Assets/WorldSpaceTransitions/fading/Editor/InspectorTestEditor.cs(10,39): error CS0246: The type or namespace name InspectorTest’ could not be found. Are you missing an assembly reference?
Assets/WorldSpaceTransitions/fading/Editor/InspectorTestEditor.cs(12,23): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/InspectorTestEditor.cs(15,27): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(5,22): error CS0246: The type or namespace name MyScript' could not be found. Are you missing an assembly reference? Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(10,34): error CS0246: The type or namespace name MyScript’ could not be found. Are you missing an assembly reference?
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(12,18): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(20,26): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(22,26): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(24,26): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(29,18): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(33,22): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(34,22): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Assets/WorldSpaceTransitions/fading/Editor/MyScriptEditor.cs(35,22): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
Some redundant files got into the package.
I have already noticed that and resubmitted the package.
I was testing some idea and then this gave up.
Just remove the whole Assets/WorldSpaceTransitions/fading/Editor folder.
The asset is going to be updated with new features soon. These will include glowing shaders.
And again the noise textures can be used like below in world space (left) or screen space (right)
The asset will also contain the special tool for generating seamless and fully tileable 2D and 3D noise textures.
Texture3D or Texture2DArray’s are not supported on low end targets so - for the better compability range - the 3D textures are saved in form of atlas of 2D texture slices. So for example the resulting size for atlas texture of 3d 256x256x256 texture is 4096x4096.
Below are thumb images of texture examples produced with the included tool: an atlas texture (left) and a plain texture (right)