Skip to content

Commit

Permalink
Motion Noise Fix and Dither Info
Browse files Browse the repository at this point in the history
Motion noise would glitch and freeze after long time periods, which is now fixed. Additionally there are more details describing dithers.
  • Loading branch information
Immorpher committed Jun 9, 2024
1 parent 8fa4de4 commit 5b8e868
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FTEQW (OpenGL)/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
About HSV Dither 1.2
About HSV Dither 1.3
----------------------------------------------
HSV Dither is a color boosting, banding, and dithering shader. It operates on the color and brightness channels independently and non-linearly.

Expand Down
4 changes: 2 additions & 2 deletions FTEQW (OpenGL)/glsl/hsvdither.glsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ---------------------------------------------------------------------
// About HSV Dither 1.2
// About HSV Dither 1.3

// HSV Dither is a color boosting, banding and dithering shader. It operates on the color and brightness channels independently and non-linearly.
// See user defined values section to customize this shader and learn more about its capabilities. The effects are enhanced if you pair this with increased pixel sizes.
Expand Down Expand Up @@ -197,7 +197,7 @@ float motionnoise(vec2 position){
float timer = e_time; // Grab the FTE uniform for time

// Alternate oscillations
wavenum = wavenum + sin(float(timer)*vec2(34.989854,50.2336357));
wavenum = wavenum + sin(fract(timer*0.000123456789)*vec2(3498.9854,5023.36357));

// Get random number based on oscillating sine
return fract(sin(dot(position,wavenum))*43758.5453); // return comparison value
Expand Down
2 changes: 1 addition & 1 deletion GZDoom/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
About HSV Dither 1.2
About HSV Dither 1.3
----------------------------------------------
HSV Dither is a color boosting, banding, and dithering shader. It operates on the color and brightness channels independently and non-linearly.

Expand Down
4 changes: 2 additions & 2 deletions GZDoom/shaders/hsvdither.fp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ---------------------------------------------------------------------
// About HSV Dither 1.2
// About HSV Dither 1.3

// HSV Dither is a color boosting, banding and dithering shader. It operates on the color and brightness channels independently and non-linearly.
// See user defined values section to customize this shader and learn more about its capabilities. The effects are enhanced if you pair this with increased pixel sizes.
Expand Down Expand Up @@ -174,7 +174,7 @@ float motionnoise(vec2 position){
vec2 wavenum = vec2(78.233,12.9898)+ilgnoise(position); // screen position noise

// Alternate oscillations
wavenum = wavenum + sin(float(timer)*vec2(34.989854,50.2336357));
wavenum = wavenum + sin(fract(timer*0.000123456789)*vec2(3498.9854,5023.36357));

// Get random number based on oscillating sine
return fract(sin(dot(position,wavenum))*43758.5453); // return comparison value
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# HSV Dither
HSV Dither is a shader based on the hue, saturation, and value (HSV) method of color representation rather than red, green, blue (RGB) or even hue, saturation, brightness (HSB). I first noticed this in the code of Doom 64, where the sector lights were being boosted by this method. In modern days, I believe Nightdive’s KEX engine also utilizes this method for brightness boosting. In the HSV method, brightness can be used by boosting the value (V) component. Contrary to other methods, the HSV method preserves color saturation while boosting brightness. This is why Doom 64 is remembered for its deep colors and perhaps explains why KEX engine has some of its vibrant colors too. Here HSV Dither has options to boost both the brightness and saturation within the HSV method. This boosting is done non-linearly where higher brightnesses and saturations are not clipped, rather they are compressed.

This shader is also a continuation of my previous Bandither shader. Bandither is a shader which reduces the color output in RGB space akin to classic 90’s hardware. Keeping within the theme, HSV Dither operates color (hue/saturation) and value channels independently for banding and dithering. Often games which use lower-resolution assets can benefit from banding and dithering. I first noticed it with Quake 64 where banding caused sharp color edges to its texture which added some detail. Additionally, HSV Dither can create various effects from adding some grit to creating a pseudo-CRT look. Overall, this is a shader particularly suited for dark and colorful games, both modern and classic.
This shader is also a continuation of my previous Bandither shader. Bandither is a shader which reduces the color output in RGB space akin to classic 90’s hardware. Keeping within the theme, HSV Dither operates color (hue/saturation) and value channels independently for banding and dithering. Often games which use lower-resolution assets can benefit from banding and dithering. I first noticed it with Quake 64 where banding caused sharp color edges to its texture which added some detail. When programming for the Nintendo 64 I noticed a set of additional dithers which add grit (specifically bayer, noise, and magic square) which are options here as well. You may recognize the bayer dither as hatch patterns in older graphics. Additionally, there are dithers for scanlines, grids, zig zags, and checkers. In total there are 13 dithers which can be combined to create various effects, including a CRT-like effect. Overall, this is a shader particularly suited for dark and colorful games, both modern and classic.

# Supported Software
GZDoom - https://zdoom.org/downloads
Expand Down
2 changes: 1 addition & 1 deletion ReShade/HSVDither.fx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ---------------------------------------------------------------------
// About HSV Dither 1.2
// About HSV Dither 1.3

// HSV Dither is a color boosting, banding and dithering shader. It operates on the color and brightness channels independently and non-linearly.
// See user defined values section to customize this shader and learn more about its capabilities. The effects are enhanced if you pair this with increased pixel sizes.
Expand Down
2 changes: 1 addition & 1 deletion ReShade/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
About HSV Dither 1.2
About HSV Dither 1.3
----------------------------------------------
HSV Dither is a color boosting, banding, and dithering shader. It operates on the color and brightness channels independently and non-linearly.

Expand Down

0 comments on commit 5b8e868

Please sign in to comment.