Repository for the Dissolve Effect in the URP Unity
Note: Use the DissolveEffect Script in the asset with it.
- To Create a Material out of the Dissolve Shader:
- Right Click on the Dissolve Shader in Assets
- Create
- Material
- Attach this material onto the object. Now expand the material attached to the game object you will see multiple components:
- Albedo - For the Albedo Texture to be applied
- Metallic - For the Metallic to be applied
- Normal -For the Normal to be applied
- Occlusion - For the Occlusion to be applied
- Color - The color of shade to be added in adition to Albedo (Default: black) (Reccommended: White if no albedo texture used)
- EdgeColor - The color of the edge you want to see when the dissolve occurs
- Dissolve (Slider) - Slider to check dissolve effect. 0 for complete dissolve 1 for no dissolve
- EdgeWidth - Width of the edge
- Noise Value - Varying this varies the noise level rendering different texture
- Smoothness - For texture smoothness
- Tiling - For texture tiling
- Offset - For texture offset
Note: Create a new material from the shader for each object. Use Texture for Albedo, Normal, Mettallic and Occlusion where possible for better quality.
- Attach the DissolveEffect Script to the object where you attached the material.
- Go to the DissolveShader and look at the inspector and check the properties
- Search for the value Dissolve and look at its key should be something like "Vector1_CC876C20"
- Add this to DissolveVal in the DissolveEffect Script
- The Appearance Value is by default at 0. Changing the Appearance Value results in change in the Minimum Appearance Value
- Appearance Limit is for complete appearance (By Default it is at 100), feel free to tweak these values to change the amount of appearance.
- Set Appearance Speed as you wish
- After Adding to MRTK Buttons Call:
- Function InitiateAppearance() to start appearance effect
- Function InitiateDisappearance() to start disappearance effect
- Add the ScaleEffect script to the object to scale
- Keep Scale Value 0
- Set MaxScaleValue (Keep this small in the start around 0.01 and tweak as necessary)
- Set ScaleSpeed (Should be less than Max Scale Value)
- After Adding to MRTK Buttons Call:
- Function InitiateScaling() to start auto scaling effect
- Function InitiateDescaling() to start auto descaling effect