From f7a69d15ab1f43598caaa9498cc7e8aa7a11af0c Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Wed, 19 Sep 2018 13:21:02 -0700 Subject: [docs] Include uncompressed shader source in .cpp comments This is meant to (1) Make it easier for new developers to find the source (2) Make it easier to look at shader diffs when the GL JS pin changes --- src/mbgl/shaders/extrusion_texture.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/mbgl/shaders/extrusion_texture.cpp') diff --git a/src/mbgl/shaders/extrusion_texture.cpp b/src/mbgl/shaders/extrusion_texture.cpp index f529d37625..a3e857c289 100644 --- a/src/mbgl/shaders/extrusion_texture.cpp +++ b/src/mbgl/shaders/extrusion_texture.cpp @@ -10,5 +10,37 @@ const char* extrusion_texture::name = "extrusion_texture"; const char* extrusion_texture::vertexSource = source() + 35603; const char* extrusion_texture::fragmentSource = source() + 35819; +// Uncompressed source of extrusion_texture.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_world; +attribute vec2 a_pos; +varying vec2 v_pos; + +void main() { + gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1); + + v_pos.x = a_pos.x; + v_pos.y = 1.0 - a_pos.y; +} + +*/ + +// Uncompressed source of extrusion_texture.fragment.glsl: +/* +uniform sampler2D u_image; +uniform float u_opacity; +varying vec2 v_pos; + +void main() { + gl_FragColor = texture2D(u_image, v_pos) * u_opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(0.0); +#endif +} + +*/ + } // namespace shaders } // namespace mbgl -- cgit v1.2.1