<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kashif Nazir</title>
    <description>The latest articles on DEV Community by Kashif Nazir (@kashifnazir).</description>
    <link>https://dev.to/kashifnazir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4208958%2F3782f642-ee2b-4910-9f44-48215614f311.png</url>
      <title>DEV Community: Kashif Nazir</title>
      <link>https://dev.to/kashifnazir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kashifnazir"/>
    <language>en</language>
    <item>
      <title>How to Create a Texture Atlas in Unity (and Actually Cut Draw Calls)</title>
      <dc:creator>Kashif Nazir</dc:creator>
      <pubDate>Sat, 31 Oct 2026 18:03:52 +0000</pubDate>
      <link>https://dev.to/kashifnazir/how-to-create-a-texture-atlas-in-unity-and-actually-cut-draw-calls-1h34</link>
      <guid>https://dev.to/kashifnazir/how-to-create-a-texture-atlas-in-unity-and-actually-cut-draw-calls-1h34</guid>
      <description>&lt;p&gt;You combined your meshes, but the draw calls barely moved. The reason is almost always materials: every unique material is a separate draw call, and no amount of mesh combining helps until your textures share one. A texture atlas fixes exactly that.&lt;/p&gt;

&lt;p&gt;Unity issues roughly one draw call per material per object. A scene with 200 props on 200 materials costs ~200 draw calls, even if every prop is a 12-triangle box. Mesh combining merges geometry, but combined meshes still referencing 15 different materials still cost 15 draw calls. The material count is the ceiling; geometry merging only gets you to that ceiling.&lt;/p&gt;

&lt;p&gt;A texture atlas attacks the ceiling directly. Pack 20 small textures into one big image, point every mesh at that single texture through one shared material, and 20 draw calls become 1. It is the single highest-leverage optimization for prop-heavy, modular, or kit-bashed scenes.&lt;/p&gt;

&lt;p&gt;The trick is UV remapping. An atlas is a big texture divided into regions, one per original texture, and every mesh's UVs get remapped to sample only its own region:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Remap a mesh's UVs into one region of a texture atlas&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;RemapUVsToAtlas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Mesh&lt;/span&gt; &lt;span class="n"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Rect&lt;/span&gt; &lt;span class="n"&gt;atlasRect&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;uvs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uv&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;uvs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;uvs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;atlasRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;uvs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;*&lt;/span&gt; &lt;span class="n"&gt;atlasRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;atlasRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;uvs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="p"&gt;*&lt;/span&gt; &lt;span class="n"&gt;atlasRect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;mesh&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uv&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;uvs&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three ways to build one:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Unity's Sprite Atlas (Window → 2D → Sprite Atlas) — built-in, zero code, but sprite-oriented. It will not remap 3D model UVs.&lt;/li&gt;
&lt;li&gt;Manual atlas in an image editor — pack textures into one power-of-two image (1024, 2048, 4096), leave 4–8 pixels of padding between regions, convert each region to normalized UV space, remap each mesh, then combine. Full control, but add one new prop and you repack everything.&lt;/li&gt;
&lt;li&gt;Automated atlas baking — a tool collects textures, packs them with proper padding, remaps every mesh's UVs, and outputs one material. This is the practical choice for anything iterative.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pitfalls that break your visuals: texture bleeding without padding (bilinear filtering samples neighboring regions at seams); mipmap bleeding at lower mip levels (keep opaque and alpha-tested textures in separate atlases); non-power-of-two sizes (mobile GPUs compress poorly); 4096 atlases with 64 props meaning each prop gets only ~512px (split hero assets into their own materials); and lightmap UV2, which atlas bakers must preserve or regenerate if you bake lighting.&lt;/p&gt;

&lt;p&gt;Measure the win, don't trust vibes: open the Frame Debugger (Window → Analysis → Frame Debugger) and watch the atlased props collapse into a single draw event, and watch Batches drop in the Game view Stats panel. A typical prop-heavy scene goes from 150–300 batches to under 50 with combining plus atlasing. And profile on your actual target device — draw-call overhead is CPU-side, so a scene fine on a dev PC can still choke a phone or Quest.&lt;/p&gt;

&lt;p&gt;I build VR games at PixelFalconVR and Unity tools at BlackBox Creations.&lt;/p&gt;

&lt;p&gt;Full write-up with the complete method breakdown and FAQ: &lt;a href="https://kashi45248-prog.github.io/Blackbox_creations-/tutorial-texture-atlas-unity-draw-calls.html" rel="noopener noreferrer"&gt;https://kashi45248-prog.github.io/Blackbox_creations-/tutorial-texture-atlas-unity-draw-calls.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>unity3d</category>
      <category>vr</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Meta Quest 72 FPS: the mesh checklist that actually holds the frame budget</title>
      <dc:creator>Kashif Nazir</dc:creator>
      <pubDate>Mon, 26 Oct 2026 14:28:26 +0000</pubDate>
      <link>https://dev.to/kashifnazir/meta-quest-72-fps-the-mesh-checklist-that-actually-holds-the-frame-budget-4ej7</link>
      <guid>https://dev.to/kashifnazir/meta-quest-72-fps-the-mesh-checklist-that-actually-holds-the-frame-budget-4ej7</guid>
      <description>&lt;p&gt;72 frames per second means 13.9 milliseconds per frame — for everything:&lt;br&gt;
