Skip to content

Commit ef91f76

Browse files
committed
OpenGLES shader defaults fixed
1 parent 2d65880 commit ef91f76

1 file changed

Lines changed: 18 additions & 45 deletions

File tree

libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,52 +2126,23 @@ void ofGLProgrammableRenderer::drawString(const ofTrueTypeFont & font, string te
21262126
// tig: GLSL #150 shaders written against spec:
21272127
// http://www.opengl.org/registry/doc/GLSLangSpec.1.50.09.pdf
21282128

2129+
21292130
#ifdef TARGET_OPENGLES
2130-
#if defined(GL_ES_VERSION_3_0)
2131-
static const string vertex_shader_header =
2132-
"#version %glsl_version% es\n"
2133-
"precision highp float;\n"
2134-
"#define IN in\n"
2135-
"#define OUT out\n"
2136-
"#define TEXTURE texture\n"
2137-
"#define TARGET_OPENGLES\n";
2138-
2139-
static const string fragment_shader_header =
2140-
"#version %glsl_version% es\n"
2141-
"precision highp float;\n"
2142-
"#define IN in\n"
2143-
"#define OUT out\n"
2144-
"#define TEXTURE texture\n"
2145-
"#define FRAG_COLOR outputColor\n"
2146-
"#define TARGET_OPENGLES\n"
2147-
"out vec4 outputColor;\n";
2148-
#else
2149-
// OpenGL ES 2.0 / GLSL ES 1.00
2150-
static const string vertex_shader_header =
2151-
"#version %glsl_version%\n"
2152-
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
2153-
"precision highp float;\n"
2154-
"#else\n"
2155-
"precision mediump float;\n"
2156-
"#endif\n"
2157-
"#define IN attribute\n"
2158-
"#define OUT varying\n"
2159-
"#define TEXTURE texture2D\n"
2160-
"#define TARGET_OPENGLES\n";
2161-
2162-
static const string fragment_shader_header =
2163-
"#version %glsl_version%\n"
2164-
"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
2165-
"precision highp float;\n"
2166-
"#else\n"
2167-
"precision mediump float;\n"
2168-
"#endif\n"
2169-
"#define IN varying\n"
2170-
"#define OUT\n"
2171-
"#define TEXTURE texture2D\n"
2172-
"#define FRAG_COLOR gl_FragColor\n"
2173-
"#define TARGET_OPENGLES\n";
2174-
#endif
2131+
static const string vertex_shader_header =
2132+
"%extensions%\n"
2133+
"precision highp float;\n"
2134+
"#define IN attribute\n"
2135+
"#define OUT varying\n"
2136+
"#define TEXTURE texture2D\n"
2137+
"#define TARGET_OPENGLES\n";
2138+
static const string fragment_shader_header =
2139+
"%extensions%\n"
2140+
"precision highp float;\n"
2141+
"#define IN varying\n"
2142+
"#define OUT\n"
2143+
"#define TEXTURE texture2D\n"
2144+
"#define FRAG_COLOR gl_FragColor\n"
2145+
"#define TARGET_OPENGLES\n";
21752146
#else
21762147
static const string vertex_shader_header =
21772148
"#version %glsl_version%\n"
@@ -2189,6 +2160,8 @@ static const string fragment_shader_header =
21892160
"out vec4 fragColor;\n";
21902161
#endif
21912162

2163+
2164+
21922165
static const string defaultVertexShader = vertex_shader_header + STRINGIFY(
21932166
uniform mat4 projectionMatrix;
21942167
uniform mat4 modelViewMatrix;

0 commit comments

Comments
 (0)