<?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: Kareem Al-Farsi</title>
    <description>The latest articles on DEV Community by Kareem Al-Farsi (@kareem_harimexj_5efa2258e).</description>
    <link>https://dev.to/kareem_harimexj_5efa2258e</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3866346%2F307c5058-3746-4fc4-b22e-284b9c6bc765.png</url>
      <title>DEV Community: Kareem Al-Farsi</title>
      <link>https://dev.to/kareem_harimexj_5efa2258e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kareem_harimexj_5efa2258e"/>
    <language>en</language>
    <item>
      <title>Building Photon: A Hybrid Ray Tracer That Builds for Windows, Linux, and macOS</title>
      <dc:creator>Kareem Al-Farsi</dc:creator>
      <pubDate>Tue, 07 Apr 2026 19:02:25 +0000</pubDate>
      <link>https://dev.to/kareem_harimexj_5efa2258e/building-photon-a-hybrid-ray-tracer-that-builds-for-windows-linux-and-macos-12nn</link>
      <guid>https://dev.to/kareem_harimexj_5efa2258e/building-photon-a-hybrid-ray-tracer-that-builds-for-windows-linux-and-macos-12nn</guid>
      <description>&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/GordonFreeman21/photon/tree/main" rel="noopener noreferrer"&gt;Photon on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photon is a C-based adaptive hybrid ray tracer built to explore real-time rendering techniques without locking the project to one platform. The goal was simple: make a renderer that can grow into something serious, while still being practical to build, test, and ship across Windows, Linux, and macOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Photon is
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/GordonFreeman21/photon/tree/main" rel="noopener noreferrer"&gt;Photon&lt;/a&gt; is a modular ray tracing engine written in C17. It combines several rendering ideas into one pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BVH-based ray traversal&lt;/li&gt;
&lt;li&gt;hybrid raster + ray tracing structure&lt;/li&gt;
&lt;li&gt;denoising passes&lt;/li&gt;
&lt;li&gt;probe-based indirect lighting&lt;/li&gt;
&lt;li&gt;adaptive ray budgeting&lt;/li&gt;
&lt;li&gt;build-time shader compilation support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project is designed to run in a stub mode when full GPU dependencies are missing, which makes it easier to develop and test even on machines without a full Vulkan setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it this way
&lt;/h2&gt;

&lt;p&gt;I wanted a renderer that was more than a demo or a single-file experiment. &lt;a href="https://github.com/GordonFreeman21/photon/tree/main" rel="noopener noreferrer"&gt;Photon&lt;/a&gt; is organized like an actual engine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;include/&lt;/code&gt; holds the core types and API&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/&lt;/code&gt; contains the implementation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;shaders/&lt;/code&gt; contains the compute and graphics shaders&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.github/workflows/&lt;/code&gt; handles CI and releases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That structure makes it easier to extend later, whether that means better materials, real Vulkan integration, texture loading, or more advanced global illumination.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes it different
&lt;/h2&gt;

&lt;p&gt;A few things stand out in Photon:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Adaptive rendering
&lt;/h3&gt;

&lt;p&gt;Instead of firing a fixed amount of rays every frame, Photon uses a budget system that can adjust quality depending on performance needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Hybrid pipeline
&lt;/h3&gt;

&lt;p&gt;The renderer is built to combine rasterization and ray tracing ideas instead of relying on one approach only. That gives more flexibility for future features.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Denoising
&lt;/h3&gt;

&lt;p&gt;Rendering noisy paths is normal in ray tracing, so Photon includes denoise stages like temporal and spatial filtering to make the output more stable.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Cross-platform release workflow
&lt;/h3&gt;

&lt;p&gt;One of the biggest goals was not just "build on my machine," but "build everywhere." The workflow now produces packaged releases for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows: &lt;code&gt;.exe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ubuntu/Debian: &lt;code&gt;.deb&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Fedora: &lt;code&gt;.rpm&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Arch Linux: &lt;code&gt;.tar.gz&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of them are collected into one GitHub release.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hard part
&lt;/h2&gt;

&lt;p&gt;The renderer itself was not the only challenge. A lot of the work went into making the project reliable on CI and different systems.&lt;/p&gt;

&lt;p&gt;Some of the issues I hit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apple Silicon macOS runners do not support x86 SIMD headers like &lt;code&gt;immintrin.h&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;RPM packaging needed the binary path fixed so the installer could find the built executable&lt;/li&gt;
&lt;li&gt;GitHub Actions artifact actions had deprecated versions that broke builds&lt;/li&gt;
&lt;li&gt;Release creation needed proper permissions in workflow settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those were not just build issues - they shaped how the project had to be structured.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;A few useful lessons came out of this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Portability matters early, not later&lt;/li&gt;
&lt;li&gt;CI breaks fast when platform assumptions are too narrow&lt;/li&gt;
&lt;li&gt;Packaging is part of the product&lt;/li&gt;
&lt;li&gt;A renderer is more than graphics code - it's build scripts, release automation, and platform support too&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is next
&lt;/h2&gt;

&lt;p&gt;Photon still has room to grow. The next steps are likely:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;real Vulkan backend integration&lt;/li&gt;
&lt;li&gt;better material and texture support&lt;/li&gt;
&lt;li&gt;improved scene loading&lt;/li&gt;
&lt;li&gt;more accurate indirect lighting&lt;/li&gt;
&lt;li&gt;cleaner packaging for Linux distributions&lt;/li&gt;
&lt;li&gt;more sample scenes and validation tests&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/GordonFreeman21/photon/tree/main" rel="noopener noreferrer"&gt;Photon&lt;/a&gt; started as a ray tracer project, but it became a full cross-platform rendering pipeline with CI, release packaging, and platform-specific build support. That made it much more than "just code" - it became a small engine that can actually be built, shipped, and iterated on.&lt;/p&gt;

&lt;p&gt;If you're into rendering, engine architecture, or cross-platform build systems, Photon is a good example of how quickly those worlds overlap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explore the repo:&lt;/strong&gt; &lt;a href="https://github.com/GordonFreeman21/photon/tree/main" rel="noopener noreferrer"&gt;https://github.com/GordonFreeman21/photon/tree/main&lt;/a&gt;&lt;/p&gt;

</description>
      <category>raytracing</category>
      <category>c</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
