Search Unity

Mask that is not re-calculated every frame.

Discussion in 'Shaders' started by malu05b, Jan 11, 2015.

  1. malu05b

    malu05b

    Joined:
    Apr 30, 2013
    Posts:
    13
    Hey.
    Im working on some controls for my new shader, and want some fancy noise to be used as a mask on it.
    However since this noise is quite GPU/CPU intensive and will only need to be controled between levels, i would love to have it only evaluate this code once i ask for it and then keep that stored untill i want to re-evaluate it.

    So my question is, is there a way to generate a texture map in-game that does not need to be re-calculated every frame?
     
  2. csantos

    csantos

    Joined:
    Dec 20, 2013
    Posts:
    7
    I suppose it's just a matter of disabling the renderer (renderer.enabled=false) on the OnPostRender function of your texture generator. Then you re-enable it whenever you'd needed to recompute your texture.
     
  3. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    322
    Is there any reason why a noise texture wouldn't do the job?