diff --git a/src/Magnum/Shaders/FlatGL.h b/src/Magnum/Shaders/FlatGL.h index 04388c929..6e0a92260 100644 --- a/src/Magnum/Shaders/FlatGL.h +++ b/src/Magnum/Shaders/FlatGL.h @@ -109,6 +109,10 @@ Common rendering setup: @snippet Shaders-gl.cpp FlatGL-usage-textured2 +If @ref Flag::TextureArrays is enabled, pass a @ref GL::Texture2DArray instance +instead of @ref GL::Texture2D. By default layer @cpp 0 @ce is used, call +@ref setTextureLayer() to pick a different texture array layer. + For coloring the texture based on intensity you can use the @ref VectorGL shader. The 3D version of this shader is equivalent to @ref PhongGL with zero lights, however this implementation is much simpler and thus likely also @@ -224,6 +228,10 @@ the @ref Shaders-FlatGL-colored "colored case at the top" would look like this: @snippet Shaders-gl.cpp FlatGL-ubo +When uniform buffers with @ref Flag::TextureArrays are used, +@ref Flag::TextureTransformation has to be enabled as well in order to supply +the texture layer using @ref TextureTransformationUniform::layer. + For a multidraw workflow enable @ref Flag::MultiDraw (and possibly @ref Flag::TextureArrays), supply desired material and draw count via @ref Configuration::setMaterialCount() and diff --git a/src/Magnum/Shaders/MeshVisualizerGL.h b/src/Magnum/Shaders/MeshVisualizerGL.h index 607a0c67c..e8982887e 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.h +++ b/src/Magnum/Shaders/MeshVisualizerGL.h @@ -1531,7 +1531,7 @@ Consistently with the other shaders, textured object ID is also supported if the @ref TextureCoordinates attribute and bind an integer texture via @ref bindObjectIdTexture(). @ref Flag::TextureTransformation then enables texture transformation and @ref Flag::TextureArrays texture arrays for the -object ID texture. +object ID texture, with the layer selected using @ref setTextureLayer(). If you enable @ref Flag::VertexId, the shader will use the color map to visualize how are vertices shared among primitives. That's useful for diff --git a/src/Magnum/Shaders/PhongGL.h b/src/Magnum/Shaders/PhongGL.h index 32c76cd08..9ff67d802 100644 --- a/src/Magnum/Shaders/PhongGL.h +++ b/src/Magnum/Shaders/PhongGL.h @@ -82,6 +82,10 @@ Common rendering setup: @snippet Shaders-gl.cpp PhongGL-usage-texture2 +If @ref Flag::TextureArrays is enabled, pass @ref GL::Texture2DArray instances +instead of @ref GL::Texture2D. By default layer @cpp 0 @ce is used, call +@ref setTextureLayer() to pick a different texture array layer. + @section Shaders-PhongGL-lights Light specification By default, the shader provides a single directional "fill" light, coming from @@ -310,6 +314,10 @@ would look like this: @snippet Shaders-gl.cpp PhongGL-ubo +When uniform buffers with @ref Flag::TextureArrays are used, +@ref Flag::TextureTransformation has to be enabled as well in order to supply +the texture layer using @ref TextureTransformationUniform::layer. + For a multidraw workflow enable @ref Flag::MultiDraw (and possibly @ref Flag::TextureArrays) and supply desired light, material and draw count via @ref Configuration::setLightCount(),