# glsl-random **Repository Path**: mirrors_mattdesl/glsl-random ## Basic Information - **Project Name**: glsl-random - **Description**: pseudo-random 2D noise for glslify - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2026-05-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # glsl-random [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges) The classic 'one-liner' for 2D pseudo-random values in GLSL. This uses a highp version for improved randomness and better stability across GPUs, see here: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ However, the 'classic' lowp version (with no precision specified) is also included here. Some may find it useful for targeted mobile GPUs. ![Noise](http://i.imgur.com/CSC7rWV.png) ## usage ```glsl #pragma glslify: random = require(glsl-random) ... float rnd = random(myVec.xy); ``` Typically you might use it like so: ```glsl gl_FragColor = vec4( vec3( random( gl_FragCoord.xy / resolution.xy ) ), 1.0 ); ``` ### default precision Requiring the following will give you a function that doesn't specify any precision: ```#pragma glslify: random = require(glsl-random/lowp)``` ## license BSD-3-Clause