Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-08-31 03:49:35 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-08-31 03:49:35 +0400
commit60ff60dcdc9f43891fb8a19e10f9bb7964a539bf (patch)
treeced8e2887295b713d67dfd496728703c71f53442 /intern/opencolorio/ocio_impl_glsl.cc
parent6785874e7adf5ef15e7a28b134b2bd4e8b3a8988 (diff)
RenderEngine API: add viewport draw utility functions to bind a GLSL fragment
shader for converting colors from linear to display space, based on the scene color management settings. if engine.support_display_space_shader(scene): # test graphics card support engine.bind_display_space_shader(scene) # draw pixels .. engine.unbind_display_space_shader()
Diffstat (limited to 'intern/opencolorio/ocio_impl_glsl.cc')
-rw-r--r--intern/opencolorio/ocio_impl_glsl.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 54be1e0f339..1a3132fa4b3 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -36,12 +36,7 @@
#include <sstream>
#include <string.h>
-#ifdef __APPLE__
-#include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
-#else
#include <GL/glew.h>
-#endif
#include <OpenColorIO/OpenColorIO.h>
@@ -202,6 +197,13 @@ static bool ensureLUT3DAllocated(OCIO_GLSLDrawState *state)
return state->lut3d_texture_valid;
}
+/* Detect if we can support GLSL drawing */
+bool OCIOImpl::supportGLSLDraw()
+{
+ /* GLSL and GL_RGB16F_ARB */
+ return GLEW_VERSION_2_0 && (GLEW_VERSION_3_0 || GLEW_ARB_texture_float);
+}
+
/**
* Setup OpenGL contexts for a transform defined by processor using GLSL
* All LUT allocating baking and shader compilation happens here.