diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-04-10 23:47:58 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-04-10 23:47:58 +0200 |
commit | 38885185759271ffaabcc24cad8b9c4614ee3b00 (patch) | |
tree | 192422a8262ddc7093f9d4b1af1f8e023566eac8 | |
parent | 210a5b583e2ce332f95e95e5ca183c1f92557068 (diff) |
here, have vertex colors
-rw-r--r-- | src/GPU3D_OpenGL43.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/GPU3D_OpenGL43.cpp b/src/GPU3D_OpenGL43.cpp index b4a07d3..aab8e01 100644 --- a/src/GPU3D_OpenGL43.cpp +++ b/src/GPU3D_OpenGL43.cpp @@ -69,6 +69,9 @@ PFNGLDELETEPROGRAMPROC glDeleteProgram; const char* kRenderVS = R"(#version 400 layout(location=0) in uvec4 vPosition; +layout(location=1) in uvec4 vColor; + +smooth out vec4 fColor; void main() { @@ -79,7 +82,7 @@ void main() fpos.z = 0.5; fpos.w = 1.0; - //if (fpos.y < 0.0) fpos.y = -fpos.y; + fColor = vec4(vColor) / vec4(255.0,255.0,255.0,31.0); gl_Position = fpos; } @@ -87,13 +90,18 @@ void main() const char* kRenderFS = R"(#version 400 +smooth in vec4 fColor; + out vec4 oColor; void main() { - vec4 finalcolor = vec4(0, 63.0/255.0, 63.0/255.0, 31.0/255.0); + vec4 finalcolor; + + finalcolor.rgb = fColor.rgb; + finalcolor.a = 1.0; - oColor = finalcolor.bgra; + oColor = finalcolor.bgra * vec4(63.0/255.0, 63.0/255.0, 63.0/255.0, 31.0/255.0); } )"; |