Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Pointers on making simple cracks?

Discussion in 'Image Effects' started by CyberKn1ght, Jul 11, 2023.

  1. CyberKn1ght

    CyberKn1ght

    Joined:
    Apr 5, 2019
    Posts:
    16
    Hello,
    I am very new to shaders and have created a basic vignette-like shader that looks like this.

    upload_2023-7-10_16-52-26.png

    What I would like to do now is somehow create cracks in this "shield", something like this:

    upload_2023-7-10_16-50-26.png

    Where do I start to make this? Is it possible to make this procedurally? If not, I have to use a texture with the cracks already on it right? But then how will it scale with resolution, and what size should the original texture be?
    Thanks for the advice!
     
  2. bloodthirst69

    bloodthirst69

    Joined:
    Oct 1, 2017
    Posts:
    28
    I'd say go for the texture solution , as for how to scale with the size , you already have access to screen resolution and the cracks texture resolution is shader , look up Texel size , if i remember correctly TexelSize is usually a Vector4 where
    - x : 1 / width
    - y : 1 / height
    - z : width
    - w : height
    You can use those values to have a normalized size for the texture that scales consistently with the resolution