Seaside Studios
HomeOverviewFAQsContactReview
Sprite Shader
Sprite Shader
  • What is All In 1 Sprite Shader
  • Overview
  • First Steps (Must Read)
  • Render Pipeline And Post Processing Setup
  • Asset Component Features
  • Right Click Create Material
  • Asset Window
  • Textures Setup
  • Custom Sort Axis
  • Saving Prefabs
  • Sprite Atlases
  • How to animate effects
  • Scripting
  • How to Enable/Disable Effects at Runtime
  • Random Seed
  • Scaled Time
  • UI Masking
  • 2D Renderer URP Lights
  • 3D Lights
  • Unified Outline
  • Render Material To Image
  • Compatibility with other assets
  • Effects and Properties Breakdown
  • Considerations
  • Running out of Shader Keywords
  • FAQ (Frequently Asked Questions)
Powered by GitBook
On this page

Random Seed

PreviousHow to Enable/Disable Effects at RuntimeNextScaled Time

Last updated 6 months ago

Video about it:

There are some effects with a random component (such as flicker, hologram, glitch...). By default if you have 2 instances of a material that uses these effects they will look the same and it may look bad in your game. To avoid repetition you can add the RandomSeed component to the Object that contains the Renderer (Sprite, Tilemap, Sprite Shape, Particle System, Mesh) or UI Image you want to affect.

Doing this won’t break batching as long as Gpu Instancing is enabled in the Advanced Configuration Options of the Material Inspector and the Main Texture is set directly in the Material asset. This means that you’ll need one instance of a material that is supposed to batch for each different texture you want to use.