diff options
author | Svenn-Arne Dragly <svenn-arne.dragly@qt.io> | 2017-12-08 12:31:53 +0100 |
---|---|---|
committer | Svenn-Arne Dragly <svenn-arne.dragly@qt.io> | 2018-03-25 18:19:10 +0000 |
commit | c99555e476fd7be943d476c5ce4463463628e412 (patch) | |
tree | 841b8674065d7285232948ab65ae071476717064 /src/doc | |
parent | c5a6d31c2a40a3e1bd976ff8162238a7cbc066b4 (diff) |
Doc: Add and improve examples in render states and material system
Also switch \code to \qml.
Change-Id: I3f216a3abd55fdf51295ed14715f6f1ffc5e2ea4
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Diffstat (limited to 'src/doc')
-rw-r--r-- | src/doc/snippets/code/src_render_renderstates_qmultisampleantialiasing.qdocinc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/doc/snippets/code/src_render_renderstates_qmultisampleantialiasing.qdocinc b/src/doc/snippets/code/src_render_renderstates_qmultisampleantialiasing.qdocinc new file mode 100644 index 000000000..9c530382f --- /dev/null +++ b/src/doc/snippets/code/src_render_renderstates_qmultisampleantialiasing.qdocinc @@ -0,0 +1,35 @@ +Further, the shader code must use multisampling sampler types and texelFetch() instead + of texture(). + +\oldcode + +#version 150 + +uniform sampler2D colorTexture; +in vec2 texCoord; +out vec4 fragColor; + +void main() +{ + fragColor = texture(colorTexture, texCoord); +} + +\newcode + +#version 150 + +uniform sampler2DMS colorTexture; +in vec2 texCoord; +out vec4 fragColor; + +void main() +{ + ivec2 tc = ivec2(floor(textureSize(colorTexture) * texCoord)); + vec4 c = texelFetch(colorTexture, tc, 0) + + texelFetch(colorTexture, tc, 1) + + texelFetch(colorTexture, tc, 2) + + texelFetch(colorTexture, tc, 3); + fragColor = c / 4.0; +} + +\endcode |