X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=shader_glsl.h;h=e924413d44604052812c7ffe4b3fc1a55fbcbdb7;hb=6b204d1e2c6cf188ec0011e30be82a83c2d156e7;hp=23f3946ceee7cdafe0aee5bc8b66d31806cf9ab2;hpb=bb6a43721c009ab177d4f2cc4d6515516bf45b68;p=xonotic%2Fdarkplaces.git diff --git a/shader_glsl.h b/shader_glsl.h index 23f3946c..e924413d 100644 --- a/shader_glsl.h +++ b/shader_glsl.h @@ -2,14 +2,8 @@ "// written by Forest 'LordHavoc' Hale\n" "// shadowmapping enhancements by Lee 'eihrul' Salzman\n" "\n" -"// GL ES shaders use precision modifiers, standard GL does not\n" -"#ifndef GL_ES\n" -"#define lowp\n" -"#define mediump\n" -"#define highp\n" -"#endif\n" -"\n" "#ifdef GLSL130\n" +"precision highp float;\n" "# ifdef VERTEX_SHADER\n" "# define dp_varying out\n" "# define dp_attribute in\n" @@ -20,7 +14,7 @@ "# define dp_attribute in\n" "# endif\n" "# define dp_offsetmapping_dFdx dFdx\n" -"# define dp_offsetmapping_dFdy dFdx\n" +"# define dp_offsetmapping_dFdy dFdy\n" "# define dp_textureGrad textureGrad\n" "# define dp_texture2D texture\n" "# define dp_texture3D texture\n" @@ -41,6 +35,14 @@ "# define dp_shadow2D(a,b) float(shadow2D(a,b))\n" "#endif\n" "\n" +"// GL ES and GLSL130 shaders use precision modifiers, standard GL does not\n" +"// in GLSL130 we don't use them though because of syntax differences (can't use precision with inout)\n" +"#ifndef GL_ES\n" +"#define lowp\n" +"#define mediump\n" +"#define highp\n" +"#endif\n" +"\n" "#ifdef VERTEX_SHADER\n" "dp_attribute vec4 Attrib_Position; // vertex\n" "dp_attribute vec4 Attrib_Color; // color\n" @@ -1027,7 +1029,7 @@ "# endif\n" "#endif\n" "\n" -" // transform vertex to camera space, using ftransform to match non-VS rendering\n" +" // transform vertex to clipspace (post-projection, but before perspective divide by W occurs)\n" " gl_Position = ModelViewProjectionMatrix * Attrib_Position;\n" "\n" "#ifdef USESHADOWMAPORTHO\n"