Tag Archives: vertex

How to Build and Draw a simple Triangle


Remark: in the following article, words GLSL Hacker and GeeXLab are swappable! They represent the same software with a different name…


Today we are going to see how to build and render a simple scene that includes a camera, a triangle, a reference grid and a GPU program (in GLSL). GLSL Hacker supports both Lua and Python programming languages. We will use Lua for this article. So let’s go!

Continue reading »

How to Use a GLSL Program


GLSL Hacker - How to Use a GLSL Program

Let’s suppose you just found this cool GLSL program somewhere on the Net:

Vertex shader:

#version 120
void main()
{
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

Pixel shader:

#version 120
void main()
{
  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}

Now, let’s suppose you want to test it with a mesh torus. The first thing to do is to create a XML node for the GLSL program in the main XML file.

Continue reading »