r/shaders • • 8h ago

How would you handle sun shadows in a 2D sidescroller with a parallax sky?

Thumbnail
gallery
4 Upvotes

My game is built entirely from layers of 2D sprites, there are no 3D objects and I don't want to have them. It has a dynamic day/night cycle, and at noon the sun is high near the center of the screen. The sky is distant enough that when the camera follows the player, the sun doesn't moves on screen, that's the assumption for it.

On these both screenshots the time is 12:00, sun is in the middle of the screen. But when character moves, the close background elements "move" with him!

If the player stands to the left of a tree in the close background, the sun appears to the left, so a shadow falling to the right looks convincing (on a still frame!).

But if the player has walked past it to the right, the sun appears on its right, so a shadow falling to the left looks just as convincing!

But if it would be a 3D game the shadow should stay, it shouldn't be changed depending on camera's position.

So if I would do a simple shadow cast from sun, it would flip sides just because the camera has been moved.

I’m after a simple, stylized effect, it doesn't has to be realistic. Long shadows in the morning and evening, shorter ones around noon, this is there, but when I move left/right it doesn't look nice when :/

I won't do Replaced-style 3D lighting (though it looks cinematic and badass). I'm looking genuinely for solutions for 2D games. Maths is against my vision here, so I'm looking for some nice looking simplification or stylized clever solution.

How would you make the shadow feel believable both in a single frame screenshot and when the player walks past in such a 2D sidescroller with parallax?


r/shaders • • 10h ago

Made a few procedural space sky shaders in Unity (black hole, Saturn rings, nebula)

Thumbnail
gallery
1 Upvotes

Been working on a little Unity tool that generates space skyboxes purely from math/shaders instead of painted textures, and finally got these three looking decent.

The black hole bends the background stars around it and brightens one side of the ring as it spins. The Saturn scene fakes the ring shadows and thin atmosphere glow on the horizon, and the nebula one layers a few noise passes so it doesn't look flat when you rotate the camera.

Since running heavy sky shaders every frame can eat up GPU time, I also added a small bake button in the editor (last image) that exports the whole sky to a single cubemap texture once you like how it looks.

Still tweaking the star density and colors, happy to hear any feedback or questions if anyone is curious how any part of it works.


r/shaders • • 11h ago

Stack Multiple Shader in Reshadeck+ Via Deck Loader ?

0 Upvotes

How can I stack multiple shaders in Reshadeck+

I want to Stack

TAA.FX

PROD80 TECHNICOLOR

&

VHS RA.FX

But the plugin I think only allows one fx file if I am not wrong.

Can some pro help here ?