physics, scripts, and rendering, times two eyes. On Quest, dropped frames&lt;br&gt;
don't just look bad, they cause motion sickness. Meta targets 72 FPS&lt;br&gt;
minimum (Quest 2/3S) with 90 FPS ideal on Quest 3, and rendering typically&lt;br&gt;
gets about half the budget once game logic takes its share. So every item&lt;br&gt;
below exists to protect roughly 7ms of rendering time.&lt;/p&gt;

&lt;p&gt;Most Quest games that miss the target don't have a shader problem. They&lt;br&gt;
have a mesh problem. This is the checklist I run over a scene, in order:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Draw calls under ~150.&lt;/strong&gt; Check the Game view Stats panel →&lt;br&gt;
"Batches". Quest's mobile CPU chokes on draw-call overhead long before&lt;br&gt;
the GPU breaks a sweat. Combine meshes, bake texture atlases, and enable&lt;br&gt;
the SRP Batcher. And switch to Single Pass Instanced rendering (XR&lt;br&gt;
Plug-in Management settings) — it roughly halves your stereo draw calls&lt;br&gt;
versus Multi-Pass. If your project still uses Multi-Pass, switching to&lt;br&gt;
SPI is the single biggest one-setting win available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Visible triangles under ~750k.&lt;/strong&gt; This is the widely used Quest&lt;br&gt;
comfort zone. Audit with the Frame Debugger or Profiler, find your&lt;br&gt;
heaviest meshes, and simplify them. Background geometry almost never&lt;br&gt;
needs the triangle density it ships with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. LODs on everything beyond arm's reach.&lt;/strong&gt; Use LODGroup with 2–3&lt;br&gt;
levels and aggressive cutoffs — in VR, distant detail is genuinely hard&lt;br&gt;
to see in a headset, so you can cut LOD0 → LOD1 earlier than on flat&lt;br&gt;
screens. Generate LODs for the whole library in one pass rather than&lt;br&gt;
hand-tuning per model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Textures: 1024 max for environments, ASTC compression.&lt;/strong&gt; Walls and&lt;br&gt;
floors at 1024, props at 512 or below. Large textures murder mobile fill&lt;br&gt;
rate on tile-based GPUs. ASTC is the compression format mobile GPUs&lt;br&gt;
actually like (6×6 or 8×8 block sizes are the sweet spot). Atlases help&lt;br&gt;
twice here: fewer draw calls AND fewer texture binds. Enable Mip&lt;br&gt;
Streaming too — it can cut texture memory by 30–50% in large scenes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Bake all lighting. Zero realtime lights.&lt;/strong&gt; Realtime shadows are one&lt;br&gt;
of the most expensive things you can do on Quest. Bake lightmaps, use&lt;br&gt;
light probes for dynamic objects, and turn the main directional light's&lt;br&gt;
shadows off or to the cheapest possible setting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Kill overdraw.&lt;/strong&gt; Transparent particles, overlapping UI, and layered&lt;br&gt;
alpha geometry destroy tile-based mobile GPUs. Audit with the overdraw&lt;br&gt;
view mode; replace alpha-blended particles with alpha-tested or opaque&lt;br&gt;
where possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Enable Fixed Foveated Rendering.&lt;/strong&gt; Via the Meta XR SDK, render the&lt;br&gt;
periphery at lower resolution — up to ~28% pixel shading savings with&lt;br&gt;
no perceptible quality loss. It's nearly free performance; there's no&lt;br&gt;
reason to ship without it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The order matters: simplify → LOD → combine → verify.&lt;/strong&gt; Simplifying&lt;br&gt;
first means your LODs and combined meshes are built from clean, light&lt;br&gt;
geometry instead of garbage-in-garbage-out. Then verify in the Stats&lt;br&gt;
panel (batches under 150, tris under 750k) and profile on-device with&lt;br&gt;
OVR Metrics — the editor lies about mobile performance.&lt;/p&gt;

&lt;p&gt;I build VR games at PixelFalconVR and Unity tools at BlackBox Creations.&lt;/p&gt;

&lt;p&gt;Full write-up with the code snippet for a runtime LOD bias on Quest:&lt;br&gt;
&lt;a href="https://kashi45248-prog.github.io/Blackbox_creations-/tutorial-meta-quest-72fps-mesh-optimization.html" rel="noopener noreferrer"&gt;https://kashi45248-prog.github.io/Blackbox_creations-/tutorial-meta-quest-72fps-mesh-optimization.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>vr</category>
      <category>gamedev</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
