From 4170eacd94e73de1e25a648b9f0d94868af743a0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 16 Jul 2010 17:04:31 +0100 Subject: [PATCH] cookbook: Add a recipe for texture reflection A common request: how to create a clone of a texture that looks like a reflection. --- doc/cookbook/images/textures-reflection.png | Bin 0 -> 23953 bytes doc/cookbook/textures.xml | 198 ++++++++++++++++++++ 2 files changed, 198 insertions(+) create mode 100644 doc/cookbook/images/textures-reflection.png diff --git a/doc/cookbook/images/textures-reflection.png b/doc/cookbook/images/textures-reflection.png new file mode 100644 index 0000000000000000000000000000000000000000..431b66d9694f09ac392cd169b7c708cf09709717 GIT binary patch literal 23953 zcmeFZWmuJA_dR%QX+=Om5QC8JPC=!+8>JiRMpVF{yAkQ`JT%e*(hbtx(lz_|zQ6y> zm$~M{%zXQE=>;4P&vVDV_g-u5_3%YjS_BK72pxeyV2O#olt&=0M!Q?N3$b9`fCfH1POvM`{t)w3}$u(UO{vfH{=$B#ff zMu@$9q39I1KIv?yWnXi7Im~an=xiR!9-ri0hKDXn$MW^|)BE_x;tgo;D!vY9Yww?E zts$%HT=P{J-147ieE+3PxcdGmHC2czNJzqjP+X$lPPFfrZFhTg&&ByWW8)_lp`q?R zWIe6wY8FkSr+eM}opUr>Jw~2o*I|hNmyh>{%+kB(q337_#QT*7-qFMWIc(;MgPf@2 z1gq{Cmj2aQcyo}KI?t)Tvhwq@OtXcH=KK`nms1y;n$5x~R8$8E0#af`bgGZ^y3f=) zIy(At)QUq?VU7sqSC*Skj?X>VUMDlV^Aq-dCUeHa31JfJJv<}q-{FoBxnMTBprunU z5e>n^ycv3O?Nig6=C_5P0!l~CZMfqJRA8u#m8#+CreY!CZ*b{Hjg9usn{ z%FM;XeOun~M2H9(Jia5EQL%H|w+Y?1X?1;Fa`|X?*CskmtOBmk9}(`nDk@x9Riz#> z&^JQX%oA}}%t7o;&A1^q(t8Dwq+rLu(nB(75(_}y-Q^qi{jx`%5xnLgIjpOk-25b*G`=Cd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ures.xml index 410eddfb6..5b0d29573 100644 --- a/doc/cookbook/textures.xml +++ b/doc/cookbook/textures.xml @@ -500,4 +500,202 @@ main (int argc, char *argv[]) +
+ Creating a reflection of a texture + +
+ Problem + + You want to create the reflection of a texture. + + The reflection is going to be positioned below the original + texture, and is going to fade out as if the original was placed on + a glassy surface. +
+ +
+ Solution + + You can use a ClutterClone actor and override its paint + implementation with a custom one: + + + + + + + +
+ Reflection of a texture + +
+ +
+ +
+ Discussion + + The essence of painting a reflection of a texture lies in reusing + the same material used by the original. This not only allows painting + always an up to date version of the original, but it also saves + resources. + + In the code example above we take the CoglMaterial + out of the source ClutterTexture and we ask the Cogl + pipeline to paint it by using cogl_set_source(). The + main difference between this code and the equivalent code inside the + ClutterTexture paint() implementation + is that we also specify the texture vertices and their color by using the + CoglTextureVertex structure and the + cogl_polygon() function. + + The CoglTextureVertex structure contains three fields + for the position of the vertex in 3D space: + + + + + + It also contains the normalized texture coordinate (also known as + texture element, or texel): + + + + + + And, finally, the color of the vertex, expressed as a + CoglColor: + + + + + + The example code sets the position of the vertices in clockwise + order starting from the top left corner, and sets the coordinate of the + texels in counter-clockwise order, starting with the bottom left corner. + This makes sure that the copy of the original texture appears as being + flipped vertically. + + The gradual fading out to the background color is done by setting + the color of the top vertices to be fully opaque, and the color of the + bottom ones to be fully transparent; GL will then automatically create a + gradient that will be applied when painting the material. + + The color values must be pre-multiplied with their alpha + component, otherwise the bleding will not be correct. You can either + multiply the values by yourself when creating the color or, better yet, + use the cogl_color_premultiply() that Cogl provides + for this operation. + +
+
+