Skip to content

07. Preprocessor

3Dickulus edited this page Dec 25, 2021 · 4 revisions
 #include "some.frag"

Simply includes the referenced file. If the filename is a relative filename, Fragmentarium first searches for the file relative to the location of the current executing file (if it is saved), otherwise the paths specified in the 'include path' preference are searched.

 #camera 3D

Tells Fragmentarium to setup a 3D camera model, making it possible to adjust the camera using the mouse on the canvas.

 #camera 2D

Tells Fragmentarium to setup a 2D camera model.

 #group parameter group name

Makes it possible to arrange GUI elements in groups.

 #info "hello there"

Outputs info when compiling the fragment. Useful for attributions.

 #includeonly "some.frag"

Experimental. Includes 'some.frag', but will ignore any 'include' commands in that file.

 #replace "before" "after"

Experimental. Replaces the given patterns in all subsequent read lines (not in previously parsed lines).

 #donotrun

Tells Fragmentarium that it should not attempt to run this file - it is meant be included from another file.

 #preset name

Marks the beginning of a section with parameter settings. These will appear in a drop-down combobox in the parameter editor window.

 #endpreset

Marks the end of a section with parameter settings.

 #TexParameter textureName option value

Expects three arguments. In a fragment this should create a mipmapped texture.

 uniform sampler2D myTexture; file[test.png]
 #TexParameter myTexture GL_TEXTURE_MAX_LEVEL 1000
 #TexParameter myTexture GL_TEXTURE_WRAP_S GL_REPEAT
 #TexParameter myTexture GL_TEXTURE_WRAP_T GL_REPEAT
 #TexParameter myTexture GL_TEXTURE_MAG_FILTER GL_LINEAR
 #TexParameter myTexture GL_TEXTURE_MIN_FILTER GL_LINEAR_MIPMAP_LINEAR
 #buffer

Sets buffer type defaults as RGBA8 if not set, uses RGBA32F if set to unknown type. Accepts NONE RGBA8 RGBA16 RGBA16F RGBA32F

 #vertex

Marks the start of vertex shader program code, used in raytracer fragments and buffershader fragments.

 #endvertex

Marks the end of vertex shader program code.

Clone this wiki locally