1
0
forked from 0ad/0ad

Convert shaders to GLSL ES automatically

This was SVN commit r11079.
This commit is contained in:
Ykkrosh 2012-02-15 20:33:43 +00:00
parent 56378ea9f1
commit 5f6e3de42f

View File

@ -398,6 +398,13 @@ public:
CStr vertexCode = Preprocess(preprocessor, vertexFile.GetAsString());
CStr fragmentCode = Preprocess(preprocessor, fragmentFile.GetAsString());
#if CONFIG2_GLES
// Ugly hack to replace desktop GLSL 1.10 with GLSL ES 1.00,
// and also to set default float precision for fragment shaders
vertexCode.Replace("#version 110\n", "#version 100\n");
fragmentCode.Replace("#version 110\n", "#version 100\nprecision highp float;\n");
#endif
if (!Compile(m_VertexShader, m_VertexFile, vertexCode))
return;