This article explains how to create a sci-fi effect using the Dissolve material in Unity.
The word “Dissolve” means “to dissolve”. As the word suggests, the Dissolve material can be used to randomly erase meshes.
We will combine this Dissolve material with animation to create a science fiction-like effect.
This is a sample scene using the Dissolve material.
Let’s try to see what we can create.
Importing the Simple Dissolve Shader
The Dissolve material we will use this time is the “Simple Dissolve Shader”, which is distributed for free at the Asset Store.
Let’s access the “Simple Dissolve Shader” from the Asset Store.
Download > Import, and prepare it in your project.
We are now ready to start.
Setting up the material
Let’s attach the material to the 3D model and set the parameters.
First, we will create a Sphere in the scene.
Right-click on the Hierarchy window and select 3D Model > Sphere.
After creating the Sphere, let’s attach the DissolveEmissionMaterial to it.
With DissolveEmissionMaterial selected in the project window, bring up the Inspector window.
Then you can see the material items.
You can create your own Dissolve material by adjusting each parameter.
In this article, I will explain only the most frequently used parameters.
DissolveAmount sets the amount (Amount) to dissolve.
When the value is 0, the material does not dissolve, that is, it does not change.
When the value is 1 (=100%), Dissolve is 100%, which means that all the data has been dissolved.
In other words, everything disappears.
By setting this value to the midpoint, you can make it almost disappear.
By setting this value to the middle point, you can create a disappearing state.
See below for details.
DissolveColor is the color of the boundary line when dissolving.
You can change it to any color you like.
The above two are the basic settings.
Adjust the other settings to create your original material.
Creating a science fiction-like effect
Let’s open the “DissolveEmissionDemoScene” in the imported assets.
We have a Sphere with a material attached to it.
Let’s play this scene.
The Dissolve value of the material changes, disappearing and appearing.
This effect is generated by the C# script attached to the Sphere.
However, C# scripting is not STYLY supported in STYLY.
Therefore, we will use animation to create the effect.
Prepare a Sphere
Create a Sphere using the Sphere we just created or a new scene.
We will attach a Dissolve material to the Sphere.
It should look something like this
Create the animation
We are going to animate the Dissolve material on this Sphere.
First, we will display the animation window.
Select Window > Animation > Animation from the top menu bar to display the animation window.
Once the Animation window is displayed, select the Sphere, and then select Create.
A file save dialog will appear. Save the animation file to a desired location in the project with a desired name.
When the following message appears, your animation is ready.
Select Add Property > Mesh Renderer > (with right mouse click) Add Properties.
Each setting item will be displayed.
This time, we will change the value of Material_Dissolve Amount.
Set the vertical bar of the sequence to the 0:30 position.
Let’s set the value of Mesh Renderer.Material._Dissolve Amount to 1.
Next, we will change the length of the animation time. In the current case, the animation changes in 1 second, which is too fast.
Let’s set the sequence of actions from disappearing to reappearing to 5 seconds.
Select all the keyframes at the top of the sequence and make them wider.
We are now ready to create the animation.
In the project window, check the animation file you just created and make sure that Loop Time is checked.
If there is no check mark, the animation will not loop.
The settings are now complete. Let’s play it back.
If the Dissolve animation plays, it is successful.
Let’s upload it to STYLY and use it effectively!
Upload to STYLY
Let’s upload the file to STYLY. This time, we’ll upload it in a prefab.
How to upload a prefab from Unity to STYLY
Let’s upload the timeline scene we created to STYLY.
If your scene is too large to upload to STYLY, please refer to this article.
How to create an account
Introduction to NEWVIEW SCHOOL ONLINE
NEWVIEW SCHOOL ONLINE is now open! Learn the basics of Unity and PlayMaker, necessary for creating VR/AR content, and learn the process (and creation techniques) for developing attractive content available on STYLY.
- Create VR/AR content without writing any programming code.
- Professionally supervised Unity courses available.
- Explore additional elements, such as photogrammetric production methods and content lightening.
- Learn the concept of creating VR/AR content.