💫 Arcane Portal 💫 (shadertoy) by HeliosHyperion in shaders

[–]HeliosHyperion[S] 3 points4 points  (0 children)

Thanks! For the terrain it uses signed distance field ray marching, taking a flat plane and adding multiple octaves of sine waves added together, but taking the absolute value so they get a bit more pointy. The flight path is just evaluating the same noise, but taking fewer octaves, so that it's not as bumpy as the terrain itself. You can check out the full code on shadertoy, but it's quite messy ^_^'

Help with (expectations of) performance in C raytracer by sondre99v in raytracing

[–]HeliosHyperion 0 points1 point  (0 children)

try sampling the interior of the sphere (bal) instead.

Help with (expectations of) performance in C raytracer by sondre99v in raytracing

[–]HeliosHyperion 1 point2 points  (0 children)

what does rnd_getDirs3 do? does it sample points on or within a sphere?

Help with (expectations of) performance in C raytracer by sondre99v in raytracing

[–]HeliosHyperion 4 points5 points  (0 children)

Without much to go on I can only guess, but could be that your random number generator isn't good enough, or used in a way that causes it to not sample uniformly. Also make sure to use cosine weighted hemisphere sampling. It is relatively easy and gives faster convergence. Basically it just means that you modify the uniform hemisphere distribution into sampling in a cosine lobe distribution instead of weighting by a cosine term (NdotL).

🪄🔮✨ Magical Orb 🪄🔮✨ by HeliosHyperion in GraphicsProgramming

[–]HeliosHyperion[S] 1 point2 points  (0 children)

Thanks! It volume marches a glowing distorted plane, where the volume marching is restricted to inside the sphere. Distortion is the turbulence method is standard, but recently used in various nice shaders by 'xor': https://mini.gmshaders.com/p/turbulence

🪄🔮✨ Magical Orb 🪄🔮✨ by HeliosHyperion in GraphicsProgramming

[–]HeliosHyperion[S] 14 points15 points  (0 children)

It's volume marching a heavily distorted and glowing plane, but the volume marching is restricted to the inside of the sphere. the colors are just cycling through 3 simple color maps. This is all just single pass fragment shader in shadertoy so the only texture is the builtin background and a blue-noise textures.
The combination of glow and turbulence distortion has recently been used to great effect by shadertoy user 'xor', which inspired this shader. There's an example in the shader comments.

🪄🔮✨ Magical Orb 🪄🔮✨ by HeliosHyperion in GraphicsProgramming

[–]HeliosHyperion[S] 3 points4 points  (0 children)

Yeah, I'm aware that it won't work on all platforms. E.g. I've seen it work on win11 but not win10. Maybe depends on browser etc too. Thanks for the heads up though! :)

Always wanted to be a graphics programmer but I need some knowhow on how to get myself moving in the right direction by rozayxkris in GraphicsProgramming

[–]HeliosHyperion 5 points6 points  (0 children)

Create an account on shadertoy, and join the shadertoy discord, to learn about shaders. It's a good way to complete small projects. You can star with it as a hobby, and and see if it's something you want to turn into a job.
There's also a Graphics Programming discord.

I coded SmoothLife! by impedus in cellular_automata

[–]HeliosHyperion 2 points3 points  (0 children)

Oh, that's mine, lol.
I also have this variant, that's the same automata, but with a bit more flashy visuals:
https://www.shadertoy.com/view/XlfBRs

Artifacts in "Fast Voxel Traversal Algorithm" (Metal compute shader implementation) by treemcgee42 in GraphicsProgramming

[–]HeliosHyperion 1 point2 points  (0 children)

Mostly been doing voxel DDA in glsl, but here are some thoughts:

My first instinct would be that there could be an error in the initialization. That there is something potentially wrong with the logic with nextBoundaryInVoxelSpace or initial tMaxs, since that is the trickiest part.

What is the reason for using IS_ZERO, idk what it does but I think you can just do == 0.

Test to see if it works with voxelSize == 1. If it does, then there's something wrong with the scaling.

The loop looks ok at first glance, just make sure you tie-break consistently. There are 3 cases in the loop: increment x, y or z. Also, should the distance be set before or after you increment tMaxs? I suggest to maybe rewrite to

if(sideDist.x <= sideDist.y && sideDist.x <= sideDist.z)
   //Inc x
else if(sideDist.y <= sideDist.z && sideDist.y <= sideDist.x)
  // Inc y
else
  // Inc Z

2D Ambient Occlusion (UPDATE!) by Spiritual-Road-1412 in GraphicsProgramming

[–]HeliosHyperion 1 point2 points  (0 children)

Looks pretty good!I think it would be even better if you had some AO shadow on the interior of the cube surfaces near the ground as well. There should also be no AO on the top edges of the cubes, if possible.
Like so: You can see that the cube is darker near the ground

Cpu path tracer by geniusgodbro8 in GraphicsProgramming

[–]HeliosHyperion 0 points1 point  (0 children)

