@sjb3d@mastodon.gamedev.place avatar

sjb3d

@sjb3d@mastodon.gamedev.place

Graphics/systems programmer. Previously at Unity, Media Molecule (Dreams), Sony ATG. Interested in tracing rays, distance fields, Vulkan, Rust/Zig and generally keeping GPUs running efficiently. Opinions my own.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Back to experimenting with meshing algorithms, trying to add variable resolution support while keeping the output manifold.

Left image is just directly meshing SDF samples in an octree (complete with red non-manifold edges where resolution changes). Right is a dual method, edges are a mess so it doesn't look manifold, but it is!

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@kimau hey, yep this is intended for realtime, no higher quality version yet but I'd like to limit cost!

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@aeva similar to dual marching cubes (in particular how the octree gets stitched together), but different meshing

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@aeva just an experiment so far, would like to find something that works well for distance fields

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@mjk @aeva ah, the octree traversal bits are from the Schaefer & Warren paper, it seems pretty neat to stitch different resolutions together.

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Desktop Vulkan question: is it reasonable to rely on resizable BAR being enabled these days? Just filling write-combined buffer memory directly, without all the code for sync/async copies from staging buffers, is super nice.

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@dougbinks thanks for the very useful info!

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@dougbinks yep, makes sense to check via the heaps.

It's difficult to judge how widespread motherboard/BIOS support is, but seems like a fallback to staging buffers is probably wise then (for older bios or just user not enabling it).

dee, to random
@dee@mastodon.gamedev.place avatar

My experience with the Zig community so far

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@dee eek, FWIW the RAD debugger worked out of the box with Zig for me

sjb3d, to zig
@sjb3d@mastodon.gamedev.place avatar

Found a small #Zig issue with EnumSet, so raised an issue yesterday with a fix PR. One round of PR feedback to fix a test, and it's merged. ⚡ 10/10 would PR again.

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Ooh the HLSL proposal for vk::BufferPointer looks like a great upgrade over vk::RawBufferLoad: https://github.com/microsoft/hlsl-specs/blob/main/proposals/0010-vk-buffer-ref.md

Will be nice to remove a level of indirection for bindless buffers (and get parity with what is possible in GLSL).

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Some nice use cases for Zig defer by matklad: https://matklad.github.io/2024/03/21/defer-patterns.html

Definitely seems useful to consider defer for use cases other than resource cleanup.

sjb3d, (edited )
@sjb3d@mastodon.gamedev.place avatar

@apoorvaj no-one can truly understand peak Zig :)

(but yeah that one is quite amazing)

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

OK dynamic rendering Vulkan is best Vulkan, never creating a render pass again.

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@aras haha almost yes, immediate mode for debugging is great :)

I still make use of stuff like https://github.com/sjb3d/imdd (written years ago so I don't have to write it again)

sjb3d, to zig
@sjb3d@mastodon.gamedev.place avatar

The #zig experiments continue, still very much liking it.

Dropping random C/C++ files in the build and having it just work is great.

Only minor issue I hit so far is missing syntax to make a slice from a single-item pointer (like slice::from_ref in Rust), but looks like this is getting fixed for 0.12 (https://github.com/ziglang/zig/issues/16075). And can work around in 0.11 with some comptime trickery.

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@mlugg ah good to know, thanks!

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Tinkering with Zig (https://ziglang.org/) and there's a lot to like about it. Allocators required throughout the standard library is great, I wish rust had gone this route.

And comptime seems super powerful for generics. For example, want SoA storage for any struct type? No problem, here's an example in the standard library: https://ziglang.org/documentation/master/std/#A;std:MultiArrayList.

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@apoorvaj ooh papaya looks awesome! Nice use of anytype, comptime seems great to switch based on type, check for declarations being present etc.

And yeah coming from rust compile times are great. :)

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Just pushed an Vulkan renderer as part of my Vulkan wrapper here: https://github.com/sjb3d/spark/.

I've been enjoying using egui (https://github.com/emilk/egui) with glow (https://github.com/grovesNL/glow) for a while for hobby projects, but needed integration for the next one, thought I'd share since it might be useful for someone else too!

ephtracy, to random
@ephtracy@mastodon.gamedev.place avatar

ui wip

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@ephtracy SDF modelling with accurate glossy reflections 😍

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

Second attempt at handling hard seams between SDF shapes, it's not totally robust yet but starting to work. Behold my glorious SDF artwork.

Left is marching cubes. Right is dual marching cubes on the same grid, still only solving for position at each dual vertex, but now giving each dual polygon a surface ID. (The dual case also uses a bit of edge collapse to clean up the meshing around edges.)

video/mp4

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@lritter nice work, using the underlying SDF for lighting/occlusion makes a lot of sense!

sjb3d, to random
@sjb3d@mastodon.gamedev.place avatar

One marching cubes detail I've not seen mentioned anywhere: the tunnel in case 10.1.2 can be oriented along either diagonal, which can be taken into account when adding interior vertices for the triangulation.

This is the only case with two orientations, all other cases have only a single possible diagonal for a tunnel.

Alternating between the two different tunnel orientiations for marching cubes case 10.1.2.

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@tmpvar brute force :) ray marching in a pixel shader that covers the whole cube (discard where it misses)

sjb3d,
@sjb3d@mastodon.gamedev.place avatar

@tmpvar ah good luck, I like the approach in the latter of solving a quadratic to get intervals for bisection, but I've not tried to implement it!

This is just a debugging tool so it just does small steps and checks for a sign change, then one linear backtracking step to refine the hit depth.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • InstantRegret
  • magazineikmin
  • osvaldo12
  • tester
  • Youngstown
  • rosin
  • khanakhh
  • slotface
  • ngwrru68w68
  • everett
  • thenastyranch
  • kavyap
  • DreamBathrooms
  • JUstTest
  • tacticalgear
  • ethstaker
  • anitta
  • cubers
  • Durango
  • GTA5RPClips
  • modclub
  • mdbf
  • normalnudes
  • megavids
  • cisconetworking
  • Leos
  • lostlight
  • All magazines