pw.full_glsl(full_glslCode)


Description :

  • Render glsl code.

Parameters :

  • pw.full_glsl(full_glslCode).
  • pw.full_glsl(full_glslCode,useBuffer).
  • full_glslCode : string (See sample code)
  • useBuffer : bool

Return :

  • No return.

Error :

  • Error message from GLSL render machine will be thrown.

Sample code :

  • This code gives us exactly the same effect as sample code in pw.glsl. The main difference is that you should write the prefix code by yourself.

full_glsl.lua

pw.full_glsl([==[
    #version 330 core
    #define gl_Position uv2xy(uv)
    #define gl_FragCoord uv2xy(uv)
    #define gl_FragColor outColor
    #define INPUT_LAYER_INDEX -1
    #define OUTPUT_LAYER_INDEX -2
    out vec4 outColor;
    in vec2 uv;
    uniform float slider[10];
    uniform float angle[10];
    uniform bool checkbox[10];
    uniform vec2 point[10];
    uniform vec3 point3d[10];
    uniform vec4 color[10];
    uniform sampler2D layer[10];
    uniform vec2 layerResolution[10];
    uniform sampler2D inLayer;
    uniform sampler2D outLayer;
    uniform float time;
    uniform float fps;
    uniform float width;
    uniform float height;
    uniform vec2 origin;
    uniform vec2 resolution;

    void main(){
        outColor = vec4(uv,mod(time,1),1);
    }
]==])

results matching ""

    No results matching ""