90 lines
1.9 KiB
Plaintext
90 lines
1.9 KiB
Plaintext
// This is a test file for the Katepart GLSL Syntax Highlighting.
|
|
|
|
normal text
|
|
// this is a single-line comment
|
|
normal text
|
|
<beginfold id='1'>/*</beginfold id='1'> this
|
|
is a multi-line
|
|
comment <endfold id='1'>*/</endfold id='1'>
|
|
normal text
|
|
|
|
some_symbol.some_member;
|
|
some_symbol.some_member_function();
|
|
some_function();
|
|
|
|
// this is a function
|
|
void main()
|
|
<beginfold id='2'>{</beginfold id='2'>
|
|
float f = 1.4e3; // decimal float literal
|
|
int i1 = 2884; // decimal int literal
|
|
int i2 = 0x44; // hex int literal
|
|
int i3 = 0456; // octal int literal
|
|
<endfold id='2'>}</endfold id='2'>
|
|
|
|
// this is a structure
|
|
struct some_struct
|
|
<beginfold id='2'>{</beginfold id='2'>
|
|
vec3 some_member_vector;
|
|
<endfold id='2'>}</endfold id='2'>;
|
|
|
|
# this is
|
|
#preprocessor code
|
|
|
|
// all keywords
|
|
break continue do for while
|
|
if else
|
|
true false
|
|
discard return
|
|
struct
|
|
|
|
// all basic types
|
|
float int void bool
|
|
mat2 mat3 mat4
|
|
vec2 vec3 vec4
|
|
ivec2 ivec3 ivec4
|
|
bvec2 bvec3 bvec4
|
|
sampler1D sampler2D sampler3D
|
|
samplerCube sampler1DShadow sampler1DShadow
|
|
|
|
// all type qualifiers
|
|
attribute const uniform varying
|
|
in out inout
|
|
|
|
// attensions:
|
|
// FIXME
|
|
// TODO
|
|
// BUG
|
|
|
|
// some of the std functions
|
|
radians degrees sin cos tan asin acos atan
|
|
|
|
// some of the std variables
|
|
gl_Position gl_PointSize gl_ClipVertex
|
|
|
|
#version 330 core
|
|
|
|
// single line comment
|
|
|
|
<beginfold id='1'>/*</beginfold id='1'> single line commonet <endfold id='1'>*/</endfold id='1'>
|
|
|
|
<beginfold id='1'>/*</beginfold id='1'>
|
|
multi line comment
|
|
<endfold id='1'>*/</endfold id='1'>
|
|
|
|
in ColorFormat <beginfold id='2'>{</beginfold id='2'>
|
|
vec3 color;
|
|
<endfold id='2'>}</endfold id='2'> fs_in;
|
|
|
|
out vec4 fragColor;
|
|
|
|
vec3 fun(const in vec3 foo) <beginfold id='2'>{</beginfold id='2'>
|
|
foo[2] = foo.x;
|
|
|
|
return foo;
|
|
<endfold id='2'>}</endfold id='2'>
|
|
|
|
void main()
|
|
<beginfold id='2'>{</beginfold id='2'>
|
|
fragColor = vec4( fs_in.color, 1.0 );
|
|
<endfold id='2'>}</endfold id='2'>
|