#hlsl
Explore tagged Tumblr posts
Text
Wave Simulation with Caustics
Another fun project I’ve worked on. Its a ripple simulation that I’ve been using for VRChat for quite a while now. It uses an old algorithm (that honestly, I dont fully understand myself) combined with a subdivided mesh that gets displaced and colored based on refraction from the ripples and polygon density. It’s not a super practical effect, and uses a camera feedback loop since at the time of creating the shader for the wave simulation, I didn’t have access to scripting or custom render textures. Good ol’ VRChat hackiness!
45 notes
·
View notes
Text
youtube

ice shader - crossposted from artstation -
6 notes
·
View notes
Text

Pick your side.
2 notes
·
View notes
Text
Honors Project & Dissertation - Generating physically inspired lightning effects in the GPU using parallelization techniques
Finally, time to upload my Honors Project! I really loved working on this, as one of my main interests is physics simulation in graphics programming.
Here's the explanation for this project - which is basically comparing two algorithms for rendering lightning geometry, parallelizing them, and seeing which one is faster.
Keep reading for the explanation! However, if you want the full documentation and breakdown of this project, click here.
Physically based or inspired lightning is not feasible to implement in interactive applications such as games because of the iterative nature of its algorithms, which makes them computationally expensive.
Accurate lightning simulation is described with the Dielectric Breakdown Model (DBM), which involves solving Laplace’s equation. Solving it with the conjugate gradient method (CGM) has been proven to be computationally expensive, however, this method has been substituted with a rational function to produce faster results. Additionally, these methods have been tested in single-threaded CPU applications, but there’s evidence that the CGM can be optimized if they are computed in parallel in the GPU.
This research attempts to prove whether it’s possible to optimize physically inspired lightning generation performance using a rational function method in the GPU with the aid of parallel multithreading.
The application is developed in C++ using the Direct3D 11 API. It ports open-source code of the CGM and rational method from OpenGL to D3D11. Testing is carried out using a performance benchmark measuring the computation times of the parallelized rational method using a compute shader against its non-parallelized version and the CGM.
Despite the embarrassingly parallel nature of the algorithm, the parallelized version was 3 times slower than its non-parallelized version, albeit 3 times faster than the CGM. Resources consumed by the rational method increased ninefold compared to its non-parallelized version as well.
In conclusion, the parallelized version proved to be slower due to the CPU-GPU data transfer overhead. Further research hypothesis suggests the use of group shared memory could compensate for this overhead.
Personally I would've loved to have more time to work on this as I believe I could've proved my hypothesis with group shared memory, but I'm not as knowledgeable yet. I need to study more graphics programming!
0 notes
Text
youtube
SDF raymarched ghost chasing :)
1 note
·
View note
Text
Working on adding DirectX 11 support on avdl , my programming language.
This is a small video showing a previous game of mine, "The king is gone", running on an Xbox Series S.
Still missing a few important pieces, but very happy with the progress so far. Looking forward to messing a bit more with HLSL shaders 😁
0 notes
Text
Texture buffers are a pain in the ass when you can’t use scripts T-T
0 notes
Text
Working on modifying the default Beat Saber shaders to add Audio Link support. Looks kinda nice so far but the colours are off...
0 notes
Text
0 notes
Text
the more time i spend trying to figure out how to write glsl shaders that can edit textures in unity, the more evil i grow
#genuinely for real feel like i could kill someone#seriously all of unity's docs for writing shaders is for whatever the fuck their non-glsl shading language is and its driving me nuts#its hlsl or cg or something i cant even figure THAT out#hal post
1 note
·
View note
Text
Dragon Curves
This is one of my personal favorite fractals, the Harter-Heighway Dragon Curve, featured in the original Jurrassic park book shown skipping a few steps at a time, unpredictably evolving into this shape here to highlight the chaotic but organized mess of nature we struggle to predict and understand. This is among the friends I am most deeply and intimately familiar with. I started playing around with these based off an old ViHart video explaining how to make them in terms of squiggles and folding papers
My traditional method has always been to take a sequence, reverse it, and add one, rolling over when you hit 4. Example 0 01 01 21 01 21 23 21 01 21 23 21 23 03 23 21
If you change each number into a direction, 0 being right, 1 being up, and so on, then follow that path along the sequence you will also get a dragon curve. There are so many wonderful ways to construct these
However, here’s my favorite
This is my Dragon Curve *unity shader* that I wrote. It comes with an editor script that you can use to bake it into a texture, since the process is a bit heavy. Why is this so special you ask? Well it comes down to the fact that this is running in real time, in parallel. See algorithms have two main kinds of families, parallel and serial. A serial algorithm goes step by step, like taking a math test alone. A parallel algorithm runs side by side, like everyone doing one problem on the test. Its much faster, but they aren’t allowed to talk to each other so if the same problem shows up twice, or if a second problem relies on the answer to the first, its much more difficult. This is why dragon curves are hard to parallelize. You take the sequence *before* and reverse / increase. You take the segments *from the last step* and fold them again. You fold the paper *back over itself* referencing previous work. This problem is about as serializable as it comes. So how do you parallelize? Will, you change your perspective
See instead of trying to split everyone up to try to *create* a dragon curve, you give every pixel a job to decide *is it on* a dragon curve. By rotating the space itself in alternating grid patterns you can twist a dragon curve down into a single line. If your point in space ends up on the line, then it was on the dragon curve! Furthermore, the direction it turns due to how the grids line up actually encodes how far along the dragon curve it was in binary (left being a 0, right being a 1), so by keeping track of that and converting it to decimal we can give subtle coloration to points on one dragon curve from 0-2^n, and clip out anything that isn’t on it. As far as I know, I’m the only person to have implemented it this way and it might be a straight up novel algorithm, which I’m super proud of!
And this is how I create these beautiful Dragon Curve Plaids. Since we’re warping the space itself, we do our twisting to collapse it, put some little checker and strip patterns on that space, color it a little bit based on the direction, and unwind it again to twist the pattern into the dragon curve instead of the space. I also have a live demonstration of the algorithm up on shadertoy, though its a very outdated implementation and not well optimized. Here’s one thats animated, and here’s a newer one that tracks the folds in binary. They are rendering in real time, so potatos beware. Finally, here’s a zoom on one of my youtube accounts of a 41st iteration dragon curve zoom, twice as many iterations in realtime as my old laptop could do in 20 minutes. Computer Science enthusiasts will realize how mind boggling cool that is, even if its is entirely useless.
#Dragon curve#fractal#jurrasicpark#math#shaders#glsl#hlsl#shadertoy#math art#mathematics#mathematical art#vihart#im liking it here i found my happy ranting space i think
10 notes
·
View notes
Note
Your game is so cool, I wanna make games myself someday too. Is unity good? I've heard some bad stuff about the CEO...
That depends heavily on what you want to do. Unity is fine, Unreal is fine, Godot is fine, but each has different strengths and weaknesses (another way to phrase it, having used Unity a lot personally and Unreal a lot professionally, would be "Unity is awful and Unreal is also awful, but you can get by in both"). If you want to make a 3D action game, probably learn Unreal; I use Unity for mine because I like writing in C#, but for an absolute beginner, Godot script and Unreal's blueprints are probably both easier to learn. Don't listen to anyone who tells you Unity is somehow easier, the only real strengths it has in a vacuum is much better online documentation, better access to HLSL shader stuff, better version control, and kind of better live coding than Unreal; a lot of stuff that's easy in Unreal takes absolutely forever to do in Unity.
Other tips: Join game jams and work with other people, make friends who do similar things to what you want to do; Don't make the game you really want to do until much later than you think, you will burn out running into issues, make tiny tiny tiny projects first; Learn what sources to trust for input. A lot of unreal tutorials on youtube are really terrible and will teach you bad practices, forums will tend to be better, friends who are already versed in the software are often a much better bet, but don't expect to learn anything without a lot of experimenting first; Don't expect to make any money off it, at least for a long time.
Best of luck
50 notes
·
View notes
Text
i tried deepseek R1 (running locally in the browser using webgpu which is kind of impressive in itself).
edit: this is apparently not the full deepseek but a tiny subset of it, so don't read too much into this
I really like the way it generates 'reasoning' and tries different approaches to verify its work, but unfortunately even for fairly simple problems it seems to have a bad habit of getting stuck in infinite loops of outputing the same sentences over and over again. it was fun to toy around with, but not particularly useful.
what was most interesting was seeing it try multiple approaches and compare if they gave the same answer. e.g. I asked it to solve a simple integral, it solved it analytically immediately, but then it tried a bunch of other approaches, e.g. a geometric consideration, a riemann sum... it got confused because it the riemann sum was slow to converge, but it was able to recognise why that was a problem and go back to its original answer. reading that felt weirdly human in a way AI output often doesn't.
I tried giving it a shader problem to solve (HLSL function to get a ray-cylinder intersection with UVs). this is a pretty well-studied problem, you can find many examples of ray-cylinder intersection code on shadertoy, but the UVs is an additional wrinkle. it started out pretty well trying to solve the problem from first principles, correctly working out that it needed to solve a quadratic equation, but it couldn't figure out how to parameterise the cylinder and got stuck in a loop saying 'I need to parameterise the cylinder, the cylinder is a 3D object so there are two solutions' essentially. chatGPT 4o on the same problem gave a clean, correct and well-commented (if slightly unoptimised) solution.
I tried asking about advice for disrupting a company that is creating weapons used in a genocide (hypothetically speaking!). since I mentioned drones in my prompt, it got a bit hung up on rather scifi answers and ethical questions, and then got stuck in an infinite loop again. tactical mastermind this is not.
I tried asking it for advice on prompting it in a way that wouldn't get stuck in an infinite loop and you can probably guess what happened.
overall it doesn't seem to work very well for complex problems, and hasn't really changed my skepticism towards LLMs being useful for anything other than a fancy search engine... but I'm not really used to prompting LLMs, and I'm not sure how to e.g. fiddle with the temperature and similar on the huggingface web interface.
23 notes
·
View notes
Text
Shader Programming: 3D Scene using Direct 3D 11 - 3rd Year Project
My favorite project I made while I was an undergrad! This was the first time I used Direct 3D, HLSL and coded my first shaders.
I had no idea about shaders prior to this project - I had only dabbled in OpenGL, but wasn't aware of the graphics pipeline, nor that GPUs were programmable.
That said, the whole module fascinated me. It was so engaging, and I loved the way algorithms and vector maths could be implemented to draw and render shapes and effects on the screen.
youtube
The scene makes use of the vertex, hull, domain and fragment shaders, for geometry manipulation and post processing effects.
All of the shaders were written from scratch using VS and the D3D11 graphics API, in C++ and HLSL.
You can read more about the project here!
1 note
·
View note
Text
Creating color picker with custom nodes
1 note
·
View note
Note
Shaders!
How did you get into making shaders? I've done a lot of modeling and texturing, and while I've hacked together code for other things, I've never tried making shaders and it seems like something that would be really fun. I'd love to know how to get started making things like your raymarching shader. Do you do it within your modeling program or in an engine like unity/unreal? My modeling program of choice is 3ds max and I am not exactly sure if it supports making custom shaders
i think at some point i was just like, i wanna make cool sparkly rocks!!! so i slowly taught myself to make shaders in unity (since i was already learning unity for school). nowadays unity and most other programs have node-based shaders, which work just as well, but i find myself being a lot faster and more organized with just writing them in hlsl (the shader language unity uses)!!
a lot of the things i learn just end up as a result of little journeys - raymarching is a great example, i learned about it by watching a bunch of graphics gdc talks, and stumbled on it in a talk on how they rendered clouds in horizon zero dawn. i cant seem to find the talk it might be vaulted but this paper goes over basically everything from the talk. so i just started implementing the things from the talk!! or at least thats what i wanted to do. i got very stuck very fast and although i looked up a bunch of different tutorials on raymarching, i couldnt crack through it
so i took a break!! until a year later when i knew more and was like, i wanna try again! so i did and that time i got it working. this was my first little raymarching shader :)
anyways hope this helps a bit.. hard to put into words Exactly how i learned but it was mostly just, looking up resources online of cool things i wanted to do, googling whenever i got stuck, putting it down when i hit walls and tried again later, etc... lots of experimenting and failing and trying again !!!!
bit of an old post but here's one specifically for unity shader resources, but most of the fundamentals between programs are the same
90 notes
·
View notes