How to add several passes to a material?

I’m working on Fur effect. How to use multipass? And each pass can tell shader the pass_index.
Is this different with pass in filter?


This is a fur vert.

    uniform float shell_distance;
    uniform float pass_index;
    varying vec2  vTexCoord;
    
    void main(void)
    {
       vTexCoord    = gl_MultiTexCoord0.xy;
       
       vec4 Position = gl_Vertex;
       Position.xyz += shell_distance * pass_index * gl_Normal; 
       gl_Position = gl_ModelViewProjectionMatrix * Position;
    }

Hi,
I tried a fur effect about a year ago or so. I’ve used instancing instead of multiple render passes. Maybe this would also be an option for you, because only one render call is needed.
See: http://www.filedropper.com/fur

1 Like

Thank you very much. It working well after I switch opengl version. I think I can use for grass.


4 Likes

Although with the test of the fur, but I still want to know how to use multipass on a material?