Post B1DiPtLKXMDxDBDN32 by bug@fosstodon.org
 (DIR) More posts by bug@fosstodon.org
 (DIR) Post #B1DiPrbuyiIvq2xacq by bug@fosstodon.org
       2025-12-13T21:31:04Z
       
       0 likes, 0 repeats
       
       // Bonfirevoid main(){float i,t,d,a,v,n,w;vec3 p,q,k,o,K=vec3(9,3,1);for(d++;i++<5e1&&d>.001;o+=d>n?d=abs(n)*.4+.05,K/d:K*exp(-length(k)*.6)*20.,t+=d*.5)for(k=normalize(vec3(P+P-R,R.y))*t+vec3(0,6,-15),d=k.y,w=.0025,a-=a,n=.96*length(k.xz)+.27*k.y-5.34;a++<9.;w+=w)p=k,p.zx*=mat2(cos(a*2.4+vec4(0,33,11,0))),q=p,q.y-=a*T,n+=abs(dot(sin(q*.7/w),q-q+w)),p.z-=5.,p.yz*=mat2(1,v=a*.18,-v,1)/sqrt(v*v+1.),d=min(d,max(abs(p.z+5.)-5.,max(abs(p.x)*.9+p.y*.5,-p.y)-.3));O=vec4(tanh(o/5e2),1);}#shader #demo
       
 (DIR) Post #B1DiPtLKXMDxDBDN32 by bug@fosstodon.org
       2025-12-13T21:31:49Z
       
       0 likes, 0 repeats
       
       https://b.pkh.me/2025-12-13-bonfire.htm#Shadertoy portage: https://www.shadertoy.com/view/3ctBDn#shader #glsl #demo #fire
       
 (DIR) Post #B1DiPv0ULok0N7Tkq8 by wolf480pl@mstdn.io
       2025-12-13T22:53:59Z
       
       0 likes, 0 repeats
       
       @bug wow, if you decrease the iteration count, you get cartoon fire
       
 (DIR) Post #B1EdlSUKl2zHgHqn1E by bobulous@fosstodon.org
       2025-12-13T22:18:52Z
       
       0 likes, 0 repeats
       
       @bug There's no randomness needed?
       
 (DIR) Post #B1EdlTg4Kty7MyLfwu by bug@fosstodon.org
       2025-12-13T22:21:28Z
       
       0 likes, 0 repeats
       
       @bobulous nope, just sinusoids with rotation; I put some explanation in this article: https://blog.pkh.me/p/45-code-golfing-a-tiny-demo-using-maths-and-a-pinch-of-insanity.htmlI'm using this in pretty much all my demos; see https://blog.pkh.me/p/48-a-series-of-tricks-and-techniques-i-learned-doing-tiny-glsl-demos.html for more
       
 (DIR) Post #B1EdlUZN1ICk8UDq9A by wolf480pl@mstdn.io
       2025-12-14T09:36:37Z
       
       0 likes, 0 repeats
       
       @bug @bobulous after reading the cube ray marching example, the code a lot more sense!though I don't see whydeltaT / d²as1/dwould be correct when doing transparency
       
 (DIR) Post #B1EgSaWkwbqOySg2Ou by bug@fosstodon.org
       2025-12-14T10:06:50Z
       
       0 likes, 0 repeats
       
       @wolf480pl yup with the transparency I didn't investigate but it's most likely incorrect. Still it produces a nice credible and useful effect with almost no code. Note: from my experience, it's also very unstable/sensitive to parameters.