Jump to content

Transparency Dithering: Difference between revisions

From HedgeDocs
Justin113D (talk | contribs)
Adde dithering example
Justin113D (talk | contribs)
No edit summary
Line 1: Line 1:
[[File:SXSG Dithering Texture.png|thumb|The dithering texture used in Shadow Generations]]
Dithering, specifically transparency dithering is an effect to "emulate" transparency blending without having to actually carry the cost of blending.  
[[File:SXSG Dithering animation.gif|thumb|A circle slowly dithering out (recreated in blender) (scaled up by 400%)]]
Dithering, specifically transparency dithering is an effect to "emulate" transparency blending without having to actually carry the cost of blending. It is usually used to fade out models or make otherwise opaque models be see-through for a variety of reasons.


All Hedgehog Engine 2 shaders have dithering code implemented (only confirmed for Shadow Generations right now), but more research is required to understand under which circumstances it is used.
=== Applications ===
Transparency dithering is used
# When using the [[Mesh_Layers#Punch-through|punch through]] render layer
# To make otherwise opaque models see-through when they are covering something the game wants you to see (like the player character)
 
=== Types of dithering ===
 
==== Pattern Dithering ====
 
A carefully crafted dithering texture is used to achieve dithering with a mostly consistent density of discarded pixels.
 
{| class="wikitable" style="width: 100%;"
|-
|style="width: 25%"|[[File:SXSG Dithering Texture.png|256px|The dithering texture used in Shadow Generations]]
|style="width: 25%"|[[File:Linear Vertical Gradient 128x.png|256px|A linear gradient]]
|style="width: 25%"|[[File:LinearDithering.png|256px|The linear gradient with dithering applied]]
|style="width: 25%"|[[File:SXSG Dithering animation.gif|256px|A circle slowly dithering out]]
|-
|The dithering texture used in Shadow Generations
|A linear gradient
|The linear gradient with pattern dithering applied
|A circle slowly dithering out
|}


<div style="clear: both"></div>
<div style="clear: both"></div>
==== Noise Dithering ====
A white-noise texture is used for random looking dithering.
{| class="wikitable" style="width: 100%;"
|-
|style="width: 25%"|[[File:SXSG blue noise 256x red channel.png|256px]]
|style="width: 25%"|[[File:Linear Vertical Gradient 128x.png|256px|A linear gradient]]
|style="width: 25%"|[[File:SXSG Noise Dithering.png|256px]]
|style="width: 25%"|[[File:SXSG Noise Dithering Animated.gif|256px]]
|-
|The red channel of the "blue_noise_256x" texture from Shadow Generations, which is used for noise dithering
|A linear gradient
|The linear gradient with noise dithering applied
|The linear gradient with noise dithering applied, animated (a 4-frame loop)
|}
In Shadow Generations noise dithering is usually used in shaders with "dither" in their name, like [[Shadow Generations Shaders - Common_dither_dpn|Common_dither_dpn]]. Those shaders also support animating the dithering, as shown in the table, but it is currently unknown how to enable the animation.
<div style="clear: both"/>
=== Gallery ===
=== Gallery ===
[[File:SXSG Transparency Dithering Enemy.jpg|center|frame|A GUN bot made see-through using dithering to make Shadow Visible in Shadow Generations]]
<gallery perrow="4" widths="400" heights="300">
File:SXSG Transparency Dithering Enemy.jpg|A GUN bot made see-through using dithering to make Shadow Visible in Shadow Generations
File:SXSG Noise Dithering Ingame.png|A punch-through model in SXSG using the Common_dither_dpn shader with a clip threshold of 0 and a transparency of 0.3
</gallery>

Revision as of 10:09, 2 August 2025

Dithering, specifically transparency dithering is an effect to "emulate" transparency blending without having to actually carry the cost of blending.

Applications

Transparency dithering is used

  1. When using the punch through render layer
  2. To make otherwise opaque models see-through when they are covering something the game wants you to see (like the player character)

Types of dithering

Pattern Dithering

A carefully crafted dithering texture is used to achieve dithering with a mostly consistent density of discarded pixels.

The dithering texture used in Shadow Generations A linear gradient The linear gradient with dithering applied A circle slowly dithering out
The dithering texture used in Shadow Generations A linear gradient The linear gradient with pattern dithering applied A circle slowly dithering out

Noise Dithering

A white-noise texture is used for random looking dithering.

A linear gradient
The red channel of the "blue_noise_256x" texture from Shadow Generations, which is used for noise dithering A linear gradient The linear gradient with noise dithering applied The linear gradient with noise dithering applied, animated (a 4-frame loop)

In Shadow Generations noise dithering is usually used in shaders with "dither" in their name, like Common_dither_dpn. Those shaders also support animating the dithering, as shown in the table, but it is currently unknown how to enable the animation.

Gallery

Cookies help us deliver our services. By using our services, you agree to our use of cookies.