Skip to content
Snippets Groups Projects
Commit 108fd508 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Really fix macos shaders this time

parent 7327624c
No related branches found
No related tags found
No related merge requests found
......@@ -767,8 +767,10 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
//backwards compatibility with legacy texture lookup syntax
extra_code_text[extra_code_count++] = strdup("#define texture2D texture\n");
extra_code_text[extra_code_count++] = strdup("#define texture3D texture\n");
extra_code_text[extra_code_count++] = strdup("#define textureCube texture\n");
extra_code_text[extra_code_count++] = strdup("#define texture2DLod textureLod\n");
extra_code_text[extra_code_count++] = strdup("#define texture3DLod textureLod\n");
extra_code_text[extra_code_count++] = strdup("#define texture2DLodOffset textureLodOffset\n");
extra_code_text[extra_code_count++] = strdup("#define shadow2D(a,b) vec2(texture(a,b))\n");
......
......@@ -22,6 +22,8 @@
* $/LicenseInfo$
*/
#extension GL_ARB_shader_texture_lod : enable
/*[EXTRA_CODE_HERE]*/
#ifdef DEFINE_GL_FRAGCOLOR
......@@ -231,7 +233,7 @@ void main()
//see https://developer.nvidia.com/gpugems/GPUGems2/gpugems2_chapter24.html
vec3 scale = (vec3(colorgrade_lut_size.x) - 1.0) / vec3(colorgrade_lut_size.x);
vec3 offset = 1.0 / (2.0 * vec3(colorgrade_lut_size.x));
diff = vec4(linear_to_srgb(texture2DLod(colorgrade_lut, scale * diff.rgb + offset, 0).rgb), diff.a);
diff = vec4(linear_to_srgb(texture3DLod(colorgrade_lut, scale * diff.rgb + offset, 0).rgb), diff.a);
#endif
frag_color = diff;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment