diff --git a/doc/changelog.dox b/doc/changelog.dox index d9d1af5c9..20dcdaf0e 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -411,6 +411,8 @@ See also: oversized on others (see [mosra/magnum#260](https://github.com/mosra/magnum/issues/260), [mosra/magnum#261](https://github.com/mosra/magnum/issues/261)) +- Documentation of @ref Primitives and @ref Shaders namespaces now has proper + sRGB and HiDPi renderings of all primitives and shaders @subsection changelog-latest-deprecated Deprecated APIs diff --git a/doc/generated/shaders.cpp b/doc/generated/shaders.cpp index abd83fc89..61ec7cfcf 100644 --- a/doc/generated/shaders.cpp +++ b/doc/generated/shaders.cpp @@ -84,7 +84,7 @@ struct ShaderVisualizer: Platform::WindowlessApplication { }; namespace { - constexpr const Vector2i ImageSize{256}; + constexpr const Vector2i ImageSize{512}; } int ShaderVisualizer::exec() { @@ -103,7 +103,7 @@ int ShaderVisualizer::exec() { } GL::Renderbuffer multisampleColor, multisampleDepth; - multisampleColor.setStorageMultisample(16, GL::RenderbufferFormat::RGBA8, ImageSize); + multisampleColor.setStorageMultisample(16, GL::RenderbufferFormat::SRGB8Alpha8, ImageSize); multisampleDepth.setStorageMultisample(16, GL::RenderbufferFormat::DepthComponent24, ImageSize); GL::Framebuffer multisampleFramebuffer{{{}, ImageSize}}; @@ -113,12 +113,13 @@ int ShaderVisualizer::exec() { CORRADE_INTERNAL_ASSERT(multisampleFramebuffer.checkStatus(GL::FramebufferTarget::Draw) == GL::Framebuffer::Status::Complete); GL::Renderbuffer color; - color.setStorage(GL::RenderbufferFormat::RGBA8, ImageSize); + color.setStorage(GL::RenderbufferFormat::SRGB8Alpha8, ImageSize); GL::Framebuffer framebuffer{{{}, ImageSize}}; framebuffer.attachRenderbuffer(GL::Framebuffer::ColorAttachment{0}, color); GL::Renderer::enable(GL::Renderer::Feature::DepthTest); - GL::Renderer::setClearColor(0x000000_rgbaf); + GL::Renderer::enable(GL::Renderer::Feature::FramebufferSrgb); + GL::Renderer::setClearColor(0x000000_srgbaf); for(auto fun: {&ShaderVisualizer::phong, &ShaderVisualizer::meshVisualizer, @@ -143,13 +144,13 @@ int ShaderVisualizer::exec() { namespace { const auto Projection = Matrix4::perspectiveProjection(35.0_degf, 1.0f, 0.001f, 100.0f); const auto Transformation = Matrix4::translation(Vector3::zAxis(-5.0f)); - const auto BaseColor = 0x2f83cc_rgbf; - const auto OutlineColor = 0xdcdcdc_rgbf; + const auto BaseColor = 0x2f83cc_srgbf; + const auto OutlineColor = 0xdcdcdc_srgbf; } std::string ShaderVisualizer::phong() { MeshTools::compile(Primitives::uvSphereSolid(16, 32)).draw(Shaders::Phong{} - .setAmbientColor(0x22272e_rgbf) + .setAmbientColor(0x22272e_srgbf) .setDiffuseColor(BaseColor) .setShininess(200.0f) .setLightPosition({5.0f, 5.0f, 7.0f}) @@ -169,6 +170,7 @@ std::string ShaderVisualizer::meshVisualizer() { .draw(Shaders::MeshVisualizer{Shaders::MeshVisualizer::Flag::Wireframe} .setColor(BaseColor) .setWireframeColor(OutlineColor) + .setWireframeWidth(2.0f) .setViewportSize(Vector2{ImageSize}) .setTransformationProjectionMatrix(projection)); @@ -191,7 +193,7 @@ std::string ShaderVisualizer::vertexColor() { std::vector colors; colors.reserve(sphere.positions(0).size()); for(Vector3 position: sphere.positions(0)) - colors.push_back(Color3::fromHsv(Math::lerp(240.0_degf, 420.0_degf, Math::max(1.0f - (position - target).length(), 0.0f)), 0.75f, 0.75f)); + colors.push_back(Color3::fromHsv(Math::lerp(240.0_degf, 420.0_degf, Math::max(1.0f - (position - target).length(), 0.0f)), 0.85f, 0.666f)); GL::Buffer vertices, indices; vertices.setData(MeshTools::interleave(sphere.positions(0), colors), GL::BufferUsage::StaticDraw); diff --git a/doc/shaders-distancefieldvector.png b/doc/shaders-distancefieldvector.png index aa1ce7b94..58e3818ca 100644 Binary files a/doc/shaders-distancefieldvector.png and b/doc/shaders-distancefieldvector.png differ diff --git a/doc/shaders-flat.png b/doc/shaders-flat.png index ef93e076e..4bccc75ff 100644 Binary files a/doc/shaders-flat.png and b/doc/shaders-flat.png differ diff --git a/doc/shaders-meshvisualizer.png b/doc/shaders-meshvisualizer.png index 6d5f981b1..a2d8583d4 100644 Binary files a/doc/shaders-meshvisualizer.png and b/doc/shaders-meshvisualizer.png differ diff --git a/doc/shaders-phong.png b/doc/shaders-phong.png index 0f7017436..9f09235dc 100644 Binary files a/doc/shaders-phong.png and b/doc/shaders-phong.png differ diff --git a/doc/shaders-vector.png b/doc/shaders-vector.png index a2a156347..a79b897a7 100644 Binary files a/doc/shaders-vector.png and b/doc/shaders-vector.png differ diff --git a/doc/shaders-vertexcolor.png b/doc/shaders-vertexcolor.png index 9a3892309..c4ab3c85f 100644 Binary files a/doc/shaders-vertexcolor.png and b/doc/shaders-vertexcolor.png differ diff --git a/src/Magnum/Shaders/DistanceFieldVector.h b/src/Magnum/Shaders/DistanceFieldVector.h index e24ba98e2..76589a689 100644 --- a/src/Magnum/Shaders/DistanceFieldVector.h +++ b/src/Magnum/Shaders/DistanceFieldVector.h @@ -51,7 +51,7 @@ texture with a white color in an identity transformation, use @ref setTransformationProjectionMatrix(), @ref setColor() and others to configure the shader. -@image html shaders-distancefieldvector.png +@image html shaders-distancefieldvector.png width=256px @section Shaders-DistanceFieldVector-usage Example usage diff --git a/src/Magnum/Shaders/Flat.h b/src/Magnum/Shaders/Flat.h index b7b594da6..7505c8991 100644 --- a/src/Magnum/Shaders/Flat.h +++ b/src/Magnum/Shaders/Flat.h @@ -63,7 +63,7 @@ multipled by the color, which is by default set to @cpp 0xffffffff_rgbaf @ce. For coloring the texture based on intensity you can use the @ref Vector shader. -@image html shaders-flat.png +@image html shaders-flat.png width=256px @section Shaders-Flat-usage Example usage diff --git a/src/Magnum/Shaders/MeshVisualizer.h b/src/Magnum/Shaders/MeshVisualizer.h index 177172bae..0e264ab5c 100644 --- a/src/Magnum/Shaders/MeshVisualizer.h +++ b/src/Magnum/Shaders/MeshVisualizer.h @@ -45,7 +45,7 @@ renders the mesh with a white color in an identity transformation. Use @ref setTransformationProjectionMatrix(), @ref setColor() and others to configure the shader. -@image html shaders-meshvisualizer.png +@image html shaders-meshvisualizer.png width=256px @section Shaders-MeshVisualizer-wireframe Wireframe visualization diff --git a/src/Magnum/Shaders/Phong.h b/src/Magnum/Shaders/Phong.h index 7204e145c..03c611343 100644 --- a/src/Magnum/Shaders/Phong.h +++ b/src/Magnum/Shaders/Phong.h @@ -54,7 +54,7 @@ don't forget to also call appropriate subset of @ref bindAmbientTexture(), @ref bindTextures()). The texture is multipled by the color, which is by default set to fully opaque white for enabled textures. -@image html shaders-phong.png +@image html shaders-phong.png width=256px @section Shaders-Phong-usage Example usage diff --git a/src/Magnum/Shaders/Vector.h b/src/Magnum/Shaders/Vector.h index 368b71121..b8c04ce30 100644 --- a/src/Magnum/Shaders/Vector.h +++ b/src/Magnum/Shaders/Vector.h @@ -50,8 +50,7 @@ white color in an identity transformation. Use @ref setTransformationProjectionMatrix(), @ref setColor() and others to configure the shader. -@image html shaders-vector.png -@image latex shaders-vector.png +@image html shaders-vector.png width=256px @section Shaders-Vector-usage Example usage diff --git a/src/Magnum/Shaders/VertexColor.h b/src/Magnum/Shaders/VertexColor.h index 89678ec57..1b2277421 100644 --- a/src/Magnum/Shaders/VertexColor.h +++ b/src/Magnum/Shaders/VertexColor.h @@ -47,7 +47,7 @@ attributes in your triangle mesh. By default, the shader renders the mesh in an identity transformation. Use @ref setTransformationProjectionMatrix() to configure the shader. -@image html shaders-vertexcolor.png +@image html shaders-vertexcolor.png width=256px @section Shaders-VertexColor-example Example usage