Commit 0f750114 authored by Ken Martin's avatar Ken Martin

Remove ES2 support for VTK 8.0

ES2 is causing headaches and code mess and is
getting old. Remove for 8.0 so we can focus on
more modern APIs. Most Apple and Adroid devices
from the past 4 years support ES3.
parent 9b98ff33
......@@ -15,9 +15,6 @@ set(PREFIX_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Prefix)
set(BUILD_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Build)
set(INSTALL_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Install)
set(OPENGL_ES_VERSION "2.0" CACHE STRING "OpenGL ES version (2.0 or 3.0)")
set_property(CACHE OPENGL_ES_VERSION PROPERTY STRINGS 2.0 3.0)
# Android options
# Android options
if (DEFINED ENV{ANDROID_NDK})
......@@ -90,7 +87,6 @@ set(android_cmake_flags
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DVTK_RENDERING_BACKEND:STRING=OpenGL2
-DOPENGL_ES_VERSION:STRING=${OPENGL_ES_VERSION}
-DVTK_Group_Rendering:BOOL=OFF
-DVTK_Group_StandAlone:BOOL=OFF
-DVTK_Group_Imaging:BOOL=OFF
......@@ -115,15 +111,9 @@ set(android_cmake_flags
-DModule_vtkRenderingFreeType:BOOL=ON
-DModule_vtkTestingCore:BOOL=ON
-DModule_vtkTestingRendering:BOOL=ON
-DModule_vtkRenderingVolumeOpenGL2:BOOL=ON
)
# add volume rendering for ES 3.0
if (OPENGL_ES_VERSION STREQUAL "3.0")
set(android_cmake_flags ${android_cmake_flags}
-DModule_vtkRenderingVolumeOpenGL2:BOOL=ON
)
endif()
macro(crosscompile target api abi out_build_dir)
set(_ANDROID_API "${api}")
set(_ANDROID_ABI "${abi}")
......
......@@ -10,10 +10,6 @@ file(REMOVE_RECURSE ${PREFIX_DIR})
file(REMOVE_RECURSE ${BUILD_DIR})
file(REMOVE_RECURSE ${INSTALL_DIR})
# Options for iOS
set(OPENGL_ES_VERSION "2.0" CACHE STRING "OpenGL ES version (2.0 or 3.0)")
set_property(CACHE OPENGL_ES_VERSION PROPERTY STRINGS 2.0 3.0)
set(IOS_SIMULATOR_ARCHITECTURES "i386;x86_64"
CACHE STRING "iOS Simulator Architectures")
set(IOS_DEVICE_ARCHITECTURES "arm64;armv7;armv7s"
......@@ -99,13 +95,9 @@ option(Module_vtkIOImage "Turn on or off this module" OFF)
option(Module_vtkIOPLY "Turn on or off this module" OFF)
option(Module_vtkIOInfovis "Turn on or off this module" OFF)
option(Module_vtkRenderingFreeType "Turn on or off this module" OFF)
option(Module_vtkRenderingVolumeOpenGL2 "Include Volume Rendering Support" ON)
# add volume rendering option for ES 3.0
if (OPENGL_ES_VERSION STREQUAL "3.0" AND Module_vtkRenderingOpenGL2)
option(Module_vtkRenderingVolumeOpenGL2 "Include Volume Rendering Support" ON)
endif()
mark_as_advanced(Module_${vtk-module})
# Now cross-compile VTK with custom toolchains
......@@ -113,7 +105,6 @@ set(ios_cmake_flags
-DBUILD_SHARED_LIBS:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DOPENGL_ES_VERSION:STRING=${OPENGL_ES_VERSION}
-DVTK_Group_Rendering:BOOL=OFF
-DVTK_Group_StandAlone:BOOL=OFF
-DVTK_Group_Imaging:BOOL=OFF
......
......@@ -155,25 +155,11 @@ if (ANDROID OR APPLE_IOS)
SET( KWSYS_LFS_WORKS__TRYRUN_OUTPUT ""
CACHE STRING "Output from TRY_RUN" FORCE)
# need int version for CPP
if (OPENGL_ES_VERSION STREQUAL "2.0")
set(OPENGL_ES_VERSION_INT 20)
endif()
if (OPENGL_ES_VERSION STREQUAL "3.0")
set(OPENGL_ES_VERSION_INT 30)
endif()
if (APPLE_IOS)
unset(OPENGL_INCLUDE_DIR CACHE)
if (OPENGL_ES_VERSION STREQUAL "2.0")
find_path(OPENGL_INCLUDE_DIR ES2/gl.h
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGLES.framework/Headers
${_OPENGL_INCLUDE_DIR})
elseif (OPENGL_ES_VERSION STREQUAL "3.0")
find_path(OPENGL_INCLUDE_DIR ES3/gl.h
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGLES.framework/Headers
${_OPENGL_INCLUDE_DIR})
endif()
find_path(OPENGL_INCLUDE_DIR ES3/gl.h
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGLES.framework/Headers
${_OPENGL_INCLUDE_DIR})
find_library(OPENGL_gl_LIBRARY
NAMES OpenGLES
PATHS
......@@ -185,13 +171,8 @@ if (ANDROID OR APPLE_IOS)
unset(OPENGL_gl_LIBRARY CACHE)
unset(OPENGL_egl_LIBRARY CACHE)
if (OPENGL_ES_VERSION STREQUAL "2.0")
find_path(OPENGL_INCLUDE_DIR GLES2/gl2.h)
find_library(OPENGL_gl_LIBRARY NAMES GLESv2)
elseif (OPENGL_ES_VERSION STREQUAL "3.0")
find_path(OPENGL_INCLUDE_DIR GLES3/gl3.h)
find_library(OPENGL_gl_LIBRARY NAMES GLESv3)
endif()
find_path(OPENGL_INCLUDE_DIR GLES3/gl3.h)
find_library(OPENGL_gl_LIBRARY NAMES GLESv3)
find_library(OPENGL_egl_LIBRARY NAMES EGL)
endif()
else()
......
add_subdirectory(NativeVTK)
add_subdirectory(JavaVTK)
if (OPENGL_ES_VERSION STREQUAL "3.0")
add_subdirectory(VolumeRender)
endif()
\ No newline at end of file
add_subdirectory(VolumeRender)
......@@ -17,9 +17,6 @@ directory in vtkios ala cd vtkios; mkdir install
* Change the VTK_INSTALL_PREFIX to where you want the framework written.
* If you want OpenGL ES 3.0 support make sure to change the setting of
* OPENGL_ES_VERSION to 3.0. Volume Rendering requires ES 3.0.
* configure and generate as usual
* Once done build your framework using make or ninja for the build process.
......
......@@ -21,8 +21,10 @@ set(Module_SRCS
vtkDepthOfFieldPass.cxx
vtkDepthImageProcessingPass.cxx
vtkDepthPeelingPass.cxx
vtkDualDepthPeelingPass.cxx
vtkEDLShading.cxx
vtkFrameBufferObject.cxx
vtkFrameBufferObject2.cxx
vtkGaussianBlurPass.cxx
vtkGenericOpenGLRenderWindow.cxx
vtkHiddenLineRemovalPass.cxx
......@@ -65,9 +67,11 @@ set(Module_SRCS
vtkOpenGLVertexArrayObject.cxx
vtkOpenGLVertexBufferObject.cxx
vtkOverlayPass.cxx
vtkPixelBufferObject.cxx
vtkPointFillPass.cxx
vtkRenderPassCollection.cxx
vtkRenderStepsPass.cxx
vtkRenderbuffer.cxx
vtkSSAAPass.cxx
vtkSequencePass.cxx
vtkShader.cxx
......@@ -79,30 +83,15 @@ set(Module_SRCS
vtkTextureUnitManager.cxx
vtkTransformFeedback.cxx
vtkTranslucentPass.cxx
vtkValuePass.cxx
vtkValuePassHelper.cxx
vtkVolumetricPass.cxx
)
if (NOT DEFINED OPENGL_ES_VERSION)
set(Module_SRCS ${Module_SRCS}
vtkDataTransferHelper.cxx
vtkDualDepthPeelingPass.cxx # Needs GL_MAX
vtkFrameBufferObject2.cxx
vtkPixelBufferObject.cxx
vtkRenderbuffer.cxx
vtkValuePass.cxx
vtkValuePassHelper.cxx
)
else()
if (${OPENGL_ES_VERSION} MATCHES 3.0)
set(Module_SRCS ${Module_SRCS}
vtkDualDepthPeelingPass.cxx # Needs GL_MAX
vtkFrameBufferObject2.cxx
vtkPixelBufferObject.cxx
vtkRenderbuffer.cxx
vtkValuePass.cxx
vtkValuePassHelper.cxx
)
endif()
endif()
set(${vtk-module}_HDRS
......
......@@ -52,7 +52,7 @@ void vtkClearZPass::Render(const vtkRenderState *s)
this->NumberOfRenderedProps=0;
glDepthMask(GL_TRUE);
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glClearDepth(this->Depth);
#else
glClearDepthf(static_cast<GLclampf>(this->Depth));
......
......@@ -383,8 +383,8 @@ void vtkCompositeMapperHelper2::DrawIBO(
if (pointSize > 0)
{
#if GL_ES_VERSION_2_0 != 1
glPointSize(pointSize);
#if GL_ES_VERSION_3_0 != 1
glPointSize(pointSize); // need to use shader value
#endif
}
// First we do the triangles, update the shader, set uniforms, etc.
......
......@@ -122,7 +122,7 @@ void vtkDepthOfFieldPass::Render(const vtkRenderState *s)
this->FrameBufferObject->SetActiveBuffer(0);
this->FrameBufferObject->SetDepthBufferNeeded(true);
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
GLint savedCurrentDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedCurrentDrawBuffer);
#endif
......@@ -134,7 +134,7 @@ void vtkDepthOfFieldPass::Render(const vtkRenderState *s)
else
{
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedCurrentDrawBuffer));
#endif
}
......@@ -150,7 +150,7 @@ void vtkDepthOfFieldPass::Render(const vtkRenderState *s)
return;
}
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
GLint savedDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedDrawBuffer);
#endif
......@@ -210,7 +210,7 @@ void vtkDepthOfFieldPass::Render(const vtkRenderState *s)
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedDrawBuffer));
#endif
......
......@@ -431,7 +431,7 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
unsigned int threshold=
static_cast<unsigned int>(this->ViewportWidth*this->ViewportHeight*OcclusionRatio);
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
GLuint queryId;
glGenQueries(1,&queryId);
#endif
......@@ -449,7 +449,7 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// render the translucent geometry
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glBeginQuery(GL_SAMPLES_PASSED,queryId);
#endif
......@@ -469,7 +469,7 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
glDepthFunc( GL_LEQUAL );
glDisable(GL_BLEND);
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glEndQuery(GL_SAMPLES_PASSED);
glGetQueryObjectuiv(queryId,GL_QUERY_RESULT,&nbPixels);
#endif
......
......@@ -602,7 +602,7 @@ bool vtkEDLShading::EDLCompose(const vtkRenderState *,
//
// Prepare blitting
glClearColor(1., 1., 1., 1.);
#if GL_ES_VERSION_2_0 == 1
#if GL_ES_VERSION_3_0 == 1
glClearDepthf(static_cast<GLclampf>(1.0));
#else
glClearDepth(static_cast<GLclampf>(1.0));
......@@ -652,7 +652,7 @@ void vtkEDLShading::Render(const vtkRenderState *s)
if (this->DelegatePass != 0)
{
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
GLint savedCurrentDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedCurrentDrawBuffer);
#endif
......@@ -717,7 +717,7 @@ void vtkEDLShading::Render(const vtkRenderState *s)
#if EDL_LOW_RESOLUTION_ON
if(! this->EDLShadeLow(s2, renWin) )
{
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedCurrentDrawBuffer));
#endif
}
......@@ -735,7 +735,7 @@ void vtkEDLShading::Render(const vtkRenderState *s)
{
vtkFrameBufferObject::SafeDownCast(s->GetFrameBuffer())->Bind();
}
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedCurrentDrawBuffer));
#endif
......
......@@ -98,7 +98,7 @@ bool vtkFrameBufferObject::IsSupported(vtkOpenGLRenderWindow *)
return true;
}
#if GL_ES_VERSION_2_0 == 1
#if GL_ES_VERSION_3_0 == 1
bool fbo = true;
bool fboBlit = true;
#else
......@@ -117,7 +117,7 @@ bool vtkFrameBufferObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *)
return true;
}
#if GL_ES_VERSION_2_0 == 1
#if GL_ES_VERSION_3_0 == 1
bool fbo = true;
bool fboBlit = true;
#else
......@@ -263,12 +263,6 @@ void vtkFrameBufferObject::SetActiveBuffers(int num, unsigned int indices[])
//----------------------------------------------------------------------------
void vtkFrameBufferObject::ActivateBuffers()
{
#if GL_ES_VERSION_2_0 == 1 && GL_ES_VERSION_3_0 != 1
if (this->ActiveBuffers.size() > 1)
{
vtkErrorMacro("OpenGL ES2 only supports one FBO destinaiton");
}
#else
GLint maxbuffers;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxbuffers);
......@@ -285,7 +279,6 @@ void vtkFrameBufferObject::ActivateBuffers()
vtkOpenGLCheckErrorMacro("failed at glDrawBuffers");
delete[] buffers;
#endif
}
//----------------------------------------------------------------------------
......@@ -344,19 +337,11 @@ void vtkFrameBufferObject::CreateDepthBuffer(
vtkOpenGLCheckErrorMacro("failed at glBindRenderbuffer");
// Assign storage to this depth buffer.
#if GL_ES_VERSION_2_0 == 1 && GL_ES_VERSION_3_0 != 1
glRenderbufferStorage(
GL_RENDERBUFFER,
GL_DEPTH_COMPONENT,
width,
height);
#else
glRenderbufferStorage(
GL_RENDERBUFFER,
GL_DEPTH_COMPONENT24,
width,
height);
#endif
vtkOpenGLCheckErrorMacro("failed at glRenderbufferStorage");
......@@ -461,7 +446,7 @@ void vtkFrameBufferObject::CreateColorBuffers(
if (colorBuffer->GetNumberOfDimensions() == 3)
{
assert(this->UserZSlices[cc]<colorBuffer->GetDepth());
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glFramebufferTexture3D(
(GLenum)mode,
GL_COLOR_ATTACHMENT0 + cc,
......@@ -502,13 +487,9 @@ unsigned int vtkFrameBufferObject::GetMaximumNumberOfActiveTargets()
unsigned int result = 0;
if (this->Context)
{
#if GL_ES_VERSION_2_0 == 1 && GL_ES_VERSION_3_0 != 1
result = 1;
#else
GLint maxbuffers;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxbuffers);
result = static_cast<unsigned int>(maxbuffers);
#endif
}
return result;
}
......@@ -519,13 +500,9 @@ unsigned int vtkFrameBufferObject::GetMaximumNumberOfRenderTargets()
unsigned int result = 0;
if (this->Context)
{
#if GL_ES_VERSION_2_0 == 1 && GL_ES_VERSION_3_0 != 1
result = 1;
#else
GLint maxColorAttachments;
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS,&maxColorAttachments);
result = static_cast<unsigned int>(maxColorAttachments);
#endif
}
return result;
}
......@@ -617,9 +594,6 @@ void vtkFrameBufferObject::DisplayFrameBufferAttachments()
cout<<"Current framebuffer is bind to framebuffer object "
<<framebufferBinding<<endl;
#if GL_ES_VERSION_2_0 == 1 && GL_ES_VERSION_3_0 != 1
this->DisplayFrameBufferAttachment(GL_COLOR_ATTACHMENT0);
#else
GLint maxColorAttachments;
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS,&maxColorAttachments);
vtkOpenGLCheckErrorMacro("after getting MAX_COLOR_ATTACHMENTS");
......@@ -630,7 +604,6 @@ void vtkFrameBufferObject::DisplayFrameBufferAttachments()
this->DisplayFrameBufferAttachment(GL_COLOR_ATTACHMENT0+i);
++i;
}
#endif
cout<<"depth attachement :"<<endl;
this->DisplayFrameBufferAttachment(GL_DEPTH_ATTACHMENT);
cout<<"stencil attachement :"<<endl;
......@@ -774,7 +747,6 @@ void vtkFrameBufferObject::DisplayFrameBufferAttachment(
// Display the draw buffers.
void vtkFrameBufferObject::DisplayDrawBuffers()
{
#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
GLint ivalue = 1;
glGetIntegerv(GL_MAX_DRAW_BUFFERS,&ivalue);
......@@ -805,9 +777,6 @@ void vtkFrameBufferObject::DisplayDrawBuffers()
cout << endl;
++i;
}
#else
cout << "there is 1 draw buffer." << endl;
#endif
}
// ----------------------------------------------------------------------------
......@@ -815,13 +784,11 @@ void vtkFrameBufferObject::DisplayDrawBuffers()
// Display the read buffer.
void vtkFrameBufferObject::DisplayReadBuffer()
{
#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
GLint ivalue;
glGetIntegerv(GL_READ_BUFFER,&ivalue);
cout << "read buffer=";
this->DisplayBuffer(ivalue);
cout<<endl;
#endif
}
// ----------------------------------------------------------------------------
......@@ -836,7 +803,7 @@ void vtkFrameBufferObject::DisplayBuffer(int value)
}
else
{
#if GL_ES_VERSION_2_0 == 1
#if GL_ES_VERSION_3_0 == 1
vtkErrorMacro("Attempt to use bad display destintation");
#else
if(value>=GL_AUX0)
......
......@@ -134,7 +134,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
this->FrameBufferObject->SetActiveBuffer(0);
this->FrameBufferObject->SetDepthBufferNeeded(true);
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
GLint savedCurrentDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedCurrentDrawBuffer);
#endif
......@@ -146,7 +146,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
else
{
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedCurrentDrawBuffer));
#endif
}
......@@ -163,7 +163,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
return;
}
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
GLint savedDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedDrawBuffer);
#endif
......@@ -303,7 +303,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
// restore some state.
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedDrawBuffer));
#endif
return;
......@@ -398,7 +398,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDrawBuffer(static_cast<GLenum>(savedDrawBuffer));
#endif
......
......@@ -79,7 +79,7 @@ const char *vtkOpenGLStrError(unsigned int code)
return "Invalid operation";
case GL_OUT_OF_MEMORY:
return "Out of memory";
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
case GL_STACK_OVERFLOW:
return "Stack overflow";
case GL_STACK_UNDERFLOW:
......
......@@ -251,7 +251,7 @@ void vtkOpenGLFXAAFilter::CreateGLObjects()
// ES doesn't support GL_RGB8, and OpenGL 3 doesn't support GL_RGB.
// What a world.
#if defined(GL_ES_VERSION_3_0) || defined(GL_ES_VERSION_2_0)
#if defined(GL_ES_VERSION_3_0)
this->Input->SetInternalFormat(GL_RGB);
#else // OpenGL ES
this->Input->SetInternalFormat(GL_RGB8);
......
......@@ -390,7 +390,6 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
int representation = actor->GetProperty()->GetRepresentation();
#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
if (actor->GetProperty()->GetRepresentation() == VTK_SURFACE &&
!selector && GLEW_ARB_instanced_arrays)
{
......@@ -398,7 +397,6 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
colors, matrices, normalMatrices, pointMTime);
return;
}
#endif
bool primed = false;
......@@ -407,7 +405,7 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
(representation == VTK_WIREFRAME) ? GL_LINES : GL_TRIANGLES;
if (selecting_points)
{
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glPointSize(6.0);
#endif
mode = GL_POINTS;
......@@ -511,7 +509,6 @@ void vtkOpenGLGlyph3DHelper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
}
}
#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
void vtkOpenGLGlyph3DHelper::GlyphRenderInstances(
vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
std::vector<unsigned char> &colors, std::vector<float> &matrices,
......@@ -589,7 +586,6 @@ void vtkOpenGLGlyph3DHelper::GlyphRenderInstances(
this->Primitives[PrimitiveTris].IBO->Release();
this->RenderPieceFinish(ren, actor);
}
#endif
//-----------------------------------------------------------------------------
void vtkOpenGLGlyph3DHelper::PrintSelf(ostream& os, vtkIndent indent)
......
......@@ -74,12 +74,10 @@ protected:
~vtkOpenGLGlyph3DHelper();
// special opengl 32 version that uses instances
#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
void GlyphRenderInstances(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
std::vector<unsigned char> &colors, std::vector<float> &matrices,
std::vector<float> &normalMatrices,
vtkMTimeType pointMTime);
#endif
/**
* Create the basic shaders before replacement
......
......@@ -89,7 +89,7 @@ public:
{
if (this->MultisampleSupport)
{
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
if (mode)
{
glEnable(GL_MULTISAMPLE);
......@@ -106,7 +106,7 @@ public:
// Check if multisample is enabled.
bool QueryMultisampling()
{
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
if (this->MultisampleSupport && glIsEnabled(GL_MULTISAMPLE))
{
return true;
......
......@@ -50,11 +50,9 @@
#include "vtkTextureObject.h"
#include "vtkTransform.h"
#include "vtkUnsignedIntArray.h"
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
#include "vtkShadowMapPass.h"
#include "vtkValuePass.h"
#include "vtkValuePassHelper.h"
#endif
#include "vtkShadowMapPass.h"
// Bring in our fragment lit shader symbols.
#include "vtkPolyDataVS.h"
......@@ -116,9 +114,7 @@ vtkOpenGLPolyDataMapper::vtkOpenGLPolyDataMapper()
this->TimerQuery = 0;
this->ResourceCallback = new vtkOpenGLResourceFreeCallback<vtkOpenGLPolyDataMapper>(this,
&vtkOpenGLPolyDataMapper::ReleaseGraphicsResources);
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
this->ValuePassHelper = vtkSmartPointer<vtkValuePassHelper>::New();
#endif
}
//-----------------------------------------------------------------------------
......@@ -213,9 +209,7 @@ void vtkOpenGLPolyDataMapper::ReleaseGraphicsResources(vtkWindow* win)
this->CellNormalBuffer->ReleaseGraphicsResources();
}
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
this->ValuePassHelper->ReleaseGraphicsResources(win);
#endif
if (this->AppleBugPrimIDBuffer)
{
......@@ -223,7 +217,7 @@ void vtkOpenGLPolyDataMapper::ReleaseGraphicsResources(vtkWindow* win)
}
if (this->TimerQuery)
{
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
#if GL_ES_VERSION_3_0 != 1
glDeleteQueries(1, &this->TimerQuery);
#endif
this->TimerQuery = 0;
......@@ -586,12 +580,10 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
" vec3 diffuseColor;\n"
" float opacity;\n";
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
if (this->ValuePassHelper->GetRenderingMode() == vtkValuePass::FLOATING_POINT)
{
this->ValuePassHelper->UpdateShaders(VSSource, FSSource, colorImpl);
}
#endif
if (this->LastLightComplexity[this->LastBoundBO])
{
......@@ -802,14 +794,12 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderLight(
}
int lastLightComplexity = this->LastLightComplexity[this->LastBoundBO];
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
if (info && info->Has(vtkValuePass::RENDER_VALUES()))
{
// Although vtkValuePass::FLOATING_POINT does not require this, it is for
// simplicity left unchanged (only required when using INVERTIBLE_LUT mode).
lastLightComplexity = 0;
}
#endif
switch (lastLightComplexity)
{
......@@ -1702,9 +1692,7 @@ bool vtkOpenGLPolyDataMapper::GetNeedToRebuildShaders(
cellBO.ShaderSourceTime < this->SelectionStateChanged ||
cellBO.ShaderSourceTime < renderPassMTime ||
cellBO.ShaderSourceTime < this->LightComplexityChanged[&cellBO]
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
|| this->ValuePassHelper->RequiresShaderRebuild()
#endif
)
{
return true;
......@@ -1837,12 +1825,10 @@ void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
}
}
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
if (this->ValuePassHelper->GetRenderingMode() == vtkValuePass::FLOATING_POINT)
{
this->ValuePassHelper->BindAttributes(cellBO);
}
#endif
cellBO.AttributeUpdateTime.Modified();
}
......@@ -1895,12 +1881,10 @@ void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
cellBO.Program->SetUniformi("textureN", tunit);
}
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
if (this->ValuePassHelper->GetRenderingMode() == vtkValuePass::FLOATING_POINT)
{
this->ValuePassHelper->BindUniforms(cellBO);
}
#endif
// Handle render pass setup:
vtkInformation *info = actor->GetPropertyKeys();
......@@ -2409,13 +2393,13 @@ void vtkOpenGLPolyDataMapper::GetCoincidentParameters(
void vtkOpenGLPolyDataMapper::RenderPieceStart(vtkRenderer* ren, vtkActor *actor)
{
// Set the PointSize and LineWidget
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glPointSize(actor->GetProperty()->GetPointSize()); // not on ES2
#endif
this->TimeToDraw = 0.0;
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
#if GL_ES_VERSION_3_0 != 1
if (this->TimerQuery == 0)
{
glGenQueries(1, static_cast<GLuint*>(&this->TimerQuery));
......@@ -2484,12 +2468,10 @@ void vtkOpenGLPolyDataMapper::RenderPieceStart(vtkRenderer* ren, vtkActor *actor
this->CellNormalTexture->Activate();
}
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
if (this->ValuePassHelper->GetRenderingMode() == vtkValuePass::FLOATING_POINT)
{
this->ValuePassHelper->RenderPieceStart(actor, this->CurrentInput);
}
#endif
// If we are coloring by texture, then load the texture map.
// Use Map as indicator, because texture hangs around.
......@@ -2533,7 +2515,7 @@ void vtkOpenGLPolyDataMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
{
if (pointPicking)
{
#if GL_ES_VERSION_2_0 != 1
#if GL_ES_VERSION_3_0 != 1
glPointSize(this->GetPointPickingPrimitiveSize(i));
#endif
}
......@@ -2606,7 +2588,7 @@ void vtkOpenGLPolyDataMapper::RenderPieceFinish(vtkRenderer* ren,
this->InternalColorTexture->PostRender(ren);
}
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1
#if GL_ES_VERSION_3_0 != 1
glEndQuery(GL_TIME_ELAPSED);
#endif
......@@ -2626,12 +2608,10 @@ void vtkOpenGLPolyDataMapper::RenderPieceFinish(vtkRenderer* ren,
this->CellNormalTexture->Deactivate();
}
#if GL_ES_VERSION_2_0 != 1 && GL_ES_VERSION_3_0 != 1