
To render an image, we need an orthographic camera, a texture GPU program, a quad and the image (a texture).
3D Programming, Prototyping and Gamedev with GeeXLab
To render an image, we need an orthographic camera, a texture GPU program, a quad and the image (a texture).
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.