<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Graphics | Ziqi Lu</title><link>https://assassin-plus.github.io/portfolio/tags/graphics/</link><atom:link href="https://assassin-plus.github.io/portfolio/tags/graphics/index.xml" rel="self" type="application/rss+xml"/><description>Graphics</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Sun, 01 Sep 2024 00:00:00 +0200</lastBuildDate><image><url>https://assassin-plus.github.io/portfolio/media/icon_hu_982c5d63a71b2961.png</url><title>Graphics</title><link>https://assassin-plus.github.io/portfolio/tags/graphics/</link></image><item><title>Procedural Texturing | Real-time Rendering Chapter 6.3</title><link>https://assassin-plus.github.io/portfolio/post/procedural-texturing/</link><pubDate>Sun, 01 Sep 2024 00:00:00 +0200</pubDate><guid>https://assassin-plus.github.io/portfolio/post/procedural-texturing/</guid><description>&lt;h1 id="procedural-texturing"&gt;Procedural Texturing&lt;/h1&gt;
&lt;p&gt;Although procedural textures are commonly used in offline rendering applications, image textures are far more common in real-time rendering. This is due to the extremely &lt;em&gt;high efficiency of the image texturing hardware&lt;/em&gt; in modern GPUs, which can perform many billions of texture accesses in a second. However, GPU architectures are evolving toward &lt;em&gt;less expensive computation and (relatively) more costly memory access&lt;/em&gt;. These trends have made procedural textures find greater use in real-time applications.&lt;/p&gt;
&lt;p&gt;Volume textures are a particularly attractive application for procedural texturing, given the high storage costs of volume image textures. One of the most common is using one or more &lt;strong&gt;noise&lt;/strong&gt; functions to generate values. A noise function is often sampled at successive powers-of-two frequencies, called &lt;em&gt;octaves&lt;/em&gt;. Each octave is given a weight, usually falling as the frequency increases, and the sum of these weighted samples is called a &lt;em&gt;turbulence&lt;/em&gt; function.&lt;/p&gt;
&lt;p&gt;Other procedural methods are possible. For example, a cellular texture is formed by measuring distances from each location to a set of “feature points” scattered through space. Mapping the resulting closest distances in various ways.&lt;/p&gt;
&lt;p&gt;When generating a procedural two-dimensional texture, parameterization issues (UV) can pose even more difficulties than for authored textures, where stretching or seam artifacts can be manually touched up or worked around.&lt;/p&gt;
&lt;p&gt;Antialiasing procedural textures is both harder and easier than &lt;strong&gt;antialiasing&lt;/strong&gt; image textures. On one hand, precomputation methods such as mipmapping are not available, putting the burden on the programmer. On the other, the procedural texture author has “inside information” about the texture content and so can tailor it to avoid aliasing. This is particularly true for procedural textures created by summing multiple noise functions. The frequency of each noise function is known, so any frequencies that would cause aliasing can be discarded, actually making the computation less costly.&lt;/p&gt;</description></item><item><title>Premultiplied Alphas and Compositing | Real-time Rendering Chapter 5.5.3</title><link>https://assassin-plus.github.io/portfolio/post/premultiplied-alpha/</link><pubDate>Sat, 17 Feb 2024 00:00:00 +0200</pubDate><guid>https://assassin-plus.github.io/portfolio/post/premultiplied-alpha/</guid><description>&lt;h1 id="premultiplied-alphas-and-compositing"&gt;Premultiplied Alphas and Compositing&lt;/h1&gt;
&lt;p&gt;The over operator is also used for blending together photographs or synthetic renderings of objects. This process is called compositing. The image formed by the alpha channel is sometimes called the &lt;strong&gt;matte&lt;/strong&gt;. It shows the silhouette shape of the object.&lt;/p&gt;
&lt;p&gt;One way to use synthetic RGBα data is with &lt;em&gt;&lt;strong&gt;premultiplied alphas&lt;/strong&gt;&lt;/em&gt; (also known as &lt;em&gt;&lt;strong&gt;associated alphas&lt;/strong&gt;&lt;/em&gt;). That is, the RGB values are multiplied by the alpha value before being used. This makes the compositing over equation more efficient:&lt;/p&gt;
$$\mathbf{c_O=c_S'+(1-\alpha_S)c_d}$$&lt;p&gt;where $\mathbf{c_S'}$ is the premultiplied source channel.Premultiplied alpha also makes it possible to use over and additive blending &lt;em&gt;without changing the blend state&lt;/em&gt;, since the source color is now added in during blending.&lt;/p&gt;
&lt;p&gt;Rendering synthetic images dovetails naturally with premultiplied alphas. An antialiased opaque object rendered over a black background provides premultiplied values by default.&lt;/p&gt;
&lt;p&gt;Another way images are stored is with unmultiplied alphas, also known as unassociated alphas or even as the mind-bending term nonpremultiplied alphas.It is best to use premultiplied data whenever filtering and blending is performed, as operations such as linear interpolation &lt;em&gt;do not work correctly&lt;/em&gt; using unmultiplied alphas. Artifacts such as black fringes around the edges of objects can result.&lt;/p&gt;
&lt;p&gt;For image-manipulation applications, an unassociated alpha is useful to mask a photograph without affecting the underlying image’s original data. Also, an unassociated alpha means that the &lt;strong&gt;full precision range&lt;/strong&gt; of the color channels can be used.&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;care must be taken to properly convert unmultiplied RGBα values to and from the linear space used for computer graphics computations.
{: .prompt-warning }&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Image file formats that support alpha include PNG (unassociated alpha only), OpenEXR (associated only), and TIFF (both types of alpha).&lt;/p&gt;</description></item></channel></rss>