Questions tagged [glsl]

The GLSL tag is for questions that contain code written using the OpenGL Shading Language. GLSL is a high-level shading language based on the syntax of C. It was created by the OpenGL ARB (OpenGL Architecture Review Board) to give developers more direct control of the graphics pipeline without having to use assembly languages or hardware-specific languages.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Basic GLSL fragment shader with palette lookups and palette shift

I am remaking an old game, which animates water by rotating its palettes over time. I have written a basic fragment shader to replicate this behavior. It checks which color we are trying to render, ...
Dan's user avatar
  • 341
0 votes
0 answers

"Smoothing" colors in mutliple-color gradient in fragment shader

TL;DR How to better avoid some of the colors in the gradient looking like brighter/darker lines and make them blend in with neighboring colors. Not too concerned with performance/color accuracy but ...
Vlad L's user avatar
  • 101
1 vote
1 answer

GLSL atomic float add for architectures with out atomic float add

Krupip's user avatar
  • 631
1 vote
1 answer

OpenGL Shader Loader in C++

I made my own custom OpenGL shader loader for C++. Please tell me is I'm doing anything incorrectly or anything to improve on. I've tested this and it works perfectly fine. ...
Desmond Rhodes's user avatar
8 votes
1 answer

tiny mandelbrot

When I first got the idea for creating a tiny mandelbrot renderer I knew It would be possible since people having creating tiny demos for a while and that I would probably use a shader. However at ...
nullptr's user avatar
  • 669
7 votes
2 answers

2D Real-Time Ray-tracing

I've written a 2D ray-tracer in GLSL ES for GameMaker for dynamic lighting. I've also written a blog post on how it works... though it is out-dated. I am looking to have JUST my shaders reviewed to ...
FatalSleep's user avatar
2 votes
1 answer

Convert an integer to 4 bytes without bitshift operators

This code is applicable to either GLSL or C due to virtually identical syntax. Before GLSL 1.3, bitshift operators were not present and I am aiming for backwards compatibility to GLSL 1.2. ...
J. H's user avatar
  • 179
3 votes
1 answer

GLSL Shader that displays a Rotating Rainbow Ring

I'm learning GLSL shaders on Book of Shaders and I decided to mess around with one of the examples. I wanted to see, whats a more efficient way to calculate to mask out the color? ...
Roy's user avatar
  • 33
5 votes
0 answers

3D FPS Camera in OpenGL

So I've got a basic FPS camera working which can move around the 3D space. Having trouble with physics but thats not why I'm here! So the code below creates a scenegraph which contains torus model ...
rshah's user avatar
  • 151
3 votes
2 answers

GLSL function used to differentiate between pixels above/below a line

I've recently acquired a program which is capable of using a GLSL fragment shader as a plugin. After a short amount of experimentation, I've realized that - for my use-case - I desperately need a ...
Conduit's user avatar
  • 203
9 votes
2 answers

OpenGL 3 Mandelbrot Set

I've written a short program to learn about computing with drawing using OpenGL 3. To do so, I created a program to create two triangles, which form a quad, and pass all the arguments for computing ...
theoden8's user avatar
  • 329
3 votes
1 answer

Drawing a colored rectangle on-screen

I have made my first program that draws a colored rectangle on-screen. I want to know the best practices of making OpenGL and GLSL programs. ...
MORTAL's user avatar
  • 3,278
6 votes
2 answers

2D OpenGL tile atlas fragment shader

I am currently using the following glsl code to retrieve separate textures from a tile atlas: ...
Oliver Barnwell's user avatar
2 votes
1 answer

YUYV OpenGL Fragment Shader

I made a shader to display a YUYV surface (data arranged as: Y0 U0 Y1 V0). It's working, but I don't know anything about shaders, or openGL, or anything graphic related as a matter of fact. I feel ...
Jonathan Drolet's user avatar