Browse Source

Shaders: mention texture array use in overview docs.

It was only briefly mentioned in the multidraw section, which is far
from enough.
pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
2c54176270
  1. 8
      src/Magnum/Shaders/FlatGL.h
  2. 2
      src/Magnum/Shaders/MeshVisualizerGL.h
  3. 8
      src/Magnum/Shaders/PhongGL.h

8
src/Magnum/Shaders/FlatGL.h

@ -109,6 +109,10 @@ Common rendering setup:
@snippet Shaders-gl.cpp FlatGL-usage-textured2 @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 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 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 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 @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 For a multidraw workflow enable @ref Flag::MultiDraw (and possibly
@ref Flag::TextureArrays), supply desired material and draw count via @ref Flag::TextureArrays), supply desired material and draw count via
@ref Configuration::setMaterialCount() and @ref Configuration::setMaterialCount() and

2
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 the @ref TextureCoordinates attribute and bind an integer texture via
@ref bindObjectIdTexture(). @ref Flag::TextureTransformation then enables @ref bindObjectIdTexture(). @ref Flag::TextureTransformation then enables
texture transformation and @ref Flag::TextureArrays texture arrays for the 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 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 visualize how are vertices shared among primitives. That's useful for

8
src/Magnum/Shaders/PhongGL.h

@ -82,6 +82,10 @@ Common rendering setup:
@snippet Shaders-gl.cpp PhongGL-usage-texture2 @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 @section Shaders-PhongGL-lights Light specification
By default, the shader provides a single directional "fill" light, coming from 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 @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 For a multidraw workflow enable @ref Flag::MultiDraw (and possibly
@ref Flag::TextureArrays) and supply desired light, material and draw count via @ref Flag::TextureArrays) and supply desired light, material and draw count via
@ref Configuration::setLightCount(), @ref Configuration::setLightCount(),

Loading…
Cancel
Save