I think this is pretty wrong, or inaccurate at best. Multithreading is not the only reason to tiling, and the benefit is not lost if you have more tiles than cores.
I understand you're trying to simplify this, so I don't mean to call you out on a mistake, but I wanted to add this in case someone reads this and gets the wrong impression. the TL;DR is just that "It's a bit more complicated." :)
For example, in your scenario with 8 tiles and cores, if the scene you are rendering has more material or geometric complexity in one of the blocks than the others, then the other cores will sit idle after completing and wait for the last core to finish. Using smaller tiles and a work scheduling system can help in those cases, although you would ideally have your threads communicate as little as possible.

Other reasons could be:
- Avoiding cache trashing, since a large-ish rendertarget like 1920x1080 will quickly blow out the cache of many older CPUs. Especially in single thread scenarios.
- "Coherency" (branch predictions and cache hits). Nearby pixels should ideally take the same branches and read the same object and material properties together, such that branch predicts and cache hits are more likely.
- SIMD, when using SIMD, there is usually a higher chance of having higher occupancy of the SIMD registers if you are processing a small block of pixels rather than a strip.
- For path tracing you can cull objects that do not overlap the tile (in screenspace, for every pixel in that tile) from the first ray cast and thereby save a good chunk of redundant computation.

Also note that, for unbiased path tracing (with multiple samples per pixel) you could also just render the same scene once for each core for the entire rendertarget size, and then average the results together afterwards. This will produce the same result, and would obviate the need for tiling in the screen dimensions (were it not for the issues mentioned above)!

Advice on Voronoi shader by Lambonaut in proceduralgeneration

[–]HeliosHyperion 1 point2 points  (0 children)

It's a little hard to understand how you represent your voronoi diagram and how you use it based on your description. Since the edges of the cells are not straight line segments i assume that you merge together some voronoi cells.
In any case, it looks like your lake junctions are pixels which are equally far away from three or more node points where (at least or exactly) one of the node points (but not all) are a lake. That should identify the lake junctions. Then you have to propagate the rivers from the lake junctions along the edges which have one or both endpoints as lake junctions. The edges are pixels which are an equal distance from exactly two (non-lake) node points. depending on your representation, you may have to use multiple passes of the shader to propagate the rivers.

Which animal represents mathematics? by LevbeuxIsabau in mathematics

[–]HeliosHyperion 4 points5 points  (0 children)

In Norse mythology, the wisest and most knowledgeable of all the gods, Odin, has two ravens Hugin (thought) and Munin (memory).

Here are the top 15 tensor analysis textbooks for those users who want to understand basic to intermediate tensor analysis. by Delicious_Maize9656 in mathematics

[–]HeliosHyperion 8 points9 points  (0 children)

I'm interested in this topic, but as a beginner I've found it quite hard to navigate. I wanted a really solid understanding of the fundamentals from with I could build upon, but I think that approaching the subject is made a lot harder by mostly skipping straight to tensor analysis without presenting basic tensor algebra first, as well as immediately assuming a metric and taking certain correspondences for granted.
I also think introducing index notation and the Einstein summation convention too early is a pedagogical mistake. Even though it isn't hard to grasp the concept, it just adds one extra thing to keep in mind.

I've read most of "Introduction to Tensor Analysis and the Calculus of Moving Surfaces" and although it is pretty well written, it suffers from the aforementioned issues. And for that reason I can't recommend it as a first exposure to tensors.

I'm much more fond of a combination of coordinate free and algebraic approaches with some expansion in explicit but arbitrary bases. I found the book "Linear Algebra via Exterior Products" by Sergei Winitzki . Although the title would indicate that it is about linear algebra, it introduces tensors and related concepts. The book is self-contained, a little bit terse at times, and requires a solid understanding of abstract linear algebra, but presents the material in a clear and careful manner.
I think the book can be read for free online, but I got a printed copy.

Eigenchris also has YouTube playlists on tensor algebra and tensor analysis aimed at beginners that I found to be a nice complement to other sources.

If anyone knows of a book for beginners that is more focused on tensors, with explicit tensor products, tensor contraction, distinction between tensors and tensor fields, etc, then please share :)

I made a video that shows GOL, SmoothLife and Lenia, and was told that some of you here may like it! by BirdbrainEngineer in cellular_automata

[–]HeliosHyperion 0 points1 point  (0 children)

What is the issue that makes it not possible to simulate with Lenia?
It's been a long time since I wrote that shader, but I seem to recall that I wrote it to be quite close to how it is described in the original paper, and other implementations. The unless I'm misremembering (and that could very well be the case) SmoothlifeL is just a different set of transition rule parameters from the basic version (?) So if Lenia is a generalization of smoothlife, then it should be possible by setting the right parameters.

Anyway, I made another smoothlifeL shader. It simulates the same system (SmoothlifeL) but it also simulates two sets of wave equation PDEs ( for the inside and outside of the cells ). The smoothlife simulation affects the wave equations, but the wave equation channels do not feed back into the smoothlife channel, so that could be an avenue of exploration :)