Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/threejs_4_deno/src/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js>default

A simple transformation of three.js for use within a Deno workflow
Go to Latest
variable default
import { default } from "https://deno.land/x/threejs_4_deno@v121/src/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js";

type

` #ifdef DITHERING // based on https://www.shadertoy.com/view/MslGR8 vec3 dithering( vec3 color ) { //Calculate grid position float grid_position = rand( gl_FragCoord.xy ); //Shift the individual colors differently, thus making it even harder to see the dithering pattern vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); //modify shift acording to grid position. dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); //shift the color by dither_shift return color + dither_shift_RGB; } #endif `