]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
properly detect glsl 1.3 support
[xonotic/darkplaces.git] / gl_rmain.c
index 9d43f08875cd41d7667c667ac303151a420332cf..a4467e58a57f1809ccbc320602893d7bf9cf214b 100644 (file)
@@ -980,6 +980,14 @@ static void R_GLSL_CompilePermutation(r_glsl_permutation_t *p, unsigned int mode
 
        strlcat(permutationname, modeinfo->vertexfilename, sizeof(permutationname));
 
+       // if we can do #version 130, we should (this improves quality of offset/reliefmapping thanks to textureGrad)
+       if(vid.support.gl20shaders130)
+       {
+               vertstrings_list[vertstrings_count++] = "#version 130\n";
+               geomstrings_list[geomstrings_count++] = "#version 130\n";
+               fragstrings_list[fragstrings_count++] = "#version 130\n";
+       }
+
        // the first pretext is which type of shader to compile as
        // (later these will all be bound together as a program object)
        vertstrings_list[vertstrings_count++] = "#define VERTEX_SHADER\n";