<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Denis Radin on Medium]]></title>
        <description><![CDATA[Stories by Denis Radin on Medium]]></description>
        <link>https://medium.com/@pixelscommander?source=rss-3bf91286c9d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MpXjKYuFjkyGNPOQ-6A6LQ.jpeg</url>
            <title>Stories by Denis Radin on Medium</title>
            <link>https://medium.com/@pixelscommander?source=rss-3bf91286c9d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:48:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pixelscommander/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why does WebGL antialiasing lie?]]></title>
            <link>https://medium.com/@pixelscommander/why-does-webgl-antialiasing-lie-51e5d3e208bb?source=rss-3bf91286c9d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e5d3e208bb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[antialias]]></category>
            <category><![CDATA[rendering]]></category>
            <category><![CDATA[webgl]]></category>
            <dc:creator><![CDATA[Denis Radin]]></dc:creator>
            <pubDate>Tue, 16 Nov 2021 20:27:16 GMT</pubDate>
            <atom:updated>2021-11-16T20:32:52.320Z</atom:updated>
            <content:encoded><![CDATA[<p>Do not want your WebGL to look like garbage? You may like this read then which explains what AA is, which kinds are available, and how to detect if there is no hardware antialiasing available in order to react on this preventing your app from looking jagged. And please, keep your expectations right, this is quite advanced stuff many people can live without.</p><h3>What is anti-aliasing?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JPxX37SwOOj_zJyqcpr6ZA.png" /><figcaption>Looks sweeter with AA, right?</figcaption></figure><p>Ever seen pixelated (stairs-like) edges on objects when playing computer games or using 3d applications? These stairs are called jaggies and removing them is the primary goal for having anti-aliasing (AA).</p><p>In WebGL AA can be done in two ways:</p><ul><li>Hardware antialiasing controlled by driver and browser (most cases MSAA)</li><li>Less performant software MSAA / FSAA / FXAA antialiasing controlled by shaders you or 3d engine apply</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/0*fkuclEuP7YwYfJ3r.jpg" /><figcaption>The visual difference between kinds of AA</figcaption></figure><p>The difference? There is some difference in how it looks but performance is a bigger concern. Of course, hardware AA is the quickest and we would like to use it by default. However, it is not always available in a browser or maybe just disabled during glContext initialization. When hardware anti-aliasing is not there and high image quality is the goal we would like to enable software anti-aliasing in a 3d engine (which is slower but would prevent the scene from looking pixelated) and here comes a problem.</p><h4>In WebGL anti-aliasing is a request, not a requirement</h4><p>Ideally detecting if antialiasing is enabled should be possible with WebGL context`s antialias property. So if antialias === true antialiasing would be considered to be on. However, it is not as simple as that. Let`s check <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/">the spec</a>…</p><blockquote>The depth, stencil and antialias attributes, when set to true, are requests, not requirements. The WebGL implementation should make a best effort to honor them. When any of these attributes is set to false, however, the WebGL implementation must not provide the associated functionality.</blockquote><p>So the trick with antialias property is that it is just a request. It may not reflect if anti-alias is actually enabled. By setting it to true we ask a browser to enable AA if possible. And if not and enabling fails for some reason? The property still remains true! So how can we know for sure if anti-aliasing is available or not?</p><h4>The solution</h4><p>We can do rendered image analysis to check if antialiasing was applied to it. Let`s draw a white triangle on black then check the intersection of white and black parts. If there is any color in between of#000000 and #FFFFFF then antialiasing is enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_8Sl-n__zW5C5OJu0qmmg.png" /><figcaption>On the left: Triangle drew without AA, only white/black. On the right: Triangle drew with AA. Gray pixel between white/black makes the transition smoother and actually allows to determine if there was any AA applied</figcaption></figure><p>I did a simple helper which implements this. Feel free to grab from <a href="https://github.com/PixelsCommander/isAntialiasingSupportedForWebGL">GitHub</a> or NPM.</p><h4>Library usage</h4><p>First, install with npm install isantialiasingsupported . Once it is included in your project you may check if (window.antialiasingSupported).</p><h4>Hardware anti-aliasing is broken, what is next?</h4><p>If you use one of the popular WebGL engines I have good news. Enabling software anti-aliasing would be as easy as adding 1–2 lines of code.</p><ul><li><a href="https://github.com/mattdesl/three-shader-fxaa">Three.js FXAA package</a></li><li><a href="https://doc.babylonjs.com/how_to/how_to_use_postprocesses#fxaa">BabylonJS FXAA manual</a></li></ul><p>And if your engine does not have an anti-aliasing plugin yet then it might get a little bit more complicated but still doable. First, check the <a href="https://en.wikipedia.org/wiki/Category:Anti-aliasing_algorithms">difference between kinds of anti-aliasing</a> and implement the one you like as a custom pass.</p><h4>Conclusion</h4><p>Just making exciting 3D content is not enough to deliver a great experience for a user. Being sure that the final image is sharp and looks great is no way less important. Keep an eye on antialiasing availability, since there is no reliable way in WebGL API to detect if the current browser/GPU pair actually supports anti-aliasing you may need a bit of code or a <a href="https://github.com/PixelsCommander/isAntialiasingSupportedForWebGL">tiny library</a> to work this around and react to the absence of AA enabling software one, therefore, keeping high image quality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e5d3e208bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How computers can pray for the benefit of all living beings using ReactJS & WebGL?]]></title>
            <link>https://medium.com/@pixelscommander/how-computers-can-pray-for-the-benefit-of-all-living-beings-using-reactjs-webgl-d65d64b086d0?source=rss-3bf91286c9d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d65d64b086d0</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[babylonjs]]></category>
            <category><![CDATA[webgl]]></category>
            <dc:creator><![CDATA[Denis Radin]]></dc:creator>
            <pubDate>Tue, 29 Oct 2019 23:25:50 GMT</pubDate>
            <atom:updated>2020-05-12T09:43:05.364Z</atom:updated>
            <content:encoded><![CDATA[<h3>How computers can pray for the benefit of all living beings using GPU &amp; ReactJS?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZN0xYWiwrHMP2B4ZSMd2Gw.png" /></figure><p>You’ve probably noticed over the last two years that I haven’t been that active writing on the blog. Sorry, I was busy with this study. Let’s make an agreement straight away — this is not your ordinary tech article (although you will find some interesting implementation details here). This is a study to prove that new technologies don’t tear the fabric of time, to prove that things that seem incompatible, located in unimaginably distant cultural coordinates, can still be touched and the touch is beautiful. For me personally, this study is especially significant. The story began ten years ago when a Buddhist friend proposed making a mobile prayer application. This venture raised a huge number of questions to be resolved before the primary one could be addressed: “Can a computer pray for the benefit of all living beings?”</p><h3>Prelude</h3><p>Prayer… What could be more distanced from modern technology? According to most religions (such as Christianity, Islam, Hinduism) prayer is an execution of customs in order to communicate to deities and request something from them. However, Buddhism sets getting rid of suffering and reaching enlightenment as a primary goal. What is very interesting is that when one prays, it produces benefits for all surrounding living beings. Compassion, assistance, care, good wishes — these are what Buddhist customs are designed to produce. And if other religions can be compared to client/server architecture, then Buddhism assumes a decentralized p2p medium where benefits may be produced by every being, not limited to living beings…</p><h3>Machines for praying now and then</h3><p>Prayer via computer? “A strange, cyberpunk idea,” you think. However, in Tibetan Buddhism, for many centuries there existed several types of prayer machines. The most famous of them is a prayer wheel, which is widely distributed in modern China, Nepal, India, and Bhutan. The time and place of their origination are uncertain. Legend has it that the prayer wheels were brought to the world of people by the master <a href="https://en.wikipedia.org/wiki/Nagarjuna">Nagarjuna</a>, who obtained them on his journey into the underwater world of dragon-like creatures — <a href="https://en.wikipedia.org/wiki/Nagarjuna">the naga</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*3qJ7sFTkbVVJITG7.jpg" /><figcaption>Picture of a naga on the wall of Chusan village, Upper Mustang, Nepal</figcaption></figure><p>Some researchers consider the drums to be a legacy of the ancient pre-Buddhist Bon religion that has existed in Tibet since the beginning of our era. Others refer to the first written records of prayer wheels found in the scriptures of monasteries on the border of India and Nepal, dating back to the 11th century AD when these machines were already an established tradition. Professor Gregory Schopin translated one of these texts written by a monk named Vipulashrimitra, who lived in the 11th century at the Buddhist University of Nalanda (according to legend, Nagarjuna studied there).</p><blockquote><em>From continuous effort the Perfection of Wisdom Sutra constantly revolves in the great temple of the Avalokiteshvara, by means of the book case constructed by Vipulashrimitra, and he installed four images in the alms-houses on the holidays.</em></blockquote><p>A typical prayer wheel is a metal or wooden hollow cylinder mounted on an axis. On the outside of the wheel, there is an engraved <a href="https://en.wikipedia.org/wiki/Om_mani_padme_hum">6-syllable mantra of the compassion Buddha</a>: “Om ma ni pad me hum”, and inside there is a roll with the same mantra printed or handwritten. There could be hundreds of mantras inside of a little handheld wheel, and many millions in stationary wheels built in monasteries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*upisv-5JXJ_YSjhj.png" /></figure><p>Using a prayer wheel is considered to be a powerful purifying practice, with one revolution of a wheel producing the same benefits for all living beings as would the oral utterance of the number of mantras that are located inside the drum. Here is what Buddhist leaders and lamas say about the wheel:</p><blockquote><a href="http://www.shabkar.org/download/pdf/Significance_and_Benefits_of_Six-Syllable_Mantra_Recitation.pdf"><em>Ancient Tibetan Buddhist text entitled “Mani Kabum.” </em></a><em>17 c. — The prayer wheel is like a precious jewel: whatever you wish for, it will accomplish all the supreme and ordinary attainments.</em></blockquote><blockquote><a href="https://en.wikipedia.org/wiki/Thubten_Zopa_Rinpoche"><em>Lama Zopa Rinpoche</em></a><em> (Dalai Lama student, the head of Mahayana traditions preservation) — installing a prayer wheel has the capacity to completely transform a place, which becomes peaceful, pleasant, and conducive to the mind.</em></blockquote><blockquote><a href="https://en.wikipedia.org/wiki/Jigdal_Dagchen_Sakya"><em>His Holiness Jigdal Dagchen</em></a><em> (head of Tibetan monastery of Seattle) — Spinning a prayer wheel purifies our body, spirit, and mind.</em></blockquote><blockquote><a href="https://en.wikipedia.org/wiki/Gautama_Buddha"><em>Gautama Buddha</em></a><em> (in the sutra entitled the Great River) — The benefit of turning the Dharma wheel is that negative karma and disturbing thought obscurations accumulated over beginning-less rebirths are purified without effort. Even other mantras are without doubt completed.</em></blockquote><p>There are a few kinds of prayer wheels, characterized by how they are powered: spun by a human, or propelled by the wind, water, or even fire.</p><p>An old man makes use of a prayer wheel at the main square of Lomanthang, the capital of Upper Mustang</p><p>Stationery prayer wheel in the wall of Kagbeni Monastery, Upper Mustang</p><p>Water-propelled prayer wheel in the Muktinath Temple, Nepal</p><p>Prayer wheels — practiced and believed by hundreds of millions — are inanimate objects, machines that are able to convert the mechanical energy of spinning into the transcendental energy of a prayer, bringing a good wish and benefits to all living beings. Could it be done the same way with a digital machine, with a computer? Can computers transform energy into a spiritual message, thereby transforming the world?</p><p>“Prayer wheel” was the only hook I had in the research, so it was important to understand how the practice works. I started by reading thematic literature. Surprisingly, such an interesting phenomenon is described poorly by Western authors. The <a href="https://openlibrary.org/authors/OL1481330A/Simpson_William">first book that spoke to me </a>, <em>Buddhist Prayer Wheel</em>, was written in 1896 by Englishman William Simpson, based on his experiences traveling to Tibet and Nepal.</p><p>A voluminous work about circular movements in religion and rites, it’s not an easy read due to its Victorian English, but it is interesting to observe the author’s amazement at the cultural phenomena of Buddhism, which had been just discovered by Western researchers. In fact, Simpson coined the term “praying machine,” apparently having been influenced by the industrial revolution that had just ended in his motherland. The book depicts all kinds of prayer wheels in detail: propelled by human muscles, wind, water, fire. Unfortunately, Simpson’s work has little to do with the spiritual aspect of using wheels and there are no translations of the original Tibetan texts at all.</p><p>Another work, written by our contemporary Lorne Ladner, who lives in Washington, came to the rescue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/0*5WEleK5MHj_hATNQ.jpg" /></figure><p>The goal of his work is to popularise prayer wheel practice and describe the spiritual component. It is actually interesting how, using these two books, the path traversed by Buddhism in Western culture over the past 100 years can be traced: from an exotic curiosity to a religion that is fully accepted by the society which invests in the popularisation of Buddhism. Lorne’s book became a great find, as it describes how the practice works and contains texts of ancient lamas, enabling readers to draw some insightful conclusions on the topic. When I read it, I’d already had a little experience using the wheel, and the method I intuitively found was pretty much similar to that described in Tibetan texts. From them, an important aspect became clear — if water or wind-propelled prayer wheels work on their own and are considered artifacts that purify space, then the wheels rotated by man are a spiritual practice in which the prayer spins the drum, asking for mercy and compassion for all living beings, desiring for happiness, freedom, and deliverance from suffering for everyone. The prayer wheel is the ritual, spiritual activity aiming to transform the world for better and here the wheel itself is a visualization and a focal point.</p><h3>Visualization? I can do it with JavaScript!</h3><p>Visualization? I can do it in javascript! Moreover, <strong><em>his Holiness the Dalai Lama announced that the mantra on the computer screen works the same as the traditional one.</em></strong></p><p>And from a technical point of view, I was confident of success after several years of developing React + WebGL applications.</p><p>When traveling in Asia, observing many prayer wheels, I specifically noted the materials used and aesthetics required, so I knew exactly what I would need to create an open-source WebGL wheel that would be an authentic visualization of the practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*7jHtHxTXKXEMuaKD.png" /></figure><p>I needed a <a href="https://en.wikipedia.org/wiki/Physically_based_rendering">physically-based rendering </a>and a good 3D artist who, as is standard practice in developing 3D applications, is 70% responsible for great graphics. Fortunately for me, PBR was at hand — in BabylonJS, there is an excellent implementation out of the box, and a few weeks later an experienced artist from Moscow was found, regularly wintering in Asia. I had it on good authority that he was familiar with prayer wheels. This was an important requirement; the artist should know the details of the design because authenticity is important in creating a spectacular visual impression.</p><h3>State management</h3><p>To manage the state of the application, I decided not to use heavyweight Redux / MobX, but React`s ContextAPI. Though regretting my choice initially because of the need to write a significant amount of useless low-level code, I then rejoiced at the ability to develop a small cool wrapper for the ContextAPI that allows you to change data in the application state, as simply as changing properties ​​of a JS object. Feel free to check out <a href="https://github.com/PixelsCommander/QuickContext">the easy way of managing ContextAPI</a> state.</p><h3>Interaction</h3><p>An imperative, crucial task was the absolutely realistic rotation of the wheel in response to user actions. The first problem I encountered was the difference in the rotation of the wheel while dragging by the central part versus the edge. After all, the center of the cylinder is closer to the axis and its extreme point from the axis is located at different angles to the projection of the screen. This means that dragging, say, 10 pixels in the center of the wheel, we will rotate it at a smaller angle than after dragging by the same 10 pixels closer to the edge. This may seem like an insignificant detail at first glance, but in practice, it is a critical nuance for having a sense of complete realism in touch rotation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*oYXTfZRgY0hM-Qir.png" /></figure><p>The angle A is almost half the angle B with the same projection onto the screen plane.</p><p>To solve the problem, we use fairly simple trigonometry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/0*ueTXoXe9n5Pe1js9.png" /></figure><p>If, when touching the center of the cylinder, touchPosition = 0, and when touching the edge touchPosition = 1, then the angle from the center to the point of a touch is acos(touchPosition). Respectively, knowing the angle of contact on the previous frame, you can calculate the rotation speed oldTouchAngle — newTouchAngle. Then repeat it on every frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xp5Knc-xzPTYHq9v.png" /></figure><p>In addition to correctly calculating the angular velocity transmitted by passing a finger over the surface, realistic physics is also needed. The wheel has mass and friction, for the implementation of which current speed is multiplied by the magnitude of the friction on every frame. In addition, we cannot immediately transmit the speed of rotation obtained from the energy applied by the finger, because the wheel has mass, plus friction and the adhesion of the finger on the prayer wheel is not perfect. Here linear interpolation (the LERP technique) comes to the rescue. Thus, the current wheel speed does not work out straight from the speed of the finger, and each frame changes, tending to be equal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kV4aJkehqkugMIiq.png" /></figure><p>0.2 determines the adhesion quality, and when replacing 0.2 by 1, the speed will be transmitted from the finger to the prayer wheel instantly. After putting in place the correct calculation of the rotation speed with LERP and friction, we got a realistic and detailed physical model.</p><p>From a visual aspect, the process was affected by the artist’s lack of experience in creating models for Babylon.js. Therefore, multiple details like shininess and reflectivity of materials had to be sorted out by myself. However, it was well worth the effort, as the result matched our expectations, especially regarding materials and reflections.</p><p><strong>Meet </strong><a href="http://karmawheel.org/"><strong>the world’s first Web-technology based prayer wheel</strong></a><strong>!</strong></p><p>Moreover, <a href="https://github.com/PixelsCommander/PrayerWheel">it is open source</a>. Every accepted pull request is deployed to the app automatically. Want to add a side settings menu, a choice of a background image, or traditional Tibetan music? You are welcome!</p><p><strong><em>You do not have to be a Buddhist to use the wheel, but there is a prerequisite — you may rotate it only with a pure thought for the benefit of loved ones and all living beings.</em></strong></p><p>The wheel perfectly helps in moments of anxiety, calming, and tuning the mind in a constructive manner. Try using it before an important meeting.</p><h3>Expedition</h3><p>Our venture could have been stopped at the creation of wheels, but curiosity pushed us to test the application on real users. And who can be a more relevant focus group than the inhabitants of the Tibetan Highlands, who have been practicing prayer with the help of wheels for centuries? Who can be more authoritative in the matter of Buddhism than a Tibetan monk practicing for decades? I decided to go to the Himalayas. In the process of planning the expedition, the choice was made to go to the Lo kingdom — the protected area of ​​Nepal, bordering Tibet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*1P3IxycBCLj148tY.png" /></figure><p>Due to the need to obtain permission from the government of Nepal and the King of the Upper Mustang, only 600–800 tourists visit the region annually, which is less than those who reach the peak of Everest in a year! And it is the place where the pristine Tibetan way of life has been preserved, with Buddhist monasteries founded in the 8th-10th centuries still in service. Let’s listen to what the monks of the Lomantang Monastery say about prayer wheels, and what they think about the prayer wheel developed in JavaScript.</p><h3>Conclusion</h3><p>Millions of people in the world use prayer machines — prayer wheels, both driven by the physical strength of a person and working without his/her participation. Can a computer be a prayer machine? Since His Holiness the Dalai Lama has declared the power of the mantra on the computer screen equivalent to the power of the traditional mantra, you can pray using an application written in JavaScript. What is important is that a computer displaying a spinning wheel purifies the place, sending goodwill for the benefit of all living beings and purifying their karma, which could be considered a prayer.</p><h3>P.S.</h3><p>While working on the study, I was many times visited by the idea that programming is very similar to spiritual practices in terms of focus, subtlety of the outcome, and the desire to transform the world. So if development is the practice that resonates with you, and if you do the practice correctly, then the process brings satisfaction and calm. But is it always like that? Of course, it is not! Perhaps everyone has felt at least once that he was engaged in a project which did not bring joy to work on, and the written code did not add any good to the world. And, as developers, this is our great concern and responsibility — to strive to carry out the practice correctly, with a pure heart, to work on projects for the benefit of all living beings.</p><p><em>Originally published at </em><a href="http://pixelscommander.com/interactive-revolution/can-computer-pray-for-the-benefit-of-all-living-beings-praying-with-javascript-and-webgl/"><em>http://pixelscommander.com</em></a><em> on October 29, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d65d64b086d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web app testing pro-tip: stress your application with dropped frames]]></title>
            <link>https://medium.com/@pixelscommander/web-app-testing-pro-tip-stress-your-application-with-dropped-frames-a784e9ffde7a?source=rss-3bf91286c9d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/a784e9ffde7a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <dc:creator><![CDATA[Denis Radin]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 14:11:39 GMT</pubDate>
            <atom:updated>2019-02-21T10:27:12.820Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web apps testing pro-tip: stress your application with dropped frames</h3><p>Does your app use any logic on requestAnimationFrame or per frame animations? Low FPS or dropped frames might lead to some critical bugs then. This article is a case on why you should not underestimate this and how to test against dropped frames and low framerate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CMZ1xsWp9dA9MWT1__Tsrw.png" /></figure><p>A few months ago we &#39;ve been celebrating a big thing in Evolution Gaming — the release of a new game. Hooray! Unique, first of its kind 3D roulette game built with React and WebGL went live. We &#39;ve been looking for recognition and success…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIUD1ToSDW-4%3Fstart%3D538%26feature%3Doembed%26start%3D538&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIUD1ToSDW-4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIUD1ToSDW-4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/61c2f6dcbe5d0d49967eb26fd671be89/href">https://medium.com/media/61c2f6dcbe5d0d49967eb26fd671be89/href</a></iframe><p>Development of the game was lasting around a year. This was the first game delivered by 3d development department in the company. Finally, we start using 3d graphics instead of video streamed games. Finally, ̶a̶ ̶r̶o̶b̶o̶t̶ WebGL is going to replace a croupier. Finally hi-tech is going to be celebrated in such a conservative segment as B2B solutions for big casinos in the Vegas and Macao!</p><p>Two days after the release we got some complaints from users. It was very little of them — less than 1% percent of the overall number of players but they were devastating.</p><blockquote>“You are cheating on us! I bet on red, the ball is on red and the game says I lost!”</blockquote><p>Few teams started to investigate the bug which was a disaster for the company image of a top solutions supplier. The appearance of a bug (as it normally happens with bugs) was quite a surprise. First of all, backend passes a very strict certification in a special bureau for every jurisdiction we run a game. Then frontend is being tested in four levels: by developers, by automated testing, manual testing and manual testing in a separate “products quality” department.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_TXvhuVQILWjrJYcnhHvA.png" /><figcaption>Evolution Gaming QA pipeline</figcaption></figure><p>How this multi-layered machine missed through that serious bug as lost of sync between a real game result and a visual representation?</p><p>And yeah it was less than 1% of players… In our team, it was basically not reproducible. We required a few stressful hours before got the first catch: ”Bug is reproducible with older Android phones.” Next hour — next news: ”Bug is reproducible better under the heavy CPU load.”. After that report we started to throttle CPU to the maximum so got the bug reproducible 30% of runs. Which is better than 0% but still fixing a bug in that way is crazy hard. Every time you need to prove or break your hypothesis you need 3 runs to reproduce and still you can never be sure…</p><p>The bug was caused by dropped frames and the approach we played roulette ball animation (keyframe animations). Costs of having the bug were huge for the company and team was exhausted fixing this. Since recalling the game from clients was impossible fixing last from the midday until 4 am.</p><h4>How to test against dropped frames?</h4><p>Your application uses animations or any kind of logic being executed on requestAnimationFrame? Especially for you, I did a little <a href="https://chrome.google.com/webstore/detail/fps-control/jolcefamincmnepgphdiojccmfaflane?hl=en">Chrome extension called FPS Control</a> which allows to drop frames (25% / 50% / 90%) and limit FPS (2 / 10 / 30). How does it work? Basically, monkey patches the requestAnimationFrame so it works as expected and if we have this extension earlier…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsUdGmrrvQGg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsUdGmrrvQGg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsUdGmrrvQGg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cfb10742c03059963c54be045d13424/href">https://medium.com/media/7cfb10742c03059963c54be045d13424/href</a></iframe><h4>Conclusion</h4><p>Learn from others, stress your apps and games with dropped frames and low FPS to prevent critical bugs. And remember… It is or you stress app with testing or app stresses you with bugs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a784e9ffde7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>