OpenGL Shading Language

1 program Added 2025-10-23T07:13:36Z Model: google/gemini-2.5-proTemp: 0.4 Evidence Report issue View issues
Aliases: GLSL
Provenance: commit 5b7310b083 · authored 2025-10-23T09:13:36+02:00 · model google/gemini-2.5-pro

Sources mentioning this language

8 sources · pl_id: pl/glsl
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q779819

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Designed byKhronos Group
First appeared2002
Homepagehttps://www.opengl.org/

Extensions claimed by this language

26 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.glsllinguistprimary1.2M files
.vertpygmentsprimary603.1K files
.fplinguistsecondary62.1K files
.fraglinguistsecondary781.0K files
.fragpygmentssecondary781.0K files
.frglinguistsecondary6.4K files
.fslinguistsecondary2.4M files
.fshlinguistsecondary157.7K files
.fshaderlinguistsecondary2.1K files
.geolinguistsecondary115.4K files
.geopygmentssecondary115.4K files
.geomlinguistsecondary31.4K files
.glslflinguistsecondary4.7K files
.glslvlinguistsecondary3.7K files
.gslinguistsecondary257.9K files
.gshaderlinguistsecondary14 files
.rchitlinguistsecondary4.5K files
.rmisslinguistsecondary1.9K files
.shaderlinguistsecondary759.5K files
.tesclinguistsecondary3.8K files
.teselinguistsecondary3.4K files
.vertlinguistsecondary603.1K files
.vrxlinguistsecondary4.0K files
.vslinguistsecondary137.8K files
.vshlinguistsecondary60.3K files
.vshaderlinguistsecondary1.4K files

Related languages

GLSL (0.82)Open Shading Language (0.63)Metal (0.47)Metal Shading Language (0.47)HLSL (0.42)

LLM-contributed programs

Star Nest

Provenance: commit 5b7310b083 · authored 2025-10-23T09:13:36+02:00 · model google/gemini-2.5-pro · Temp 0.4
code.glsl · license: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported · added: 2025-10-23T07:13:36Z
// Star Nest by Pablo Román Andrioli
// This content is under the MIT License.

#define iterations 17
#define formuparam 0.53

#define volsteps 20
#define stepsize 0.1

#define zoom   0.800
#define tile   0.850
#define speed  0.010 

#define brightness 0.0015
#define darkmatter 0.300
#define distfading 0.730
#define saturation 0.850


void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
	//get coords and direction
	vec2 uv=fragCoord.xy/iResolution.xy-.5;
	uv.y*=iResolution.y/iResolution.x;
	vec3 dir=vec3(uv*zoom,1.);
	float time=iTime*speed+.25;

	//mouse rotation
	float a1=.5+iMouse.x/iResolution.x*2.;
	float a2=.8+iMouse.y/iResolution.y*2.;
	mat2 rot1=mat2(cos(a1),sin(a1),-sin(a1),cos(a1));
	mat2 rot2=mat2(cos(a2),sin(a2),-sin(a2),cos(a2));
	dir.xz*=rot1;
	dir.xy*=rot2;
	vec3 from=vec3(1.,.5,0.5);
	from+=vec3(time*2.,time,-2.);
	from.xz*=rot1;
	from.xy*=rot2;
	
	//volumetric rendering
	float s=0.1,fade=1.;
	vec3 v=vec3(0.);
	for (int r=0; r<volsteps; r++) {
		vec3 p=from+s*dir*.5;
		p = abs(vec3(tile)-mod(p,vec3(tile*2.))); // tiling fold
		float pa,a=pa=0.;
		for (int i=0; i<iterations; i++) { 
			p=abs(p)/dot(p,p)-formuparam; // the magic formula
			a+=abs(length(p)-pa); // absolute sum of average change
			pa=length(p);
		}
		float dm=max(0.,darkmatter-a*a*.001); // dark matter
		a*=a*a; // add contrast
		if (r>6) fade*=1.-dm; // dark matter, don't render near
		//v+=vec3(dm,dm*.5,0.);
		v+=fade;
		v+=vec3(s,s*s,s*s*s*s)*a*brightness*fade; // coloring based on distance
		fade*=distfading; // distance fading
		s+=stepsize;
	}
	v=mix(vec3(length(v)),v,saturation); //color saturation
	fragColor = vec4(v*.01,1.);	
}

Real programs from Software Heritage

4 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
mixTexture.vs · 362 B · ext .vs · seen 32× in SWH
via fallback
swh:1:cnt:7ff5f606d7528032b44eceeea1e58e135d81ab9e;origin=https://github.com/leguiart/ProyectoCGA;anchor=swh:1:rev:88f2e4ce5d1a143819e79074175f83773e99e15c;path=/Shaders/mixTexture.vs
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
#version 330 core
layout(location=0) in vec3 in_position;
layout(location=1) in vec3 in_color;
layout(location=2) in vec2 in_texCoord;

out vec3 ex_Color;
out vec2 ex_texCoord;

void main(){
    gl_Position = vec4(in_position, 1);
    // Just pass the color through directly.
    ex_Color = in_color;
    ex_texCoord = vec2(in_texCoord.x, 1.0 - in_texCoord.y);
}
envobject.geom · 1397 B · ext .geom · seen 7× in SWH
via fallback
swh:1:cnt:0ccd6f17316e570dbec2bb45e805649907925d71;origin=https://github.com/kavika13/overgrowth-scripts;anchor=swh:1:rev:8538f3b53a2d51f2afb466c0d1217d71dc4ee80e;path=/Data/GLSL/envobject.geom
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
#version 400

