Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a Reusable WebGPU & Rust Engine: Part 3 — Implementing a 3D Camera System & Hot-Reloading Shaders

It’s been a while since my last update! I received some great feedback and architectural suggestions, especially around asset loading and pipeline optimization. I plan to integrate those ideas step by step. Before jumping into advanced features like shader hot-reloading or multi-threaded asset streaming, we need to solve a fundamental problem: moving from flat 2D rendering to a full 3D viewport.…

This is part three of a series on building a reusable webgpu and rust engine. The focus here is implementing a 3D camera system and hot-reloading shaders.

The article first explains why a camera is needed in a rendering pipeline. Without a camera matrix, rendering without perspective distortion results in flat, orthographic views where objects don't scale with distance. To render realistic 3D scenes, the article implements a classical pinhole camera model using two essential matrix transformations - the projection matrix (based on FOV and aspect ratio) and the view matrix (generated using a right-handed coordinate system to align with WebGPU's clip space).

To make the camera's transformation data available to the shader, the engine sets up a camera uniform buffer (bind group) to be passed into the WGSL shader program. This allows the camera matrix to be updated each frame to reflect user interactions like orbiting, panning, or zooming around the 3D scene.

The article then details how to pass camera parameters into the shader through the bind group layout, with group 0 dedicated to camera-related uniforms and group 1 for material and texture information. This modular approach enables easy addition of new data sets by simply binding them to higher group slots, preserving existing camera functionality.

Finally, the author addresses the ongoing challenge of rapidly updating shaders during development. Instead of restarting the app for each minor change, shader hot-reloading is implemented using a background file watcher. The watcher monitors the filesystem for changes to .wgsl shader files. Upon detecting a modification, the main thread receives an event via a message channel and reloads the updated shader programmatically in the next redraw cycle.

This seamless process lets developers experiment with shader code without interrupting the render loop.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Türkiye’nin 81 İl ve 973 İlçesini Dijitalleştirmek: “Memleketim: Dijital Rehber” Mimarisi ve Açık Veri Paketi

Türkiye’nin her bir köşesi binlerce yıllık tarihi miras, coğrafi işaretli yöresel lezzetler ve yerel zanaatlarla dolu. Ancak dijital dünyada yerel bir şehri, ilçeyi veya o bölgenin gerçek kültürel…

  • Türkiye'nin 81 il ve 973 ilçesi için dijital bir rehber oluşturuldu.
  • Memleketim: Dijital Rehber, resmi web, Android ve iOS uygulamaları sunar.
  • Açık veri paketi, NPM, GitHub ve Hugging Face üzerinde mevcuttur.

SQL Injection Prevention: Developer's Security Checklist

SQL injection is still the number one cause of data breaches — and it is entirely preventable. This checklist covers every layer of defense: parameterized queries, ORMs, input validation…

  • SQL injection is top web security risk causing breaches
  • Use parameterized queries to prevent manipulation
  • ORMs help if raw SQL usage avoided

I wrote a JavaScript framework in 2013. Here's what that world looked like

On September 26, 2013, I made the first commit of Matreshka.js, a small framework for two-way data binding. It got about 900 stars on GitHub, lived for years, and then I left it.

  • Matreshka.js framework created on September 26, 2013
  • Front-end development novel in 2013 with multiple frameworks emerging
  • IE8 ubiquity and jQuery compatibility challenges in 2013

HTB - ServMon Writeup - no Metasploit

Enumeration Let’s enumerate the open ports on the machine using nmap . I usually use nmap in 2 steps. First, I take a quick full-port sweep using following options.

  • Ports 135, 139, and 445 were open on the Windows machine.
  • Ports 53, 389, and 88 were closed, indicating non-Active Directory status.
  • Ports 21, 80, and some UDP ports were also open for further investigation.

Part 5: "Roll Back the Fix so We Can Open a Ticket!" – The ITIL Process Owner’s Fury

VITI Magazine – Exclusive Special: The ITIL Showdown Part 5: When the Machine Fixed the Bug Without Permission – The Process Owner’s Fury Editor’s Note: The following report captures the exact moment…

  • Massive DDoS and injection anomaly crippled critical payment gateway
  • BIGF Autonomous Agentic Mesh detected anomaly and acted automatically
  • Hannele, ITIL-certified process owner, demanded rollback and ticket opening

More from Saturday 17 October →