<?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[AR Tips And Tricks - Medium]]></title>
        <description><![CDATA[A place where I document my findings and make them available to the masses. For all blog posts go to www.oscardelahera.com/blog - Medium]]></description>
        <link>https://medium.com/ar-tips-and-tricks?source=rss----7c6c18b9e77b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>AR Tips And Tricks - Medium</title>
            <link>https://medium.com/ar-tips-and-tricks?source=rss----7c6c18b9e77b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:09:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ar-tips-and-tricks" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to hide and show items in Maya]]></title>
            <link>https://medium.com/ar-tips-and-tricks/how-to-hide-and-show-items-in-maya-4dbd211c406b?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/4dbd211c406b</guid>
            <category><![CDATA[3d]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[maya]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[3d-modeling]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Mon, 14 Jan 2019 15:28:54 GMT</pubDate>
            <atom:updated>2019-01-14T15:28:54.399Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*HwcYVFrJ3DzV0iEt" /><figcaption>Every post needs an image.</figcaption></figure><p>Please note that this tutorial is for mac</p><p>As shown in this sneaker tutorial:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fi3YBLhKeSjo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Di3YBLhKeSjo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fi3YBLhKeSjo%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/e7d3f4465e15a08eb35fa2184c6891b8/href">https://medium.com/media/e7d3f4465e15a08eb35fa2184c6891b8/href</a></iframe><p>To hide, select the item and press <strong>control + h</strong>.</p><p>To show the item, select the item and press <strong>shift + h</strong>.</p><p>O</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dbd211c406b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/how-to-hide-and-show-items-in-maya-4dbd211c406b">How to hide and show items in Maya</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARKit : Lighting and Materials Part II]]></title>
            <link>https://medium.com/ar-tips-and-tricks/arkit-lighting-and-physically-based-rendering-part-ii-eae00a3e0128?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/eae00a3e0128</guid>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[arkit]]></category>
            <category><![CDATA[lighting]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Mon, 07 Jan 2019 01:40:22 GMT</pubDate>
            <atom:updated>2019-01-07T02:14:09.892Z</atom:updated>
            <content:encoded><![CDATA[<h3>ARKit : Lighting and Materials Part II</h3><p>Last post, we covered how to get <a href="https://medium.com/ar-tips-and-tricks/arkit-lighting-and-physically-based-rendering-part-i-c45ac841ee74">basic lighting</a> setup. Today, we will cover Lighting Models and Physically Based Rendering Properties.</p><h4>Download an AR camera starter project <a href="http://www.artzyapp.com/">here</a>.</h4><h3>Recommended Reading</h3><p>The following post is based on the following documentation:</p><ul><li><a href="https://developer.apple.com/documentation/scenekit/scnmaterial">SCNMaterial</a></li><li><a href="https://developer.apple.com/documentation/scenekit/scnmaterial/1462518-lightingmodel">Lighting Model</a></li></ul><h3>Outline</h3><p>ARKit creates a material for a model using the SCNMaterial object. It does this via a lighting model and a set of visual properties, each of which ultimately defines how it will behave in SceneKit’s shading and lighting process.</p><h3>Lighting Model</h3><p>The lighting model is the property that Scenekit uses to determine the visual properties of your model with the lights in the scene, to produce the final pixel color for each pixel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e9nVmLeGeANSpGML.png" /><figcaption><a href="https://developer.apple.com/documentation/scenekit/scnmaterial/lightingmodel">Apple’s Lighting Model Sample</a></figcaption></figure><h4>Physically Based Rendering</h4><p><em>Shading based on a realistic abstraction of physical lights and materials.</em></p><h4>Blinn</h4><p><em>Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Blinn-Phong formula.</em></p><h4>Constant</h4><p><em>Uniform shading that incorporates ambient lighting only.</em></p><h4>Lambert</h4><p><em>Shading that incorporates ambient and diffuse properties only.</em></p><h4>Phong</h4><p><em>Shading that incorporates ambient, diffuse, and specular properties, where specular highlights are calculated using the Phong formula.</em></p><h3>Visual Properties: Physically Based Rendering</h3><h4>Diffuse</h4><blockquote>Diffuse shading describes the amount and color of light reflected equally in all directions from each point on the material’s surface. The diffuse color of a pixel is independent of the point of view, so it can be thought of as a material’s “base” color or texture.</blockquote><blockquote>By default, the diffuse property’s <a href="https://developer.apple.com/documentation/scenekit/scnmaterialproperty/1395372-contents">contents</a> object is a white color. The figure below shows the effect of setting the diffuse property’s contents to a texture image on a material whose other properties have default contents.</blockquote><blockquote>The material’s <a href="https://developer.apple.com/documentation/scenekit/scnmaterial/1462518-lightingmodel">lightingModel</a> property determines the formula SceneKit uses to combine its diffuse color and other visual properties with lights and other contents in a scene to produce the final color for each rendered pixel in the rendered scene. For details, see <em>Lighting Models</em>.</blockquote><blockquote>- Apple Documentation</blockquote><p>To break this down using the image below. Depending on how the lights affect an object, there will be more or less light at each point on the surface — essentially saying which parts are “light”/white or “dark”/black.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*HM7L423rWgZfX269.png" /><figcaption><a href="https://developer.apple.com/documentation/scenekit/scnmaterial/1462589-diffuse">Apple Diffuse Image Sample</a></figcaption></figure><p>If you were then to then map an image on top of this color, it would have to be affected in a way that matches the light and dark areas.</p><h4>Metalness</h4><blockquote>This property measures only the total intensity of color values; texture contents are best defined in grayscale.</blockquote><blockquote>This property generally approximates aspects of a physical surface — such as index of refraction, tendency to produce sharp reflections, and tendency to produce Fresnel reflections at grazing angles — that together produce an overall metallic or nonmetallic (also called dielectric) appearance. Lower values (darker colors) cause the material to appear more like a dielectric surface. Higher values (brighter colors) cause the surface to appear more metallic.</blockquote><blockquote>This property applies only when the material’s <a href="https://developer.apple.com/documentation/scenekit/scnmaterial/1462518-lightingmodel">lightingModel</a> value is <a href="https://developer.apple.com/documentation/scenekit/scnmaterial/lightingmodel/1640553-physicallybased">physicallyBased</a>.</blockquote><blockquote>- Apple Documentation</blockquote><p>To break this one down:</p><ul><li>Use a grayscale color to define this property.</li><li>The darker, the more ‘non-metallic’.</li><li>The lighter, the more ‘metallic’.</li></ul><h4>Roughness</h4><blockquote>This property measures only the total intensity of color values; texture contents are best defined in grayscale.</blockquote><blockquote>This property approximates the level of microscopic detail — for example tiny bumps and cracks — in a surface. By approximating these “microfacets” as a single term, this property helps produce lighting calculations that resemble the energy-conserving laws of real-world physics, resulting in more realistic variation between matte and shiny surfaces. Lower values (darker colors) cause the material to appear shiny, with well-defined specular highlights. Higher values (brighter colors) cause specular highlights to spread out and the diffuse color of the material to become more retroreflective.</blockquote><blockquote>This property applies only when the material’s <a href="https://developer.apple.com/documentation/scenekit/scnmaterial/1462518-lightingmodel">lightingModel</a> value is <a href="https://developer.apple.com/documentation/scenekit/scnmaterial/lightingmodel/1640553-physicallybased">physicallyBased</a>.</blockquote><blockquote>- Apple Documentation</blockquote><p>To break this one down:</p><ul><li>Use a grayscale color to define this property.</li><li>The darker, the more ‘shiny’.</li><li>The lighter, the more ‘matte’.</li></ul><p>That’s all for now.</p><p>Oscar</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eae00a3e0128" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/arkit-lighting-and-physically-based-rendering-part-ii-eae00a3e0128">ARKit : Lighting and Materials Part II</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARKit : Lighting and Physically Based Rendering Part I]]></title>
            <link>https://medium.com/ar-tips-and-tricks/arkit-lighting-and-physically-based-rendering-part-i-c45ac841ee74?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/c45ac841ee74</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Thu, 03 Jan 2019 16:29:21 GMT</pubDate>
            <atom:updated>2019-01-07T01:20:12.969Z</atom:updated>
            <content:encoded><![CDATA[<h3>ARKit : Lighting and Materials Part I</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FnN2C84pa-NpH0zt.jpg" /><figcaption>Wait, that’s rendered?</figcaption></figure><h4>Download an AR camera starter project <a href="http://www.artzyapp.com/">here</a>.</h4><p>The following tutorial aims to cover SCNLight’s, how to add them and what basic attributes are and what they signify.</p><h3>Recommended Reading</h3><p>The following post is based on the following documentation:</p><ul><li><a href="https://developer.apple.com/documentation/scenekit/scnlight">SCNLight</a></li><li><a href="https://developer.apple.com/documentation/scenekit/scnmaterial">SCNMaterial</a></li></ul><h3>Outline</h3><p>ARKit creates lighting models from two sources:</p><ul><li>Default lighting (Standard SceneKit Lighting)</li><li>SCNLight Objects</li></ul><p>Therefore, any custom lighting you may want to add to your scene must be composed of one or more ‘SCNLight’ objects.</p><p>To add SCNLights to the world, you must first create them and then add them to a SCNNode — which will represent it’s position in space. The code looks something like this</p><pre>var aLight:SCNLight = SCNLight();<br>// Set your SCNLight attributes here</pre><pre>var aLightNode:SCNNode = SCNNode();<br>aLightNode.light = alight;<br>aLightNode.position = SCNVector3.init(X,Y,Z);<br>// Any other things you may want to do</pre><pre>node.addchild(aLightNode);</pre><p>This light then interacts with you SCNMaterial to create dynamic, real-world lighting.</p><h3>SCNLight Basic Attributes: Light Types</h3><p>SCNLight’s carry the possibility to be one of many types. These are best demonstrated by the <a href="https://developer.apple.com/documentation/scenekit/scnlight/lighttype">visual provided by Apple</a> below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0yG7W8kwPzG-RI-M.png" /></figure><p>So, in plain english, what do these types mean?</p><h4>Ambient</h4><p>A light that illuminates all objects in the scene from all directions.</p><h4>Directional</h4><p>A light source with a uniform direction and constant intensity.</p><h4>Omni</h4><p>An omnidirectional light, also known as a <em>point light</em>.</p><h4>Spot</h4><p>A light source that illuminates a cone-shaped area.</p><p>Here’s sample code as to how to set the type.</p><pre>var aLight:SCNLight = SCNLight();<br>aLight.type = .omni // my favourite</pre><p>Cool but how can I change the strength and color?</p><h3>SCNLight Basic Attributes: Color</h3><p>One of two ways to set the “color” of the light is via the color attribute, this takes in any UIColor and can be coded as below</p><pre>var aLight:SCNLight = SCNLight();<br>aLight.color = UIColor.init(red:R, green:G, blue:B, alpha:1);</pre><h3>SCNLight Basic Attributes: Temperature</h3><p>The other way that you can set the color of the light is via the temperature attribute, which is more representative of photography lighting and is measured in <strong>Kelvin</strong>.</p><pre>var aLight:SCNLight = SCNLight();<br>aLight.temperature = 7800; // That Scandinavian blue</pre><h3>SCNLight Basic Attributes: Intensity</h3><p>Finally, the way to set how strong the light is is via the intensity attribute. This is measured in <strong>lumens</strong>.</p><pre>var aLight:SCNLight = SCNLight();<br>aLight.intensity = 100; // 100 lumens</pre><p>That’s all for now.</p><p>Oscar</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c45ac841ee74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/arkit-lighting-and-physically-based-rendering-part-i-c45ac841ee74">ARKit : Lighting and Physically Based Rendering Part I</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free Open Source ARKit Super Starter Project]]></title>
            <link>https://medium.com/ar-tips-and-tricks/free-open-source-arkit-super-starter-project-dc020248c360?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/dc020248c360</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Tue, 25 Dec 2018 15:03:42 GMT</pubDate>
            <atom:updated>2018-12-25T15:03:41.952Z</atom:updated>
            <content:encoded><![CDATA[<p>Merry Christmas family and friends! <a href="http://www.artzyapp.com/">Download Here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZGOOTacvzIPZDMWL" /><figcaption>Presenting the open source Artzy Camera.</figcaption></figure><p>If there is one thing that the last 5 years of creativity have taught me is that only 5% of ‘the work’ will ever see the light of day — so why not give it away to help accelerate someone else’s hopes and dreams? What’s more is, if you believe in a vision — is it not more important to help the world achieve that vision, than achieve it yourself?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jfYXLmJPciCIwf1z" /><figcaption>Sample One</figcaption></figure><p>With these words in mind, I would like to share that I have open sourced my last 6 months worth of work in the form of an ARKit Super-Starter project that features an AR camera that works exactly the same way as Instagram; 3 AR samples, a library of free metal shaders and special effects, illustrator and maya files along with tutorials (or emails) for all the questions that you may have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xZlGfZ8iiPgRMwUt" /><figcaption>Sample Two</figcaption></figure><p>The vision in question, which is titled Artzy, allows anyone to create AR code free, in real time through a connected-ecosystem and share it with the world with the flick of a finger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bfxoCzb4HEldUxSg" /><figcaption>Sample three</figcaption></figure><h4>Why?</h4><p>Because I believe in a future where the imagination of artists and designers is ubiquitous, bringing inspiration, joy and awe to those who bear witness in a form that can be easily accessed through a device in your pocket. And if it is extremely likely that I will be beaten to the target, then I might as well accelerate the passage.</p><p>If you are interested in being part of the pilot or downloading the open source camera, please use the link below.</p><p><a href="http://www.artzyapp.com/">www.artzyapp.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc020248c360" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/free-open-source-arkit-super-starter-project-dc020248c360">Free Open Source ARKit Super Starter Project</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARkit x Maya : How to rig a multi-body structure.]]></title>
            <link>https://medium.com/ar-tips-and-tricks/arkit-x-maya-how-to-rig-a-multi-body-structure-a8a3ce98f5b4?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/a8a3ce98f5b4</guid>
            <category><![CDATA[3d]]></category>
            <category><![CDATA[maya]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[3d-modeling]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Mon, 17 Dec 2018 18:14:41 GMT</pubDate>
            <atom:updated>2018-12-17T18:14:40.921Z</atom:updated>
            <content:encoded><![CDATA[<h3>ARkit x Collada : How to rig a multi-body structure.</h3><p>For TLDR, jump straight to <strong>Solution.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GvIN68KnvGu380Dg.jpg" /><figcaption>Eye candy.</figcaption></figure><h4>Problem</h4><p>You cannot successfully export a multi-skeletal structure to as a Collada dae. You will get this error in XCode:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rV13Bqpcx8PfnYMTFy8j7w.png" /></figure><h4>Theory</h4><p>Create a single skeleton structure, and bind individual joints to individual bodies.</p><h4>Solution</h4><p>Let say your joint structure looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*16GADOcVcj42qAQgziEZ4w.png" /></figure><p>You need to select a joint chain (such as that below) and a body, and bind them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*D9oyFCEP8i4DdUAP44AJrQ.png" /></figure><p>And then select the second joint chain and body and bind them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*wh7GV4_8xCJLfDlYOsx1iA.png" /></figure><p>Et Voila. You can now export it.</p><p>O</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8a3ce98f5b4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/arkit-x-maya-how-to-rig-a-multi-body-structure-a8a3ce98f5b4">ARkit x Maya : How to rig a multi-body structure.</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARKit: On Scanning and Detecting 3D Objects]]></title>
            <link>https://medium.com/ar-tips-and-tricks/arkit-on-scanning-and-detecting-3d-objects-7d55d3385e8?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/7d55d3385e8</guid>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Thu, 13 Dec 2018 01:18:34 GMT</pubDate>
            <atom:updated>2018-12-13T01:19:22.827Z</atom:updated>
            <content:encoded><![CDATA[<p>Before we start, if you don’t already know, Apple has free software for producing .arobject references. This can be downloaded <a href="https://developer.apple.com/documentation/arkit/scanning_and_detecting_3d_objects">here</a>, which also explains how it works and what it does.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2tR-LXZ0UsUWt-BN.png" /></figure><p>This last part, is what I have broken down for you today.</p><h4>Simple things</h4><ul><li>ARKit carries the configuration to allow your app to scan objects on command.</li><li>ARKit can export these as .arobjects allowing you to quickly create reference points.</li><li>Reference objects create an origin which scenes can be mapped on.</li></ul><h4>Unfortunate things</h4><ul><li>Reference Objects are not ‘objects’ which can be mapped from an <em>.arobject</em>.</li><li>Reference objects must be reproduced to true scale as collada’s for them to ‘come to life’.</li></ul><p>O</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d55d3385e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/arkit-on-scanning-and-detecting-3d-objects-7d55d3385e8">ARKit: On Scanning and Detecting 3D Objects</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to capture and preview microphone audio during a multi-route audiosession.]]></title>
            <link>https://medium.com/ar-tips-and-tricks/how-to-capture-and-preview-microphone-audio-during-a-multi-route-audiosession-64aff28af021?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/64aff28af021</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[audio]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Fri, 07 Dec 2018 21:52:01 GMT</pubDate>
            <atom:updated>2018-12-07T21:52:01.287Z</atom:updated>
            <content:encoded><![CDATA[<p>For TLDR; Jump straight to <strong>Solution</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/0*KgYF3JOGnV9WE8OM" /><figcaption>My audio sidekick.</figcaption></figure><h3><strong>Problem</strong></h3><p>For you that do not know me — I constantly have headphones connected to my device. I never thought this would be a problem until I saw that my app would freeze when replaying video — often illustrating this:</p><pre><strong>Unknown selected data source for Port delasounds (type: BluetoothA2DPOutput)</strong></pre><h3>Theory</h3><p>If it can capture some audio and freeze and other — then perhaps it is :</p><ul><li>That you need to allow it to work in tandem with the speaker (tried and only led to more problems).</li></ul><p><strong>OR</strong></p><ul><li>That you have deactivated the ability for the app to play audio too early — jamming the video (<strong>this one is the case</strong>)</li></ul><h3>Solution</h3><h4>A : Setup your Audio Session as follows</h4><pre>do {</pre><pre>   try self.recordingSession.setCategory(AVAudioSession.Category.playAndRecord, mode: .videoRecording, options: [.defaultToSpeaker])</pre><pre>   try self.recordingSession.setActive(true, options: .notifyOthersOnDeactivation)</pre><pre>}<br>catch {</pre><pre>// CATCH THE ERROR<br>}</pre><h4><strong>B : End the capturing of audio when you want your recording to stop.</strong></h4><pre>func endAudioCapture() {</pre><pre>    self.captureSession!.stopRunning();</pre><pre>}</pre><h4><strong>C: Turn the audio session “off” when you’re done playing the replay.</strong></h4><pre>public func endAudioSession() {</pre><pre>    do {</pre><pre>    try self.recordingSession.setActive(false, options: .notifyOthersOnDeactivation)</pre><pre>    }</pre><pre>    catch {</pre><pre>    print(&quot;ERROR CANCELLING RECORDING SESSION : \(error)&quot;)</pre><pre>    }</pre><pre>}</pre><p>O</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64aff28af021" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/how-to-capture-and-preview-microphone-audio-during-a-multi-route-audiosession-64aff28af021">How to capture and preview microphone audio during a multi-route audiosession.</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to capture advanced shaders using ARKit’s ARSCNView snapshot feature]]></title>
            <link>https://medium.com/ar-tips-and-tricks/how-to-capture-advanced-shaders-using-arkits-arscnview-snapshot-feature-11da2fd81f9?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/11da2fd81f9</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[arkit]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Thu, 06 Dec 2018 17:35:11 GMT</pubDate>
            <atom:updated>2018-12-06T17:36:35.333Z</atom:updated>
            <content:encoded><![CDATA[<p>For those looking for an audio-video solution — go <a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-make-your-own-audio-video-recorder-3d72016d1087">here</a>. For TLDR, jump straight to <strong>solution</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MaM4scblGC2soSMQ.png" /><figcaption>Your standard post image.</figcaption></figure><h3>Hi, I’m new…</h3><p>ARKit holds a feature called “<strong>Snapshot()</strong>” which converts the view on the screen into an image which can be view / saved.</p><p>However, it has its limitations.</p><h3>Problem</h3><p>Time based, GPU calculated shaders — such as the one detailed below and displayed <a href="https://medium.com/ar-tips-and-tricks/a-free-stroke-shader-for-arkit-ios-11-4-12-f72f85aabdb4">here</a> <strong>cannot</strong> be captured by the snapshot feature.</p><p>The video below was captured with ReplayKit (<a href="https://medium.com/ar-tips-and-tricks/how-to-record-a-screen-capture-with-replaykit-whilst-hiding-the-hud-element-bedcca8e31e">tutorial here</a>). This is not a stable solution — <a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-make-your-own-audio-video-recorder-3d72016d1087">this one is</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5bxnp7j1AGc%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D5bxnp7j1AGc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5bxnp7j1AGc%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/0819c02bdd40c8edb6e8767896670714/href">https://medium.com/media/0819c02bdd40c8edb6e8767896670714/href</a></iframe><h3>Theory</h3><p>Let’s observe the code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c73a62f3e20e1ed2d9802bb2696191c0/href">https://medium.com/media/c73a62f3e20e1ed2d9802bb2696191c0/href</a></iframe><p>Although the effect works magically, the error occurs as the system needs to do a lot of calculations at GPU level (line 90–112).</p><p><strong>Instead, we must write a variable to the material every time the scene renders — allowing it to insta-punch in which variables to show and which not to.</strong></p><h3>Solution</h3><h4><strong>The Metal Half</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5c3d766b3dab1c78b4f79d3d6542a1e/href">https://medium.com/media/f5c3d766b3dab1c78b4f79d3d6542a1e/href</a></iframe><h4>The Swift Half</h4><p>Update the shader at runtime — after it renders — allowing you to safely capture the snapshot. <strong>Please note this may reduce your recording frame rate significantly.</strong></p><pre>func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) {</pre><pre>    for child in (YOUR_NODE)! {</pre><pre>    let shaderMaterial:SCNMaterial = (child.geometry?.firstMaterial)!;</pre><pre>    var displayVariables:DisplayVariableStruct = DisplayVariableStruct(show: YOUR_VALUE)</pre><pre>    shaderMaterial.setValue(Data(bytes: &amp;displayVariables, count: MemoryLayout&lt;DisplayVariableStruct&gt;.stride), forKey: &quot;displayVariables&quot;);</pre><pre>}</pre><pre>}</pre><p>Please leave any comments or questions in the section below.</p><p>O</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11da2fd81f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/how-to-capture-advanced-shaders-using-arkits-arscnview-snapshot-feature-11da2fd81f9">How to capture advanced shaders using ARKit’s ARSCNView snapshot feature</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARKit: How to make your own Audio-Video Recorder.]]></title>
            <link>https://medium.com/ar-tips-and-tricks/arkit-how-to-make-your-own-audio-video-recorder-3d72016d1087?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d72016d1087</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[augmented-reality]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 16:30:08 GMT</pubDate>
            <atom:updated>2019-01-07T01:00:36.557Z</atom:updated>
            <content:encoded><![CDATA[<h4>Download an AR camera starter project <a href="http://www.artzyapp.com/">here</a>.</h4><p>For TLDR, jump straight to <strong>Practice</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*CdK63PcyVaSfg_91.png" /></figure><p>Last time I posted, <a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-record-and-save-video-in-swift-73cd899c21c7">I shared how to save video in ARKit</a> but noted that it did not record audio.</p><p>Today, I am happy to say that I have found a way to do both — together.</p><h3>Problem</h3><p>As listed in this <a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-record-and-save-video-in-swift-73cd899c21c7">tutorial</a>, theres a serious issue recording ARKit video with any existing package — especially Apple’s ReplayKit that breaks at any given moment with no solutions as how to fix it.</p><p>In that <a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-record-and-save-video-in-swift-73cd899c21c7">tutorial</a>, I listed a way to capture AR Frames as UIImages and convert them into video but explained that I had yet to crack Audio — as the existing <em>recorder </em>is very taxing on the system and needs a clean solution that will not break the system.</p><h3>Solution</h3><h4>Things I tried</h4><ul><li>AVAudioRecorder — Crashes the system in tandem with recording video.</li><li>AVAudioEngine — Crashes the system in tandem with recording video.</li></ul><h4>What Worked</h4><p>Creating a AVCaptureSession with the iPhone microphone as the sole input and its raw data as the sole output.</p><p>As the audio CMSampleBuffer comes in with its own ‘time’, the final touch is to correct the time of the recording to match the time of the video frame.</p><p>This is then appended onto AVAssetWriter — all of this is covered in Audio Recording Functionality.</p><h3>Practice</h3><p>Please refer to this <a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-record-and-save-video-in-swift-73cd899c21c7">tutorial</a> to explain how video works and once you have covered that one — change the following pieces of code.</p><h4>New Variables</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6442183b27cd857fffa891085bf04a8e/href">https://medium.com/media/6442183b27cd857fffa891085bf04a8e/href</a></iframe><h4>New didUpdateAtTime</h4><p>Please note that the system crashes at 30 FPS (currently at 24FPS on line 7).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fd4fe18a11e01b691000581c7748d92/href">https://medium.com/media/5fd4fe18a11e01b691000581c7748d92/href</a></iframe><h4>New Recording Functionality</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbb0ace5d86f32727493e240a8a311fb/href">https://medium.com/media/cbb0ace5d86f32727493e240a8a311fb/href</a></iframe><h4>New Asset Writer</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6900e7ceb132813de29efde6e3940e6a/href">https://medium.com/media/6900e7ceb132813de29efde6e3940e6a/href</a></iframe><h4>Audio Recording Functionality</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca82398886f0625215801e6620f70836/href">https://medium.com/media/ca82398886f0625215801e6620f70836/href</a></iframe><p>Please leave any questions or comments in the section below.</p><p>Oscar</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d72016d1087" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-make-your-own-audio-video-recorder-3d72016d1087">ARKit: How to make your own Audio-Video Recorder.</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ARKit: How to record and save video, in swift.]]></title>
            <link>https://medium.com/ar-tips-and-tricks/arkit-how-to-record-and-save-video-in-swift-73cd899c21c7?source=rss----7c6c18b9e77b---4</link>
            <guid isPermaLink="false">https://medium.com/p/73cd899c21c7</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Oscar de la Hera]]></dc:creator>
            <pubDate>Wed, 28 Nov 2018 18:42:24 GMT</pubDate>
            <atom:updated>2018-11-28T18:42:24.250Z</atom:updated>
            <content:encoded><![CDATA[<p>This tutorial does not include Audio Input, thank you internet for all those attempts in the past that made me understand the path to follow.</p><p>For those looking for a TLDR, jump straight to <strong>Solution.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0z9RTCpYHWL86XmQ.jpg" /><figcaption>How I felt when I got here.</figcaption></figure><h3>The Problem</h3><p>The legend goes that <a href="https://developer.apple.com/documentation/replaykit">Apple’s ReplayKit</a> is the only way to capture AR — <strong>but this breaks all the time, without explanation</strong> — <strong>often pushing all further video to a Apple TV somewhere for no apparent reason with no way to stop casting your videos other than restarting your phone, leaving developers bashing their heads against walls hoping it works again.</strong></p><p>ReplayKit comes with the problem that it presents the video in its own skin, leaving a lack of customization for that video presentation. What if you want to create your own workflow — well… tough luck, bud.</p><p>There are repo’s out there such as <a href="https://github.com/AFathi/ARVideoKit">AFathi’s ARVideoKit</a> but these do not suffice for capturing content that composed of ARReferenceImages or ARReferenceObjects.</p><p>But, after many trials and tribulations, today. <strong>There’s a way.</strong></p><h3>Solution</h3><h4>Step One: Add the recording functionality</h4><p>Tie these functions to your buttons — Note that self.saveVideo(…) is at the end — this is in Step 3.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc645b5989b685eb7d57733969b6d60f/href">https://medium.com/media/dc645b5989b685eb7d57733969b6d60f/href</a></iframe><h4>Step Two: Add the capturing frames functionality.</h4><p>As explained in this <a href="https://medium.com/ar-tips-and-tricks/how-to-capture-ar-frames-as-uiimages-at-30fps-in-arkit-f05c678b4d06">post</a>, “in your <em>func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) </em>call the following function — <strong>and yes, it does have to be coded this way, else your system freezes or crashes.”</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7575c635fd3a7ea7bd87dfe2e2246fbd/href">https://medium.com/media/7575c635fd3a7ea7bd87dfe2e2246fbd/href</a></iframe><h4>Step Three: Add the Save Video Functionality</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/375c26783d8db47130c9f47079d142da/href">https://medium.com/media/375c26783d8db47130c9f47079d142da/href</a></iframe><h4>Et Voila.</h4><p>Please leave questions or comments in the section below.</p><p>O</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73cd899c21c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ar-tips-and-tricks/arkit-how-to-record-and-save-video-in-swift-73cd899c21c7">ARKit: How to record and save video, in swift.</a> was originally published in <a href="https://medium.com/ar-tips-and-tricks">AR Tips And Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>