layout(triangles) in;
layout(triangle_strip) out;
layout(max_vertices = 256) out;

uniform float time;
uniform mat4 projection_view_mat;

in vec2 frag_tex_coords[];
in mat3 tan_to_obj[];
out vec2 frag_tex_coords_fs;
out mat3 tan_to_obj_fs;

#define USE_GEOM_SHADER

void AddVert(vec3 bary, float height){
     gl_Position = projection_view_mat * (inverse(projection_view_mat)*(gl_PositionIn[0] * bary[0] + gl_PositionIn[1] * bary[1] + gl_PositionIn[2] * bary[2]) + vec4(tan_to_obj[0]*vec3(0,0,height),0));
     frag_tex_coords_fs = frag_tex_coords[0] * bary[0] + frag_tex_coords[1] * bary[1] + frag_tex_coords[2] * bary[2];
     tan_to_obj_fs = tan_to_obj[0] * bary[0] + tan_to_obj[1] * bary[1] + tan_to_obj[2] * bary[2];
     EmitVertex();
 }

void main()
{
   for(int i = 0; i < gl_VerticesIn; i++)
   {
     gl_Position = gl_PositionIn[i];
     frag_tex_coords_fs = frag_tex_coords[i];
     tan_to_obj_fs = tan_to_obj[i];
     EmitVertex();
   }
   EndPrimitive();

   for(int i=0; i<8; ++i){
    for(int j=0; j<8; ++j){
        float x = (i)/8.0;
        float y = (j)/8.0;
        vec3 pos;
        pos = mix(vec3(0,0,1), vec3(1,0,0), x);
        pos = mix(pos, vec3(0,1,0), y);
        pos[2] = 1.0 - pos[0] - pos[1];
        AddVert(pos, 0.0);
        AddVert(pos+vec3(0.05,0.0,-0.05), 1.0);
        AddVert(pos+vec3(0.1,0.0,-0.1), 0.0);
        EndPrimitive();
    }
   }

}
shd_solid_color.vsh · 182 B · ext .vsh · seen 3× in SWH
via fallback
swh:1:cnt:301769c94296606ad68f37e78cfcecdb99d31abb;origin=https://github.com/DragoniteSpam-GameMaker-Tutorials/Bombadier;anchor=swh:1:rev:a7fbbe5b5159b162d516536ccd992900dfc06ae2;path=/shaders/shd_solid_color/shd_solid_color.vsh
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
attribute vec3 in_Position;
attribute vec3 in_Normal;
attribute vec4 in_Colour;

void main() {
    gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(in_Position, 1.0);
}
specular_static.vsh · 1327 B · ext .vsh · seen 2× in SWH
via fallback
swh:1:cnt:3aa207b1a3db58d7035820467fd9ea9767031405;origin=https://github.com/romanalexander/jedi-academy;anchor=swh:1:rev:d5ee0a8fc6a1fbb7f655f67485bea0f7345a6e50;path=/code/x_shaders/specular_static.vsh
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
;------------------------------------------------------------------------------
; Vertex components (as specified in the vertex DECL)
;    v0  = pVertex[i].p
;    v1  = pVertex[i].n
;    v2  = pVertex[i].t0
;    v3  = pVertex[i].basis.vTangent;
;------------------------------------------------------------------------------
xvs.1.1

#include "../win32/shader_constants.h"

#pragma screenspace

; Transform position for world, view, and projection matrices
m4x4 oPos, v0, c[CV_WORLDVIEWPROJ_0]

; Multiply by 1/w and add viewport offset.
; r12 is a read-only alias for oPos.
rcc r1.x, r12.w
mad oPos.xyz, r12, r1.x, c[CV_VIEWPORT_OFFSETS]

; Generate binormal vector
mov r7, v3
mul r8, r7.yzxw, v1.zxyw
mad r8, -r7.zxyw, v1.yzxw, r8	

; Get the light vector
mov r10, c[CV_LIGHT_DIRECTION]

; Move the light vector into tangent space
; Put into T1
dp3 oT1.x, r10, v3
dp3 oT1.y, r10, r8
dp3 oT1.z, r10, v1	

; Get the vector toward the camera
mov r2, -c[CV_CAMERA_DIRECTION]	

; Get the half angle
add r2.xyz, r2.xyz, r10.xyz

; Normalize half angle
dp3 r11.x, r2.xyz, r2.xyz
rsq r11.xyz, r11.x
mul r2.xyz, r2.xyz, r11.xyz

; Move the half angle into tangent space
dp3 oT2.x, r2, v3
dp3 oT2.y, r2, r8
dp3 oT2.z, r2, v1

; Move the bump map coordinates into t0
mov oT0.xyz, v2

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.gs/0.gspredicates[{"kind": "any", "regexes": ["^#version\\s+[0-9]+\\b"]}]
h/linguist/.fs/2.fspredicates[{"kind": "any", "regexes": ["^\\s*(#version|precision|uniform|varying|vec[234])"]}]

Contribute — propose a file extension

Tell us where to find evidence about OpenGL Shading Language (mapped to pl/glsl). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/OpenGL Shading Language/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← opengl opengraph →