Getting ready

For this recipe, we'll follow through with the earlier example. We'll need a single vertex shader and two compatible fragment shaders. Let's assume that the file names are separable.vert.glsl, separable1.frag.glsl, and separable2.frag.glsl.

Separable shaders require you to re-declare the built-in gl_PerVertex output block if you use any of its members. Since you will nearly always use one of its members (gl_Position), you'll very likely need to add the following to your vertex shader:

out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
};
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.98.71