Browse Source

Shaders: update outdated docs about passing stuff to constructors.

There's a Configuration class now.
pull/617/head
Vladimír Vondruš 3 years ago
parent
commit
6995ad4fa7
  1. 8
      src/Magnum/Shaders/FlatGL.h
  2. 12
      src/Magnum/Shaders/MeshVisualizerGL.h
  3. 14
      src/Magnum/Shaders/PhongGL.h

8
src/Magnum/Shaders/FlatGL.h

@ -94,10 +94,10 @@ Common rendering setup:
@section Shaders-FlatGL-textured Textured rendering @section Shaders-FlatGL-textured Textured rendering
If you want to use a texture, you need to provide also the If you want to use a texture, you need to provide also the
@ref TextureCoordinates attribute. Pass @ref Flag::Textured to the constructor @ref TextureCoordinates attribute. Pass @ref Flag::Textured to
and then at render time don't forget to bind also the texture via @ref Configuration::setFlags() and then at render time don't forget to bind
@ref bindTexture(). The texture is multiplied by the color, which is by default also the texture via @ref bindTexture(). The texture is multiplied by the
set to @cpp 0xffffffff_rgbaf @ce. Common mesh setup: color, which is by default set to @cpp 0xffffffff_rgbaf @ce. Common mesh setup:
@snippet MagnumShaders-gl.cpp FlatGL-usage-textured1 @snippet MagnumShaders-gl.cpp FlatGL-usage-textured1

12
src/Magnum/Shaders/MeshVisualizerGL.h

@ -170,10 +170,10 @@ configure the shader.
@endparblock @endparblock
The shader expects that you enable wireframe visualization by passing an The shader expects that you enable wireframe visualization by passing an
appropriate @ref Flag to the constructor --- there's no default behavior with appropriate @ref Flag to @ref Configuration::setFlags() --- there's no default
nothing enabled. The shader is a 2D variant of @ref MeshVisualizerGL3D with behavior with nothing enabled. The shader is a 2D variant of
mostly identical workflow. See its documentation for more information, @ref MeshVisualizerGL3D with mostly identical workflow. See its documentation
workflows that differ are shown below. for more information, workflows that differ are shown below.
@section Shaders-MeshVisualizerGL2D-instancing Instanced rendering @section Shaders-MeshVisualizerGL2D-instancing Instanced rendering
@ -1390,8 +1390,8 @@ shader.
The shader expects that you enable wireframe visualization, tangent space The shader expects that you enable wireframe visualization, tangent space
visualization or object/primitive ID visualization by passing an appropriate visualization or object/primitive ID visualization by passing an appropriate
@ref Flag to the constructor --- there's no default behavior with nothing @ref Flag to @ref Configuration::setFlags() --- there's no default behavior
enabled. with nothing enabled.
@section Shaders-MeshVisualizerGL3D-wireframe Wireframe visualization @section Shaders-MeshVisualizerGL3D-wireframe Wireframe visualization

14
src/Magnum/Shaders/PhongGL.h

@ -69,11 +69,11 @@ Common rendering setup:
If you want to use textures, you need to provide also the If you want to use textures, you need to provide also the
@ref TextureCoordinates attribute. Pass appropriate @ref Flag combination to @ref TextureCoordinates attribute. Pass appropriate @ref Flag combination to
the constructor and then at render time don't forget to also call appropriate @ref Configuration::setFlags() and then at render time don't forget to also
subset of @ref bindAmbientTexture(), @ref bindDiffuseTexture() and call appropriate subset of @ref bindAmbientTexture(), @ref bindDiffuseTexture()
@ref bindSpecularTexture() (or the combined @ref bindTextures()). The texture and @ref bindSpecularTexture() (or the combined @ref bindTextures()). The
is multiplied by the color, which is by default set to fully opaque white for texture is multiplied by the color, which is by default set to fully opaque
enabled textures. Mesh setup with a diffuse and a specular texture: white for enabled textures. Mesh setup with a diffuse and a specular texture:
@snippet MagnumShaders-gl.cpp PhongGL-usage-texture1 @snippet MagnumShaders-gl.cpp PhongGL-usage-texture1
@ -84,8 +84,8 @@ Common rendering setup:
@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
the center of the camera. Using the @p lightCount parameter in constructor, you the center of the camera. With @ref Configuration::setLightCount() you can
can specify how many lights you want, and then control light parameters using specify how many lights you want, and then control light parameters using
@ref setLightPositions(), @ref setLightColors(), @ref setLightSpecularColors() @ref setLightPositions(), @ref setLightColors(), @ref setLightSpecularColors()
and @ref setLightRanges(). Light positions are specified as four-component and @ref setLightRanges(). Light positions are specified as four-component
vectors, the last component distinguishing between directional and point vectors, the last component distinguishing between directional and point

Loading…
Cancel
Save