DraStic post-FX shader file format ========================================= Version: 1.0 Note: If you want to modify any of the included shaders, please copy it and create a file with another name, because it might be overwritten if we update the original. If a shader can't be compiled, you will get an error message in the app, stating that it couldn't be loaded. If that happens, you will find the shader error log dsd.log in the same directory as the .dsd file. DraStic FX file .dfx ----------------------------------------- Defines all passes, inputs and outputs. Tags: // All file-paths are relative to the .dfx's path name= textures= // GLSL code, that will be prepended to ALL vertex shaders before global header // GLSL code, that will be prepended to ALL pixel shaders before global header
// GLSL code, that will be prepended to ALL vertex and pixel shaders
// Content of file will be prepended to ALL vertex and pixel shaders // (after the header). file= // null: for FBO textures // framebuffer: DS screen framebuffer // filename.raw: for additionally needed custom textures input= // width and height are only valid for textures loaded from files. // The size of FBO-bound textures is determined by the output-scale value in the pass. width= height= // format, internalformat and type are ignored for framebuffer input format= internalformat= type= min_filter= mag_filter= // The order of tags will be the order in the render-chain // has to be the first element in the -tag shader= // The order of samplers will determine the texture unit (GL_TEXTURE0 etc.) // For the 1st pass, the first sampler will always be set to GL_TEXTURE0, // where the framebuffer texture is bound to. sampler:= // Output will be ignored for final pass, which always renders to the screen. // For previous passes, an FBO will be created and bound to this texture. // scale: an integer value determining the texture scale for render targets, // compared to the input texture (DS screen framebuffer) size. output=: DraStic shader definition file .dsd ----------------------------------------- Defines vertex and pixel shaders for 1 pass. The following variables are built-in and set for each pass, IF they are declared within the shader: // (w,h) = size in pixels of the input texture for the pass. // This will be the screen resolution (e.g. 512x394 for high-resolution) // for the first pass, and be multiplied by the output scale for the pass. uniform vec4 u_texture_size(1.0/w, 1.0/h, w, h); // (w,h) = size in pixels of the target rectangle the screen is rendered to. uniform vec2 u_target_size(w, h); // time in seconds since rendering started uniform float u_time; Tags: // Vertex shader GLSL code // Pixel shader GLSL code