add drawPoint/drawLine (both slow) and drawPoints (faster) to GLInstancingRenderer, with GLSL shaders

This commit is contained in:
erwincoumans
2013-09-06 12:05:56 -07:00
parent b1bab032b1
commit ef42c17143
7 changed files with 209 additions and 34 deletions

View File

@@ -0,0 +1,10 @@
#version 150
in vec4 colourV;
out vec4 fragColour;
void main(void)
{
fragColour = colourV;
}

View File

@@ -0,0 +1,10 @@
//this file is autogenerated using stringify.bat (premake --stringify) in the build folder of this project
static const char* linesFragmentShader= \
"#version 150\n"
"in vec4 colourV;\n"
"out vec4 fragColour;\n"
"void main(void)\n"
"{\n"
" fragColour = colourV;\n"
"}\n"
;

View File

@@ -0,0 +1,17 @@
#version 150
uniform mat4 ModelViewMatrix;
uniform mat4 ProjectionMatrix;
uniform vec4 colour;
in vec4 position;
out vec4 colourV;
void main (void)
{
colourV = colour;
gl_Position = ProjectionMatrix * ModelViewMatrix * position;
}

View File

@@ -0,0 +1,15 @@
//this file is autogenerated using stringify.bat (premake --stringify) in the build folder of this project
static const char* linesVertexShader= \
"#version 150 \n"
"uniform mat4 ModelViewMatrix;\n"
"uniform mat4 ProjectionMatrix;\n"
"uniform vec4 colour;\n"
"in vec4 position;\n"
"out vec4 colourV;\n"
"void main (void)\n"
"{\n"
" colourV = colour;\n"
" gl_Position = ProjectionMatrix * ModelViewMatrix * position;\n"
" \n"
"}\n"
;