Skip to content

Vertex_Section

Aiekick edited this page Mar 19, 2019 · 1 revision

this section correspond to the vertex shader.

it is written like that :

@VERTEX. the possible key and parmas are QUAD() POINTS(params) MESH(params) INSTANCES(params) DISPLAY(params)

  • QUAD() it the defualt key, when you have nothing or specified. its the quad primitive like in GlslSandbox and ShaderToy

  • POINTS() it the primitve point like in VertexShaderArt. the params can be :

    • a number who correspond to the total point count : POINTS(VALUE) => POINTS(1000)
    • a slider notation, for have a slider in the left pane, for tune it : POINTS(INF:SUP:DEFAULT) => POINTS(1000:100000:50000)
    • you have a sepcific uniform for get the point count : uniform float(maxpoints) name;
  • MESH() is the primtive mesh. you can load a mesh. at this moment you can uplaod only a mesh file obj with triangular faces.

    • if you sepcify file like MESH(file.obj). the mesh will be loaded auto matically after section header modification
    • if you specify params or nothings, you always loa a file after (in the left pane)
  • INSTANCES() is the instance count, like point you can sepcify a number or a slider notation, and in this case you have a slider in the left pane

    • you have a specific uniform for get the instances count : uniform float(maxinstances) name;
    • see this sample if you want : SdfInstancing
  • DISPLAY() is a params for permit the render mode of the meshs. you have many possibilities :

    • DISPLAY(POINT¨S,LINES,TRIANGLES) like that you have a combobox in the left pane for choice the render mode in this list
    • DISPLAY() you have the full choice, LINES / LINE_STRIP / LOOP / POINTS / TRIANGLES / TRIANGLES_FAN / TRIANGLES_STRIP. its the defualt if you have write nothings
    • DISPLAY(TRIANGLES), no combobox, here, the only possible render mode is fixed like that

after the section you need to write that (classic glsl) :

for QUAD : layout(location = 0) in vec2 name;

for POINTs : layout(location = 0) in float vertexIdName;

for mesh : maybe you mesh not have vertex color or normal bu if yes you need that layout(location = 0) in vec3 pos; layout(location = 1) in vec3 normalname; layout(location = 2) in vec4 colorName;

you can define what you want for these names, the important things is the location number

Clone this wiki locally