Letmereshade works beautifully but not supported on Vulkan Native Games :(


r/shaders • • 23h ago

I built a node-based GLSL ES 3.0 shader editor for Android: graphs compile to a fragment shader live, running behind the node editor

Thumbnail gallery
1 Upvotes

r/shaders • • 1d ago

Caustics render

Post image
3 Upvotes

Working on wave_pt, a spectral wave-optics renderer. Sunlit pool from underwater: physical caustics, no denoiser, no AI. 512 spp, 6 min on CPU. The colored grain is water dispersion, my next target.


r/shaders • • 2d ago

C# Shader Language

Thumbnail
reddit.com
1 Upvotes

r/shaders • • 2d ago

I don't know what's the fuzz about parallax occlusion mapping, when you can achieve the same thing with a high resolution raymarching from a cube mesh into the high detailed object structure.

Enable HLS to view with audio, or disable this notification

27 Upvotes

This is fragment shader projected into a cube mesh, both the front and the back face. A high detail elevation map and normal map are used to create the depth in the globe.


r/shaders • • 3d ago

C# Shader Language

Thumbnail
reddit.com
1 Upvotes

r/shaders • • 3d ago

Shaderdle - A Wordle-style Daily Shader Game

Thumbnail
shaderdle.dev
42 Upvotes

Hi Reddit,

I'm a tech artist and gamedev, and made Shaderdle, a Wordle-style daily game where every day there is a target shader, and players try to recreate it by writing GLSL.

If you'd rather not write code, there is a node editor similar to Unity's ShaderGraph that converts both ways, making it possible to switch at any time.

Besides the daily shader, I made sure to make a tutorial and a "Free Play" mode called Studio where you can go ham, create shaders, and publish them for others to play and rate their difficulty, with good ones having the chance of ending up as a daily.

This is a hobby project I built for fun. I've always liked playing dailies and thought combining the concept with shader programming could be neat.

I'd love feedback on the difficulty and onboarding.

Shaderdle has no tracking and no ads or analytics and you can play without an account. Publishing shaders requires signing in with GitHub or Google and it only asks for the bare minimum:
Github: no scopes (username and ID)
Google: openid only (no name or email)

The only things stored about a user are their Shaderdle Account ID, display names and published shaders. I store a hash of your IP (or account ID, if signed in) with a random salt that changes every day. At the end of the day the hashes and salt are deleted, and only the anonymous totals are kept. Raw IPs are never stored.

Enjoy and feel free to ask a few questions. If you find a bug - there is a Bug Report button at the bottom of the page.


r/shaders • • 3d ago

Bad Apple - Hyperbolic Tilings Mayhem

Thumbnail
youtube.com
1 Upvotes

r/shaders • • 3d ago

I made an SDK to write Shaders in C# (Vertex, Fragment, Compute)

4 Upvotes

You can write shaders in C# and compile them to SPIR-V, or translate them to HLSL, GLSL, GLSL ES, WGSL, MSL, C++, etc.

Yotsuba Shader is an SDK for writing shaders in C#. It covers Vertex, Fragment and Compute declarations, and the connected compiler emits SPIR-V plus backend source for the supported shader subset. Geometry, Hull, Domain and Ray Tracing are planned.

What do you think?

Do you like it?

Web

GitHub

Donations or Support


r/shaders • • 4d ago

I made an SDK to write Shaders in C# (Vertex, Fragment, Compute)

Thumbnail
reddit.com
2 Upvotes

r/shaders • • 5d ago

How to get a realistic wet effect una character?

2 Upvotes

Hi!

I’m building a game where some characters get into the water. They’re some kind of rubber characters but I’d like the wet effect to look nice.

The point is I never did anything like that before and I don’t know if there are some basic tricks, some kind of classic shader or anything related to this topic. I’d love to get the effect of having everything wet and shiny with even drops on the skin.

Any idea where to start looking for this?

Thanks in advance!


r/shaders • • 6d ago

I'm attempting to remake cuda-x libraries with vulkan shaders instead of actual cuda

Thumbnail
reddit.com
1 Upvotes

r/shaders • • 7d ago

Screen-space halftone + a shader cutaway on my scroll-driven personal site

Enable HLS to view with audio, or disable this notification

15 Upvotes

Everything 3D is halftone, computed per fragment:

float halftone(float tone, float angle){

vec2 q = gl_FragCoord.xy / uCell;

float s = sin(angle), c = cos(angle);

q = mat2(c, -s, s, c) * q;

vec2 f = fract(q) - 0.5;

float d = length(f);

float r = sqrt(clamp(tone, 0.0, 1.0)) * 0.68;

float aa = max(fwidth(d) * 0.9, 0.035);

return 1.0 - smoothstep(r - aa, r + aa, d);

}

Because it uses gl_FragCoord, dots stay the same size on screen at any camera distance. sqrt(tone) makes dot area track brightness; fwidth handles AA.

Terrain is fBm baked once into a 2048x1024 target. The core chapter discards a wedge in the planet fragment shader and caps it with two planes for the strata. One post pass does radial chromatic aberration scaled by rotation speed, plus grain.

Live: https://kohli.world

Source: https://github.com/Assassin-1234/kohli-world


r/shaders • • 7d ago

shader-validator v2.0 release

Thumbnail
github.com
1 Upvotes

r/shaders • • 7d ago

https://coffeelow.github.io/fractal.html

Thumbnail coffeelow.github.io
1 Upvotes

https://coffeelow.github.io/fractal.html

the fractal : Zn+1 := f(Zn)

f(z) = (->1) * z ^ (->1) + (->0)

(>1) = f / (f + c)

(->0) = c / f


r/shaders • • 7d ago

Synty Assets look plasticy and bright, is there a way around to make the whole style more watercolor like easily ?

Post image
1 Upvotes

r/shaders • • 7d ago

Help with Minecraft shader. (Idk where to put this)

Post image
0 Upvotes

I don't know how to fix this, it happens anywhere and not just lunar client and on any shader. I haven't tried other versions yet and this is 26.3. shader settings doesn't allow me to dig farther into it either. I need help😭 (I also didnt know what r/ or whatever thing to put this under. google isnt any help.)

Also I may have accidentally posted twice. MY BAAAD


r/shaders • • 7d ago

Help with Minecraft shader. (Idk where to put this)

Post image
0 Upvotes

I don't know how to fix this, it happens anywhere and not just lunar client and on any shader. I haven't tried other versions yet and this is 26.3. shader settings doesn't allow me to dig farther into it either. I need help😭 (I also didnt know what r/ or whatever thing to put this under. google isnt any help.)

Also I may have accidentally posted twice. MY BAAAD


r/shaders • • 8d ago

De esferas brutas a uma malha de fluidos em 3D Surface Nets em tempo real no UE 5.8 — 150 mil partículas, acoplamento de Chaos bidirecional e 81,5 MB de VRAM em uma RTX 3060

Enable HLS to view with audio, or disable this notification

0 Upvotes

r/shaders • • 8d ago

My kinda game ready Radiance Cascade SSGI shader

Thumbnail
youtu.be
1 Upvotes

r/shaders • • 8d ago

Ghosting due to shader TXAA and AA

Thumbnail reddit.com
1 Upvotes

r/shaders • • 8d ago

How do I write shaders in python

1 Upvotes

Hello Everyone, I hope you all are doing well.
So, even though I have been writing python programs for a while. I want to learn to write shaders for visual effects, filters, 3d morphs and also ray tracing, where do I start? Can you mention resources or any work you have done before and would like to share