A deep dive into rendering the Mandelbulb fractal in WebGL using ray marching, distance estimation, orbit traps, and advanced shading techniques. We’ll explore the math, shader implementation, and ...| www.4rknova.com
The full moon is one of those sights that almost begs to be photographed, no matter what camera you’re using. Most of the time, that means a smartphone, and to be fair, modern phones are excellent at handling bright subjects like the moon. Of course, a telescope should reveal far more than a phone camera, but I wanted to see just how big that difference really is. So last night, under clear skies, I took two photos. Seestar S50 smart telescope: designed for astrophotography, with a larger a...| 4rknova.com
In this post, I’ll walk you through how to create a custom shader in Three.js that simulates the look of a foil sticker, complete with angle-dependent iridescence and sparkling metallic flakes. The goal is to capture that premium, holographic effect you see on collectible stickers, trading cards, and high-end packaging, but to render it in real time directly in the browser. Iridescence If you’ve ever tilted a holographic sticker or watched sunlight catch on a soap bubble, you’ve seen ir...| 4rknova.com
When we gaze into the night sky, we are not just seeing stars as they are now, we are seeing their light as it was years, centuries, or even billions of years ago. That light has traveled unimaginable distances, weaving its way through the galaxy. Along the way, it can change, not in brightness or shape, but in colour. This change is known as redshift. What Is Redshift Light is made up of waves, just like ripples on water. The colour we perceive depends on the wavelength of those waves: Short...| 4rknova.com
Polaris, better known as the North Star, has been humanity’s celestial compass for centuries. Bright, steady, and almost perfectly aligned with Earth’s rotation axis, it’s one of the few stars in the night sky that doesn’t seem to move. The name “Polaris” comes from Latin stella polaris, meaning “polar star.” It has also been called the “Lodestar”, a poetic term meaning “guiding star”. While it has been a guiding star for millennia, modern navigation increasingly relie...| 4rknova.com
Introduction Unity is a powerful game engine known for its flexibility and ease of use. One of its core features that greatly impacts the look and performance of your game or app is the Render Pipeline. Unity offers multiple render pipelines, each designed for different needs and platforms. In this post, we’ll explore Unity’s three main render pipelines: Built-in Render Pipeline Universal Render Pipeline (URP) High Definition Render Pipeline (HDRP) We’ll break down what each one does, t...| 4rknova.com
Introduction The Andromeda Paradox is a thought experiment proposed by physicist Roger Penrose to demonstrate a strange consequence of Einstein’s special theory of relativity: that different observers can disagree on what is happening right now, even at galaxies millions of light-years away. The paradox isn’t a contradiction, but rather a counterintuitive implication of how time and simultaneity work in relativity. The Thought Experiment Imagine two people walking slowly past each other o...| 4rknova.com
NGC6960, also known as the Veil Nebula, or Witch’s Broom Nebula is a cloud of heated and ionized gas and dust in the constellation Cygnus. I picked the Veil Nebula as my target in my latest astrophotography session, and was very pleased with the result. The unprocessed photo shown below is stacked in Siril, using 225 exposures of 10 seconds each, captured by my trusted Seestar S50 telescope. tacked, unprocessed photo of NGC6960 I processed the photo to get a clearer view of the Nebula and a...| 4rknova.com
Since their introduction in React 16.8, hooks have revolutionized the way developers write functional components. But with so many available, from useState to useDeferredValue, knowing when and how to use each can get confusing. This guide breaks down the most commonly used React hooks, compares them side-by-side, and outlines practical use cases and gotchas you should avoid. Most common React hooks at a glance HookPurposeCommon Use CaseCommon Gotchas useStateAdd local state to componentsUI t...| 4rknova.com
The Seestar S50 smart telescope can be accurately simulated in Stellarium by configuring custom sensor and telescope profiles. Stellarium’s Oculars plugin allows for precise visualization of the field of view (FOV), making it a valuable tool for astrophotography planning and target framing. Below are the specifications for both the standard 1x1 mode and the expanded 2x2 mosaic mode used by the Seestar S50. Sensor Settings ModeResolution (px)Chip Width (mm)Chip Height (mm)BinningRotation Ang...| 4rknova.com
If you’re a fan of classic RTS games, you might remember Z by the Bitmap Brothers, a gem from the 90s that’s well worth revisiting. Today, I’ll walk you through how to revive this old DOS game on a modern Linux system using DOSBox. Creating a backup image of your original game Before we get started, it’s important to mention that you should create an ISO backup of your original Z game CD. This ensures you preserve the original media and can easily mount the game inside DOSBox. You can...| 4rknova.com
Extracting audio from a video file If you are working with a video instad of an audio file, you will need to first extract the audio stream. This can be done very easily using ffmpeg. ffmpeg -i input-video.avi -vn -acodec copy audio.aac Install the tools We will use OpenAI Whisper and more specifically a packaged version from snap called whisper-gael. In debian you will need to install snapd if you don’t already have it. sudo apt update sudo apt install snapd sudo snap install whisper-gael ...| 4rknova.com
Introduction Full Stack Development refers to the process of designing, developing, and maintaining both the front-end (client-side) and back-end (server-side) of a web application. A full stack developer has expertise in working with multiple layers of web development, from user interfaces to databases and server-side logic using a wide range of languages and programming paradigms. In this blog series, I will go over the development of a simple to-do application. Some familiarity with the te...| 4rknova.com
Introduction I’ve recently introduced a new feature to my blog. You can now listen to posts being read out aloud by clicking on the A-shaped button in the header above. This is made possible using the Speech Synthesis Web API, which is supported by most modern web browsers. The API is fairly simple to use and only a minimal amount of code is needed to set everything up. Implementation I’ve implemented the narration feature in Javascript. It can be broken down into two distinct steps: Tran...| 4rknova.com
Introduction The original Nintendo Gameboy was released in 1989 and is one of the most recognisable game consoles from the 90s era. I’ve always wanted to write a game for it, but sadly this was a project that I kept postponing, mainly due to the associated complexity and dedication required when working with assembly code. This series of blog posts aim to serve as a collection of notes for myself, but I am also taking this opportunity to share my findings in the hope that they may be useful...| 4rknova.com
There are many use cases for creating encrypted file archives. One such use case is managing file backups. In this short blog post we look into how to use tar and gpg to achieve that. Creating the archive Generating an encrypted archive is fairly trivial: $ tar -cvzf - directory | gpg -c > directory.tar.gz.gpg In the above snippet, tar creates a compressed archive of the directory specified, using gzip, and pipes the data to gpg for encryption, before writing to the output file. The ‘-c’ ...| 4rknova.com
I recently purchased a ZEXMTE BT-506 bluetooth dongle from amazon to use in a Debian Linux server. Installation This dongle uses a Realtek RTL8761B chipset. A quick check using apt suggests that the required firmware is included in the firmware-realtek package. % apt show firmware-realtek | grep RTL8761B * Realtek RTL8761B Bluetooth config (rtl_bt/rtl8761b_config.bin) * Realtek RTL8761B Bluetooth firmware (rtl_bt/rtl8761b_fw.bin) * Realtek RTL8761BU Bluetooth config (rtl_bt/rtl8761bu_config.b...| 4rknova.com
In this short blog post, I experiment with using a Telegram bot to send arbitrary notifications as chat messages. There are many instances where this can be very useful. The process is fairly trivial, and it only takes a few minutes to set everything up. Creating a Telegram bot First we need to create a telegram bot. In telegram, start a new chat with @BotFather. This special account is a bot itself and facilitates the creation and management of other bots. Issue the /newbot command and follo...| 4rknova.com
This post is a summary of how to setup Docker under Debian, and use the compose plugin to run services. Most of the information presented here is copied verbatim from the sources listed in the reference section below. Setting up docker and docker-compose First remove any older versions of docker that are already installed in the system, and then install some useful tools. $ sudo apt purge docker docker-engine docker.io containerd runc $ sudo apt update $ sudo apt install ca-certificates curl ...| 4rknova.com
A while back I wrote Asciimg, a minimalistic tool that can display images within a terminal. The tool implements a rudimentary dithering algorithm to translate colour intensities to ascii characters. I was recently playing around with it and thought of a few creative ways to put it to use. If you wish to try the examples below yourself, the source code for Asciimg is available at github. The experiments presented below are of limited practical value, and the way they are implemented is not pa...| 4rknova.com
I recently stumbled upon a very interesting blog post from Martin Fuller on the topic of normalized float compression[1]. What follows is a summary of Martin’s write up along with some additional material from relevant resources and some notes of my own. Some of the content below is copied verbatim from the sources referenced at the end. IEEE754 Single Precision Floats The IEEE754 standard for floating point arithmetic defines a single precision 32-bit float using three components: A sign b...| 4rknova.com
The technique Shadow mapping was introduced by Lance Williams in 1978 and is still the most popular technique for implementing dynamic shadowing. The technique is relatively easy to understand and implement in its basic form and a wide range of extensions have been developed to improve its visual quality. Workflow The basic algorithm can be broken down to two passes: Depth map generation: The scene is rendered from the light’s point of view, capturing only the depth value for each fragment....| 4rknova.com
Peripage printers are very cheap and fun to experiment with. I purchased a 203 dpi model A6 from ebay a while ago and used it in a few projects. In this post I demonstrate how easy it is to print wirelessly via the terminal. Install dependencies We will use the python ppa6 package which provides a utility for printing on Peripage A6/A6+ thermal printers over bluetooth. $ pip install ppa6 Setup We need the Mac address of the printer. We can use hcitool for that. $ hcitool scan Scanning .. 00:1...| 4rknova.com
This guide shows how to add Yubikey U2F authentication as an optional login method in Debian with Gnome desktop environment. Using this configuration, if the key is not present on the computer, the user will still be able to login by means of another method. Depending on your security needs this may or may not be desirable. The following is for the most part a direct copy of instructions from Yubico’s support pages. I’ve cherry picked and summarized the instructions that are relevant to t...| 4rknova.com
I was browsing ebay the other day, looking around for used Lenovo Thinkpads, and came across a x270 which was listed at a very low price. It came without a hard drive and had a few issues, including a cracked top lid. Overall, it looked like it required a fair amount of work to get to a good state. I did some research and was able to find all the parts I needed at a low cost so I decided that I could make a fun project out of restoring it. I’ve spend a few days working on it and I am very h...| 4rknova.com
Midjourney is a research lab led by David Holz who co-founded Leap Motion. They’ve recently released an artificial intelligence image generator of the same name that is capable of creating high quality images based solely on a textual description of its contents. There is very little information available regarding the technology behind Midjourney. There is some speculation that its architecture is based on Generative Adversarial Networks (GAN), which were invented in 2014 by Ian Goodfellow...| 4rknova.com
A while back I stumbled across a very interesting electronics project that I was really keen to try myself. BrachioGraph is a 2D plotter that is based on the raspberry pi computer and is extremely simple and cheap to build. I followed the original design with a few small modifications to build my own. More specifically: I replaced the Tower SG90 servos in the articulated segments with metal gear MG995 ones to increase stability and reduce jerkiness during drawing. I added two metal brackets t...| 4rknova.com
Introduction Blending of normal maps has been used extensively in computer graphics to break repetition patterns, add granularity to surfaces, and achieve a more realistic look. Examples of that are: Adding micro detail when rendering sea waves Simulating skin wrinkles Transitioning smoothly between different materials When creating game assets, it’s common practice to use layer blending in image editing tools such as Photoshop to achieve this effect, however the issue with this approach is...| 4rknova.com
This post is a collection of notes on the exciting new technology of Nanite in Unreal engine 5. The information was gathered from watching videos and reading articles on the tech both from the developers and third party sources. Nanite Nanite is a virtual micropolygon geometry system introduced in Unreal engine 5. The main characteristics of Nanite are: Only the geometry that can be seen is drawn for a given frame. Geometry virtualization means that only the data that is required to render a ...| 4rknova.com
My partner recently came across an old educational software title from 1997 that brought back happy memories from her childhood. The software was developed by “The Learning Company” and was part of a series called “Reader Rabbit’s Reading Development Library”. The company released 4 installments in total. I thought it would be a nice surprise to help recreate some of those cherished memories and took on the challenge of making this outdated software run on a modern machine and OS. I...| 4rknova.com
The code snippet below shows how to create, format and mount a 1.44MB floppy disk image file, and then write files into it. $ dd bs=512 count=2880 if=/dev/zero of=floppy.img $ sudo mkfs.msdos floppy.img $ sudo mount -o loop image.img /media/floppy/ $ cp ./files/* /media/floppy $ sudo umount /media/floppy/| 4rknova.com
Complex numbers A complex number can be expressed in the form: \[z = a + ib\] \[a, b \in \mathbb{R}\] where \(i\) is a solution of the equation: \[x^2 = −1\] As no real number satisfies this equation, \(i\) is called an imaginary number. In this notation, \(a\) is called the real part and \(b\) is called the imaginary part of the complex number [1]. A complex number can also be express in its polar form as: \[z = r (cos(\theta) + i sin(\theta))\] \[r, \theta \in \mathbb{R}\] The De Moivre t...| 4rknova.com
In a previous post we experimented with a simple but rather low tech way of taking macro-focus photographs using a mobile phone. While the results that method yields are quite impressive, the granularity of the detail we captured is impacted by the low clarity and less than optimal shape of the liquid lens. In this short post we’ll borrow the lens from a cheap laser pointer such as the one pictured below, to get some better results. Here are a few photos that were captured using this setup:| 4rknova.com
Introduction I recently stumbled upon an interesting DIY article[1] where the author used a very simple trick to enable a regular mobile phone to take macro-focus photographs. This looked like fun, so I tried to replicate the experiment and take some shots of my own. The idea is simple. A water droplet is placed on top of the phone’s camera to act as a magnification lens. In macro photography, the ratio of the subject size on the sensor plane to the actual subject size is at least 1:1[3]. N...| 4rknova.com
The twister effect is one of the most iconic demoscene effects. It simulates the twisting motion of a cuboid that is made of a soft, pliable material. How does it work The mathematical background behind this visual effect is suprisingly simple. Imagine a cuboid sliced into thin wafers from top to bottom. For each slice, we essentially have a 2D quad, which is mathematically defined by four points: x0, x1, x2, x3. When we view the geometry standing in front of it, each of these slices will app...| 4rknova.com
Introduction Spherical Harmonics (SH) are a type of Spherical Radial Basis Function (SRBF) that can be used to encode signals defined on a sphere in a compact way. This makes them an excellent fit for encoding a variety of datasets commonly used in real time graphics. One such dataset is irradiance maps. Spherical Harmonics are distributed across an infinite series of 0-indexed bands, with each band n adding 2*n+1 coefficients to the set. Higher bands add more granularity by encoding progress...| 4rknova.com
Radiosity Normal Mapping Traditional light mapping involves baking a fixed irradiance value based on static geometry and lighting. This fixed value cannot be combined with directional data stored in surface textures such as normal maps. This limitation creates a flat appearance in shadowed areas and visible discontinuities when transitioning between lit and shaded surfaces. To enable the use of normal maps with light maps in Half Life 2, Valve enhanced their lightmap baking tool (vrad) [5]. T...| 4rknova.com
Introduction What is Generative Art? The term ‘generative art’ refers to artwork that is created using an algorithmic process, often involving elements of randomization, symmetry, or repetition. Using basic geometric primitives and spatial transforms as building blocks, we can create visually appealing structures of varying complexity. The recipe can often be broken down into a small number of simple steps that are applied iteratively to produce the final piece. Generative art is a fascin...| 4rknova.com
Theory Drawing geometry using modern graphics APIs typically involves generating a set of data buffers to define a shape in terms of a collection of 3D point coordinates and the corresponding set of connections between those points. This is true for even the most trivial of shapes, including the humble screen aligned quad which consist of 2 triangles. Thankfully, both OpenGL and DirectX allow drawing simple geometry without the need to create any vertex attribute buffers, using a simple trick...| 4rknova.com
Theory Elementary cellular automata are defined in a single dimension of quantized space and control a binary state for each cell. They are usually visualized in 2D by mapping the second axis to time. In this context each quantized unit of time corresponds to an evolution of the previous state of the automaton based on a rule. A rule defines how each cell evolves based on the current state of its nearest neighbours and itself. For elementary automata, there is a fixed set of 8 transitions. Th...| 4rknova.com
One of the most popular effects in the early days of demoscene is the fire effect. Various versions of the effect have been implemented, not only for tech demos but also games. Amongst other titles, it can be seen in the intro of ‘Teen Agent’ masked by the text of the game’s title [1] and various ports of Doom, most notably the ones for Sega Saturn, Nintendo 64 and Sony PSX [3]. The entire effect is simulated in 2D and using a transform feedback buffer. There are multiple variants of th...| 4rknova.com
This blog post presents the evolution of the OpenGL API in terms of defining and submitting geometric attributes to the GPU. Please note that the different methods are not presented in full detail. Only relevant function parameters are explained and specialized functionality such as instancing is not included here so as to keep this post focused on beginner level concepts. Please see the references section for further reading resources. Immediate Mode At the begining, the OpenGL specification...| 4rknova.com
In computer graphics we sometimes need to determine which half-space a point is located in with regards to a plane. Perhaps the most common application of this is frustum culling, where we need to resolve whether a point lies within the camera frustum by testing against all of the frustum’s planes. Mathematical Formulation For a given point \(m\) and a plane \(P\) defined by a normal vector \(\vec{N}\) and a point \(x\) on \(P\), test which half-space \(m\) lies in. Solution The derivation ...| 4rknova.com
Distributed ray-tracing is a term that is commonly misconstrued, and often associated with the concept of parallel computing, where the calculations required to render an image are distributed across a network of processing nodes. The more appropriate term, ‘parallel ray-tracing’ is typically used to resolve the ambiguity. Whitted Ray-Tracing In the traditional Whitted algorithm, a ray is spawned, for every pixel in the screen. That ray is tested against the geometry of the scene to check...| 4rknova.com
The following is a list of short animation films that have some historical significance. Please note that the descriptions below are for the most part copied directly from the relevant source pages in the references section. Some of the videos are sourced from the Vintage CG youtube channel and text is copied verbatim from the video description. 1972, A Computer Animated Hand A Computer Animated Hand is a 1972 American computer-animated film produced by Edwin Catmull and Fred Parke. Produced ...| 4rknova.com
Theory L-systems are named after the Hungarian biologist / botanist Aristid Lindenmayer, who created them in 1968, while studying the growth patterns of various types of bacteria. L-systems were introduced as a formal way to describe the development of simple multicellular organisms, and also illustrate the neighbourhood relationships between plant cells. Later on, this system was extended to describe higher plants and complex branching structures [1]. Due to their nature, l-systems are usefu...| 4rknova.com
Introduction In mathematics, interpolation can be defined as the estimation of unknown data points based on the range of a discrete set of known data points. Interpolation has many applications in the field of computer graphics. For example, it can be used to generate paths for animating objects or cameras, to control the timing of a fading transition between two images, or to dynamically generate the glyphs of a font for different resolutions and sizes. A sophisticated interpolation method c...| 4rknova.com
Theory Lightness constancy is the perception that brightness of lit and dark surfaces remains constant under different illumination conditions. The human visual system interprets multiple visual queues and extrapolates sensory data. Our brain is good at recognising visual patterns including spatial queues and illumination features of the world around us. The popularized “Checker Shadow Illusion” demonstrates the effect. A cylinder is strategically positioned on a flat surface with a check...| 4rknova.com
Introduction I finally got a chance to look into RAID and after a bit of research decided to give BTRFS a try. BTRFS has some issues, which are documented here but for the setup that I am interested in, it appears to be mostly stable. This guide documents the steps I followed to setup my system. DISCLAIMER: The author assumes no responsibility or liability for any errors or omissions in the content of this page. The information contained here is provided on an “as is” basis with no guaran...| 4rknova.com
In graphics, we often need a way to filter or smoothen out a signal. Below is a collection of some functions that can be used to do that along with their respective plots. The input signal x is assumed to be in the [-1, 1] value range: \(1.0 - |x|^a\) a = 0.5 a = 1.0 a = 2.5 a = 5.0 a = 25.0 \(cos(\frac{\pi * x}{2.0})^a\) a = 0.5 a = 1.0 a = 2.5 a = 5.0 a = 25.0 \(1.0 - |sin(\frac{\pi * x}{2.0})|^a\) a = 0.5 a = 1.0 a = 2.5 a = 5.0 a = 25.0 \(min(cos(\frac{\pi * x}{2.0}), 1.0 - |x|)^a\) a = 0...| 4rknova.com
When generating a pair of stereoscopic images, it’s useful to have a way of testing the disparity and overall quality without having to put on an HMD device. ImageMagick provides a set of tools that allow performing a wide range of image processing. Amongst other things it allows creating Red-Cyan anaglyphs of stereo image pairs. The tool is very intuitive to use: $ composite -stereo 0:0 0.png 1.png anaglyph.png Below, you can see a stereo anaglyph of left and right eye images I generated u...| 4rknova.com
Definitions A Ray is defined as: \(\enclose{circle}[mathcolor="white"]{\color{white}{1}} \;\;\) \(P = P_0 + t * D\) A Plane is defined as: \(\enclose{circle}[mathcolor="white"]{\color{white}{2}} \;\;\) \(P \cdot N - C = 0\) This formula is known as Hesse Normal Form. The symbols are interpreted as follows: SymbolInterpretation \(P_0\)ray origin \(D\)ray direction (unit vector) \(N\)plane normal (unit vector) \(C\)plane distance from axis origin Derivation Substituting \(P\) in \(\enclose{circ...| 4rknova.com
Theory There are many ways to spread points across the surface of a disk but doing so in an even distribution can be challenging. Vogel’s method solves that problem elegantly. Each sample point is calculated in polar coordinates and then transformed to the equivalent Cartesian set. For each sample we need to specify two quantities, a radius and a theta angle. First the unit disk is divided to N rings of equal areas, where N is the total number of samples. Each ring will have a radius of: \[...| 4rknova.com
Distance Culling The scene objects are culled depending on their distance from the camera. If they are further than their maximum drawing distance or closer than their minimum drawing distance they are not drawn. Frustum Culling The view frustum is defined by the projection and represents a volume of space that the camera can see. In the case of 3D perspective projection the view frustum has a trapezoidal shape. All polygons are clipped against the frustum during rasterization and therefore g...| 4rknova.com
The following is a simple, comprehensive guide that explains in plain terms how literals can be used to encode / decode sprites within a fragment shader. The Bigger Picture For the time being we will limit our efforts to encoding monochrome sprites. A pixel in a monochrome bitmap can be either on or off (black or white) which means that we only require a single bit of memory to store each pixel’s value. The size of an signed integer in glsl 1.3 or later is 32-bits [1] which in theory means ...| 4rknova.com
Convolution In mathematics, convolution is a binary operation over two functions. It is a fundamental concept in signal processing theory and has numerous applications in a variety of different fields, including image processing and optics. The operator is defined as: \[(f * g) = \int_{-\infty}^{+\infty} f(\tau)g(t - \tau) dx\] Convolution is a commutative operator which provides a way of describing a Linear Time-Invariant (LTI) system by a signal g() and then compute the response to any sign...| 4rknova.com
Matrices are a powerful mathematical tool, used everywhere from solving systems of equations to rendering 3D graphics. In this post, we’ll explore the key matrix operations: transpose, conjugate, inverse, determinant, and also see how matrices drive geometric transformations in computer graphics. Core Linear Algebra Operations Below are the basic operations that a graphics programmers will typically come across. Transpose The transpose of a matrix is obtained by flipping it over its diagona...| 4rknova.com
Theory Color Grading is the process of altering and enhancing the color of a motion picture, video image or still photograph, either electronically, photo-chemically or digitally [1]. This technique is commonly used in films and video games to alter the color palette for aesthetic and communicative purposes. The following image from kaleidico.com demonstrates the overall effect. Drag the slider left or right to compare the two images. on the left side, the original photograph is shown. On the...| 4rknova.com
Theory The law of reflection defines how incident light rays reflect off the surface of a conducting material, and is governed by the following principles: The incident ray, the reflected ray, and the normal to the surface at the point of incidence all lie in the same plane. The angle of reflection is equal to the angle of incidence. Derivation The reflected ray for normalized normal vector \(n\) and incidence vector \(i\) pointing towards the surface, is calculated as follows: \[r = i − 2 ...| 4rknova.com
Description Pixelization is one of the simplest effects to implement. The main idea behind this effect is to divide the screen into squares of arbitrary size and then for each of these squares, sample a single color from the source image. Taking this one step further, it’s possible to use different shapes to subdivide the screen space (eg. circles), achieving a more complex visual feel. Samples Below you can see examples of the effect implemented in shadertoy. Simple pixelization #define LU...| 4rknova.com
Theory Fast approximate anti-aliasing (FXAA). Is a post processing depth-aware edge filter. It’s a cheap and fast alternative to MSAA that can produce good visual results. The algorithm consists of two steps: Determine whether the shaded pixel is located on an edge. Smooth the problematic pixel values by applying a blur filter. Note that anti-aliasing methods such as FXAA should be applied prior to rendering the UI elements because the filtering process can have a noticeable impact on it as...| 4rknova.com
Overview A few years back, I was working on my offline renderer and I needed a way to describe simple scenes in a human readable format. I created NCF to serve that purpose and wrote a handy parser for it. What follows is a description of the language format. The parser is written in c++ and is available at github NCF is a data serialization language (DSL) like YAML, XML and JSON. It provides the mechanics to implement complex hierarchy descriptors. Each line constitutes a separate entry. All...| 4rknova.com
Introduction In 1980 Jim Blinn produced computer graphics animations for Carl Sagan's PBS series Cosmos. For the 11th episode of the series, entitled: "The Persistence of Memory" he made an animation of the DNA helix. In order to model the helix he proposed approximating each atom by a Gaussian potential, and using superposition of these potentials to define an iso-surface. He then used ray-tracing to render the animation and named the resulting structure "blobby objects" [1]. Shortly thereaf...| 4rknova.com
Introduction The Pseudo-3D tunnel is a well known effect, which was commonly seen in old demos. It uses a very simple mapping trick to create the illusion of movement in 3d space. The algorithm is very easy to understand and implement, and only requires basic trigonometry knowledge. Theory An easy way to visualize how the algorithm works, is to imagine a texture projected on the surface of an axis aligned finite cylinder. This can be achieved by mapping the texture's u coordinate around the c...| 4rknova.com
The dot product is more than just a formula, it tells us important information about the relationship between two vectors: Shows how much one vector points in the direction of another: It measures how much of one vector lies along the other. Indicates the angle between vectors: It can tell whether vectors point in the same direction, opposite directions, or are perpendicular. Used in physics for work: It helps calculate work done when a force moves an object. Measures similarity: In higher-di...| 4rknova.com
Theory Conway’s game of life is a cellural automaton. It was invented by John Horton Conway, an English mathematician. A 2D plane is subdivided into a grid where each cell is either occupied or not. The simulation follows the following set of rules: Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. Any live cell with more than three live neighbours dies, as if by overcrowding. Any live cell with two or three live neighbours lives on to the next generat...| 4rknova.com
Mandelbrot Set The Mandelbrot set is perhaps the most popular fractal. It was named after the mathematician Benoit B. Mandelbrot. The mathematical background is quite simple to understand, especially if you are familiar with the complex numbers theory. The following recursive equation is used: \[z_{n+1} = z_{n}^2 + c\] with: \[z_n \in \mathbb{C} \\\ \lim_{n \rightarrow \infty}\| z_{n} \| \ne \infty \\\ z_{0} = c\] It’s mathematically proven that for given \(c\) if the above limit exceeds 2 ...| 4rknova.com
Sometimes it is desirable to embed resource files in c or c++ programs. There are many ways to go about it but in most cases you must convert the files with external tools or scripts. Using external tools For image files, image-magick can be used: $ imagick input.png output.h Another common tool that can convert all types of files is xxd. $ xxd -i input.whatever output.h While the above methods are perfectly valid, some extra dependencies are added to the build process. Using the preprocessor...| 4rknova.com
Introduction Primus is now available in debian, therefore the following procedure is obsolete and will not work with the latest version. Primus is a VirtualGL alternative for bumblebee that promises a significant performance boost. While a few distributions have already included primus in their repositories, this is not the case for debian. Furthermore, I could not find any information online on how to use primus under debian, or any explicit reference by any user that has been successful wit...| 4rknova.com
A breakdown of how to build a custom Three.js shader that recreates the iridescent, sparkling look of foil stickers using vertex deformation, angle-based color shifts, and procedural flakes.| www.4rknova.com