Port of Phosphor 3 by XorDev

CREDIT TO:
/*
“Phosphor 3” by @XorDevXorDev https://x.com/XorDev/status/1949897576435581439

https://www.shadertoy.com/playlist/N3SyzR

*/

Phosphor3

Adapting the original shader design for rendering on the double-surface of a 3d sphere mesh rather than a billboarded plane mesh was non-trivial. The original shader used a single z-offset position for both the distance field evaluation and the pattern computation, which meant only ray directions that geometrically intersected the offset implicit sphere would ever converge and accumulate color. The solution separates these two concerns: the signed distance field evaluates against the un-offset position (making convergence purely radial and therefore direction-independent), while a separate offset copy feeds into the turbulence function to preserve the original wave character. This ensures every point on the sphere’s surface drives its ray march to convergence at the same radial distance, producing full coverage of the 3d sphere mesh, while the directional variation in the pattern input maintains the visual richness across the surface. Albeit not as impressive as the original shader in its general aesthetic, this playground can serve as a template for other isotropic shaders serving such purposes as VFX surrounding characters.

I would love for anyone to share thoughts and post remixes.

Turbisphere

8 Likes

@Evgeni_Popov @Cedric
I have messed something up when trying to adapt for a double-sided sphere rather than a billboard plane. There is a problem in the way the ray marching is working with the sphere’s uvs which have already undergone spherical projection. I would appreciate any guidance in fixing this.

Here is my first attempt at adapting for a double-sided sphere.

2 Likes

Amazing!! Thank you for sharing! :smiley:

1 Like

I’d use gl_fragcoord and screen ratio as a uniform. Or use a screen aligned plane. It’s not too complicated to compute the plane vertex coordinates from a center, uv and camera view matrix.

2 Likes

Thanks @Cedric . I will try your approach. :folded_hands: