Generating Procedural Texture Inside Shader.

Hi. I’m with a silly question, i’m looking on ThinFilm shader example, there is a texture generated inside:

#define FILM_TEX_SIZE 256
Texture2D gProcFringeMap <string function = "CreateFringeMap" ;int width = FILM_TEX_SIZE;int height = 1;>;

SamplerState gFringeMapSampler
    Texture = <gProcFringeMap>;
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = WRAP;
    AddressV = WRAP;

float4 CreateFringeMap(float2 Pos:POSITION, float2 Psize : PSIZE) : COLOR
    float3 lamRGB = float3(6,5,4);
    float3 offsetRGB = (float3)0;
    float p = 60;
    float vd = p;
    float pi = 3.1415926535f;
    float3 rgb = 0.5*(sin(2*pi*(Pos.x*vd)/lamRGB + pi/2.0 + offsetRGB) + 1);
    return float4(rgb,0);

But in my case this way don’t seems to work. Do i have to do some kind of separate pass or something to make it work? Or i can evoke it from PS somehow???

float3 fringeCol = (float3)gProcFringeMap.Sample(gFringeMapSampler, IN.filmDepth);