issue115:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue115:inkscape [2016/11/29 14:01] – d52fr | issue115:inkscape [2016/12/03 10:09] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
To begin, create an object or group to apply the filter to, and then add a Diffuse Lighting primitive in the usual way. There are a few parameters to modify, but mostly it's a case of moving sliders by trial-and-error in order to achieve the result you want.** | To begin, create an object or group to apply the filter to, and then add a Diffuse Lighting primitive in the usual way. There are a few parameters to modify, but mostly it's a case of moving sliders by trial-and-error in order to achieve the result you want.** | ||
+ | |||
+ | Ce mois-ci, nous examinerons les dernières primitives de filtrage disponibles dans Inkscape 0.48, Lumière diffuse et Lumière spéculaire. Elles sont utilisées pour simuler l' | ||
+ | |||
+ | Lumière diffuse fait référence à l' | ||
+ | |||
+ | Pour commencer, créez un objet ou un groupe auquel appliquer le filtre et ajoutez ensuite la primitive Lumière diffuse de la façon habituelle. Il y a quelques paramètres modifiables, | ||
**The first parameter to choose is the color of your light. This has a huge effect on the output of the filter, as the lighting effect completely replaces the original color of your objects, rather than mixing with the underlying hues. In the example that follows, all the text objects are teal (a blue-green color), but the color used in the filters is yellow. Notice that no teal appears in the output images. | **The first parameter to choose is the color of your light. This has a huge effect on the output of the filter, as the lighting effect completely replaces the original color of your objects, rather than mixing with the underlying hues. In the example that follows, all the text objects are teal (a blue-green color), but the color used in the filters is yellow. Notice that no teal appears in the output images. | ||
Ligne 10: | Ligne 16: | ||
The Kernel Unit Length parameter can be largely ignored. It's not used by Inkscape, but may have an effect on other SVG viewers, where it's used to define the size of the pixel grid used for the filter calculations. I usually just leave it at zero.** | The Kernel Unit Length parameter can be largely ignored. It's not used by Inkscape, but may have an effect on other SVG viewers, where it's used to define the size of the pixel grid used for the filter calculations. I usually just leave it at zero.** | ||
+ | |||
+ | Le premier paramètre à choisir est la couleur de la lumière. Celle-ci a un énorme effet sur la sortie du filtre, car l' | ||
+ | |||
+ | En pratique, seul le canal alpha de l' | ||
+ | |||
+ | Le paramètre Unité de longueur du kernel peut être largement ignoré. Il n'est pas utilisé par Inkscape, mais peut avoir de l' | ||
**Finally, it's time to choose the type of light source: Distant, Point, or Spot. The first indicates a light source that is an infinite distance from your object, such that all the rays of light that arrive are parallel to one another. The Azimuth parameter sets the location of the light source as an angle – 0° places it to the right of your object, with increasing values moving it clockwise around the image until 360° puts it back at the right again. Drag this slider to see the effect in real-time. The Elevation parameter sets the angle to the drawing plane: imagine a light sitting flush with your computer screen at 0° (casting low, dark shadows); as you move the slider towards 90°, the light swings out of the monitor, towards you, until it's directly over your objects; continue towards 180° and it carries on following the same arc until it's flush with the monitor on the opposite side of your image; any further values continue moving the light in a semicircle behind the monitor, and tend to not be particularly useful. | **Finally, it's time to choose the type of light source: Distant, Point, or Spot. The first indicates a light source that is an infinite distance from your object, such that all the rays of light that arrive are parallel to one another. The Azimuth parameter sets the location of the light source as an angle – 0° places it to the right of your object, with increasing values moving it clockwise around the image until 360° puts it back at the right again. Drag this slider to see the effect in real-time. The Elevation parameter sets the angle to the drawing plane: imagine a light sitting flush with your computer screen at 0° (casting low, dark shadows); as you move the slider towards 90°, the light swings out of the monitor, towards you, until it's directly over your objects; continue towards 180° and it carries on following the same arc until it's flush with the monitor on the opposite side of your image; any further values continue moving the light in a semicircle behind the monitor, and tend to not be particularly useful. | ||
Specifying two polar values like this defines a bearing in three-dimensional space. If you ever watch an episode of Star Trek where a crew member states their course as “249 mark 38,” this is what they' | Specifying two polar values like this defines a bearing in three-dimensional space. If you ever watch an episode of Star Trek where a crew member states their course as “249 mark 38,” this is what they' | ||
+ | |||
+ | Enfin, c'est le moment de choisir le type de source lumineuse : distante, ponctuelle ou spot. La première indique une source de lumière qui est à une distance infinie de l' | ||
+ | |||
+ | La spécification de deux valeurs angulaires comme cela définit une position sphérique dans l' | ||
**With two polar values able to define a bearing, it only takes a third parameter, distance, to specify a particular point in space. When selecting the Point Light option, you might expect to see the same two sliders, joined by a third. But the SVG working group decided that defining a specific point in 3D should be done using Cartesian coordinates, | **With two polar values able to define a bearing, it only takes a third parameter, distance, to specify a particular point in space. When selecting the Point Light option, you might expect to see the same two sliders, joined by a third. But the SVG working group decided that defining a specific point in 3D should be done using Cartesian coordinates, | ||
Whereas the Distant Light, at its infinite distance from the scene, projects an even illumination, | Whereas the Distant Light, at its infinite distance from the scene, projects an even illumination, | ||
+ | |||
+ | Avec deux valeurs polaires capables de définir une position sphérique, il suffit d'un troisième paramètre, la distance, pour spécifier un point dans l' | ||
+ | |||
+ | Alors que la Lumière distante, à une distance infinie de la scène, projette une illumination uniforme, la Lumière ponctuelle est bien plus nuancée. Elle illumine plus les zones près de la source lumineuse que celles à distance, entraînant des nuances dans la couleur finale. | ||
**The Spot Light option is even more precise in its effect. This requires two sets of coordinates – one to specify the location of the light, and the other to define the direction it's pointing in (which is actually achieved by specifying the point in space it's aiming at). The light is projected in a cone from the source to the target, with an additional two sliders to set the characteristics of that cone: the Specular Exponent sets how focused the light is, whilst the Cone Angle defines the shape of the cone. The cone has a hard edge to it; any points outside it will not be illuminated at all, so you will need additional filter steps if you want a softer edge. | **The Spot Light option is even more precise in its effect. This requires two sets of coordinates – one to specify the location of the light, and the other to define the direction it's pointing in (which is actually achieved by specifying the point in space it's aiming at). The light is projected in a cone from the source to the target, with an additional two sliders to set the characteristics of that cone: the Specular Exponent sets how focused the light is, whilst the Cone Angle defines the shape of the cone. The cone has a hard edge to it; any points outside it will not be illuminated at all, so you will need additional filter steps if you want a softer edge. | ||
Ligne 24: | Ligne 44: | ||
You'll notice how “flat” all of these are. Because the bump map is created from the alpha channel of the input image, and our input image has alpha values of only 0 and 255, there’s no scope for gentle transitions in height. If you want a softer edge to your lighting you'll need to introduce some variety in the alpha channel. The easiest way to do this is by using a Gaussian Blur primitive to the input image.** | You'll notice how “flat” all of these are. Because the bump map is created from the alpha channel of the input image, and our input image has alpha values of only 0 and 255, there’s no scope for gentle transitions in height. If you want a softer edge to your lighting you'll need to introduce some variety in the alpha channel. The easiest way to do this is by using a Gaussian Blur primitive to the input image.** | ||
+ | |||
+ | L' | ||
+ | |||
+ | Cet exemple montre l' | ||
+ | |||
+ | Vous noterez comme ils ont tous l'air « plats ». Parce que l' | ||
**Just adding a blur will tend to spread the edge of your text outwards as well as inwards (second image in the next example). For a more pronounced effect, it's often worth using a Morphology filter to erode the input image before you blur it. By thinning your objects first, the full extent of the blur can be kept inside the boundaries of the original shapes (third image). If you then add a Composite filter, set to “In”, to the output of your lighting primitive, you can clip the result to give you something more like the rounded text you were probably looking for (fourth image). | **Just adding a blur will tend to spread the edge of your text outwards as well as inwards (second image in the next example). For a more pronounced effect, it's often worth using a Morphology filter to erode the input image before you blur it. By thinning your objects first, the full extent of the blur can be kept inside the boundaries of the original shapes (third image). If you then add a Composite filter, set to “In”, to the output of your lighting primitive, you can clip the result to give you something more like the rounded text you were probably looking for (fourth image). | ||
Ligne 34: | Ligne 60: | ||
result = i1×i2** | result = i1×i2** | ||
+ | |||
+ | Le simple ajout d'un flou tendra à disperser le bord de votre texte à l' | ||
+ | |||
+ | Et malgré tout, nous conservons la couleur jaune venant du filtre Éclairage. C'est ici que l' | ||
+ | |||
+ | résultat = (K1×i1×i2) + (K2×i1) + (K3×i2) + K4 | ||
+ | |||
+ | où K1-4 sont les constantes réglées dans l' | ||
+ | |||
+ | résultat = i1xi2 | ||
+ | |||
**In other words, a simple multiplication of input values, which is exactly what we want. Changing the “In” operator in the previous filter chain to “Arithmetic”, | **In other words, a simple multiplication of input values, which is exactly what we want. Changing the “In” operator in the previous filter chain to “Arithmetic”, | ||
Ligne 40: | Ligne 77: | ||
Moving on to the Specular Light filter, things look pretty similar in the filter UI. There' | Moving on to the Specular Light filter, things look pretty similar in the filter UI. There' | ||
+ | |||
+ | Autrement dit, une simple multiplication des valeurs d' | ||
+ | |||
+ | Maintenant, nous avons un objet illuminé dont la couleur de base a un effet sur la sortie. C'est évidemment beaucoup plus souple qu'un simple opérateur « In », qui nous obligerait à changer la lumière d' | ||
+ | |||
+ | En passant au filtre Lumière spéculaire, | ||
**Unlike Diffuse Light, this filter results in an image with mixed alpha values. Watch out for this, as seemingly bright reflections might actually just be a white background showing through! In the following image you can see that effect quite clearly on the first and second examples, where bright white “reflections” to the left of the filtered text are exposed as holes in the alpha channel once the yellow background is added behind them. Note that I've used a red Point Light in these examples, but still with teal text as the original object. | **Unlike Diffuse Light, this filter results in an image with mixed alpha values. Watch out for this, as seemingly bright reflections might actually just be a white background showing through! In the following image you can see that effect quite clearly on the first and second examples, where bright white “reflections” to the left of the filtered text are exposed as holes in the alpha channel once the yellow background is added behind them. Note that I've used a red Point Light in these examples, but still with teal text as the original object. | ||
Ligne 48: | Ligne 91: | ||
result = i1+i2** | result = i1+i2** | ||
+ | |||
+ | Contrairement à la Lumière diffuse, ce filtre produit une image avec des valeurs alpha variées. Faites attention, car des réflexions semblant brillantes pourraient n' | ||
+ | |||
+ | Les quatre images ci-dessus montrent l' | ||
+ | |||
+ | Cette fois-ci, le mode « Arithmétique » est utilisé à nouveau, mais les valeurs sont 0, 1, 1, 0, ce qui a pour effet de réduire l' | ||
+ | |||
+ | |||
+ | résultat = i1+i2 | ||
**This primitive therefore adds the reflections to the original image, which is the recommended approach from the SVG specification. Note, however, that a little background opacity has also sneaked through, so you might want to apply another Composite Filter, set to “In”, to ensure that the result is clipped to the shape of your original objects. | **This primitive therefore adds the reflections to the original image, which is the recommended approach from the SVG specification. Note, however, that a little background opacity has also sneaked through, so you might want to apply another Composite Filter, set to “In”, to ensure that the result is clipped to the shape of your original objects. | ||
Ligne 54: | Ligne 106: | ||
The full filter chain for this effect isn't too complex if you take it one step at a time. First the Morphology primitive erodes the text of the Source Graphic a little, with the output from that going straight into the Specular Lighting primitive, to give those sharp, red highlights. The Morphology output also goes to a Gaussian Blur to soften the image before it's used in the Diffuse Lighting primitive.** | The full filter chain for this effect isn't too complex if you take it one step at a time. First the Morphology primitive erodes the text of the Source Graphic a little, with the output from that going straight into the Specular Lighting primitive, to give those sharp, red highlights. The Morphology output also goes to a Gaussian Blur to soften the image before it's used in the Diffuse Lighting primitive.** | ||
+ | |||
+ | Par conséquent, | ||
+ | |||
+ | Enfin, il est temps de combiner les deux filtres d' | ||
+ | |||
+ | La chaîne de filtrage complète pour cet effet n'est pas trop compliquée si vous la faites étape par étape. En premier, la primitive Morphologie érode un peu le texte de l' | ||
**From there, it's just a matter of combining everything together: the first Composite filter (“Arithmetic” mode: 1, 0, 0, 0) multiplies the Source Graphic with the output from the Diffuse Lighting. The second Composite (“Arithmetic” mode: 0, 1, 1, 0) adds in the Specular Lighting highlights. Although the result is almost perfect, there was a slightly visible background, albeit with a low alpha value. A third Composite filter (“In” mode) simply tidies everything up a bit. | **From there, it's just a matter of combining everything together: the first Composite filter (“Arithmetic” mode: 1, 0, 0, 0) multiplies the Source Graphic with the output from the Diffuse Lighting. The second Composite (“Arithmetic” mode: 0, 1, 1, 0) adds in the Specular Lighting highlights. Although the result is almost perfect, there was a slightly visible background, albeit with a low alpha value. A third Composite filter (“In” mode) simply tidies everything up a bit. | ||
Although they' | Although they' | ||
+ | |||
+ | De là, il s'agit juste de tout combiner ensemble : le premier filtre Composite (mode « Arithmétique » : 1, 0, 0, 0) multiplie la source image avec la sortie d' | ||
+ | |||
+ | Bien que ce ne soit pas un vrai rayonnement ou un modelage 3D, les effets d' |
issue115/inkscape.1480424504.txt.gz · Dernière modification : 2016/11/29 14:01 de d52fr