Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [glsl]

A programming language for OpenGL shaders.

0
votes
0answers
28 views

Strange GLSL performance problems

I'm having weird performance problems with a GLSL shader I'm working on. This small example fragment shader: ...
1
vote
1answer
72 views

OpenGL Lines between triangles?

I'm currently using marching cubes to generate a mesh, and have encountered this incredibly weird problem. Looking from below the terrain, these weird fully lit lines appear between every triangle. ...
0
votes
0answers
20 views

GLSL Atomics With Floats

I am implementing SDSM and in a GLSL compute shader I need to min/max vec3 values to compute the shadow map bounds. The sample implementation (in HLSL) uses vectors in "light space" that spans from 0-...
1
vote
1answer
50 views

C++ OpenGL texture warping

I'm currently doing simple 3D drawing in OpenGL but I have hit a roadblock I just can't seem to get around. The problem is happening with trying to load .obj files. I've written my own .obj reader. I ...
2
votes
1answer
43 views

How would I rotate my billboards parallel to the camera view?

I'm trying to make my own space-sim in Godot and I'm stuck trying to get the visuals of the "starfield"-effect that is a staple of the genre. I'm using a Particle system with billboards that would be ...
0
votes
1answer
41 views

Texture Glitches When Drawn to Quad

Recently been trying to implement volumetric lighting. The alphaness texture comes out perfectly on Renderdoc, however a strange glitch occurs whenever I either try to directly render the texture ...
0
votes
0answers
30 views

How to reproduce examples from ShaderToy on my computer?

I am a beginner with computer graphics. I have some experience with drawing polygons, shaded surfaces, the use of geometry shaders, etc. I am trying to create a volumetric cloud/volume render shader ...
0
votes
1answer
40 views

Getting solid black color when texture is added to GLSL

I'm trying to apply the default badlogic.jpg image to a .obj I have. I'm currently loading the texture from AssetManager and creating a material with a texture ...
0
votes
1answer
34 views

Convey screenspace bounding box of rendering result

Imagine I render to an FBO some arbitrary geometry. Geometry can be rendered via single or multiple draw calls. For the sake of the question, assume I know nothing about geometry or transformation ...
0
votes
0answers
25 views

Calculating UV Coordinates in domain shader

Dears, I was trying to implement the terrain tutorial in Introduction to game programming by frank luna. I succeeded to implement it using the effect file. When I try to separate the Vertex, hull, ...
0
votes
0answers
57 views

Show the edges between the clipping plane and clipped objects

I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection. My fragment shader currently does something ...
0
votes
2answers
92 views

Raymarching signed distance function resulting in holes on surface - step size required?

I've been learning about raymarching and signed distance functions, and I implemented a raymarching fragment shader in Unity. It works fine for geometric shapes such as cubes and spheres, but when I ...
0
votes
0answers
57 views

Making a weapon stay with a first person camera

I was looking all over the internet for any information on how to get a gun to stay with a camera as done in FPS games. I am using OpenGL and GLSL to carry this out. I knew a way of how to do this ...
1
vote
1answer
63 views

How to render animated models via instanced rendering?

I have an animated model with a maximum of 60 bones. That means i have an array of 60 matrices when i want to render the model. Previously i would just create a uniform with the fixed size (mat4[60]), ...
0
votes
1answer
76 views

Normal Matrix in plain English

I'm into shader language with Webgl and GLSL. I've seen some tutorial about normal matrix and I don't really understand it. I mean, I think I'm ok with the math such as: ...
0
votes
0answers
83 views

OpenGL seamless repeated texture has artifacts on edges

I'm currently trying to map a seamless texture onto a 3d wall object but when it comes to the edges of the texture there are visible artifacts. closeup: Here is the shader code i use for the texture ...
2
votes
1answer
68 views

Planet Surface Rendering: Precision issues [duplicate]

I have been experimenting with C++ and OpenGL, and I am currently writing a program that renders the surface of a planet; specifically, our moon. It's a modified version of the GPU Gems implementation ...
0
votes
0answers
56 views

How to stack shaders in Godot?

I have a CanvasLayer singleton that I am using for transition effects between scenes in my game. This CavasLayer contains a ...
0
votes
0answers
35 views

Specular/Diffuse light on an icosahedron opengl

I'm having a problem with my model here. I draw an icosahedron using GLUT, and the edge length is set to 0.8. The info of the coordinates are listed below: (X and Z are calculated since our edge ...
0
votes
0answers
21 views

How to align a particle billboard to the floor of the world

I'm using https://github.com/squarefeet/ShaderParticleEngine and THREE.js to manage particles in my scene. I have a special case where some particle emitters need their particles to align to the ...
0
votes
0answers
21 views

combine two translation/rotation/scale triplets without matrices

Let t1/2, r1/2 and s1/2 be two sets of transformations. Translations are vec3, rotations are quaternions and scales are vec3. Lets assume that all common operations are defined (overloaded operators ...
0
votes
0answers
42 views

About uniform block alignment

I am working on a project need programming in GLSL, and new to this. I need create a uniform block holding members of scarlars, vectors, matrices and structures. I read the guideline of uniform block ...
0
votes
1answer
34 views

TBN matrix for normal and parallax mapping

I'd like to refer to this question because I didn't completely answer to my problem. I've implemented normal and parallax mapping but because of some assumptions I have to use two different TBN ...
0
votes
0answers
26 views

GLSL and normal mapping

I'm trying to implement normal mapping on my existing shaders, but I'm definitely doing something wrong, probably related to the TBN matrix. The point is, while drawing two perpendicular walls with ...
0
votes
0answers
25 views

The Raycasted plane (surface) ascend or descend with my camera

I would like to be able to draw an infinite plane in order to do multiple FX (such as a fog floor) later. I used the following shader that works except that the plane (surface) seems to follow my ...
0
votes
0answers
76 views

How I can create HQx or xBR pixel art upscaling shader in GLSL?

I want to make an image scaling shader in OpenGL Shader Language... but I have no idea how to make it. I want to implement either the HQx algorithm or an xBR variant. My game engine is GameMaker: ...
1
vote
1answer
80 views

Shadow artifacts/acne on block intersections

This is using the default shader and depth shader from LibGdx. It creates lines at the blocks intersections. This is what I use to create the blocks models for now: ...
0
votes
0answers
54 views

OpenGL outline of clip plane

I've implemented a clipping and capping view similar to the example called "simplecap.zip" in this page: http://users.polytech.unice.fr/~buffa/cours/synthese_image/DOCS/trant.sgi.com/opengl/examples/...
1
vote
0answers
24 views

Problem generating multiple shadow maps in a loop

I've successfully implemented shadow mapping for a specific direction as you can see in the image below: Now I want to do omnidirectional shadow mapping but without using a cube map. My first step ...
1
vote
1answer
340 views

My Single Pass Gaussian Blur Looks Awful

I've based my shader on this single pass shadertoy here: https://www.shadertoy.com/view/XdfGDH I applied the same shader and it looks like this: Scaled up so you can see the faint tears in the ...
1
vote
0answers
64 views

How can switch GLSL “version #120” to “version #330”?

I am using GLSL "version #120" and i want to change it with "version #330". I added "GLM" library for this purpose. But i have some problems. Therefore i will ask you what is equal to this setting ? ...
0
votes
1answer
58 views

Can I use glTranslate and glRotate when my GLSL Version over (#version 120)?

I was using "GLSL Version #120". But now i am trying to do one tutorial and it is using "gl_ClipDistance[0]" inside of vertex shader. And "GLSL Version #120" doesn't support "gl_ClipDistance[0]". Now ...
0
votes
1answer
79 views

Frame Buffer Object (FBO) is not working. What is the right way to use?

I am trying to use FBO but i am living some problems. I will show you my steps but first i will show my running screen ,so we can compare them. Like before fbo after fbo. My running screen and Draw() ...
1
vote
0answers
49 views

Artefacts in SSAO Shader

I am having trouble with my Screen Space Ambient Occlusion shader. The objects in the game have the correct occlusion applied to them, however the occlusion flips depending on the angle of the camera:...
1
vote
1answer
179 views

How do I make my glsl RGB displacement map look like this

I want to use a RGB texture as described in this video here. Here is my texture so far. The author says the first line has no R channel and ranges from B = 0 to B = 255. While each other line has R ...
0
votes
0answers
60 views

How to create a shader for this hue change effect?

In this cut scene from Shovel Knight, the individual pixel art tableaux don't merely fade in and out. Rather, they fade in and out as well as undergo various hue changes. Here's an example: The ...
1
vote
1answer
148 views

Noise when using SSLR (Screen Space Local Reflections)

When I tried to apply reflections to my scene, I ran into the problem of noise: My fragment shader code: ...
1
vote
0answers
69 views

Grass swing/shake effect in 2D game

I want to make the grass swing/shake whenever the player walk through it. Like shown in this gif Grass Swing Effect from this article. I know I have to move the x coordinates of the vertices factored ...
0
votes
1answer
82 views

How can I reduce the amount of GLSL code written?

I am writing a game engine for Linux. It has a sufficiently large number of effects that can be turned on / off. Effects are defined before compiling with #ifdef. ...
1
vote
1answer
246 views

Rendering clouds similar to Sky: Light Awaits?

I'm interested in adding clouds to my game, with a style similar to those in Sky: Light Awaits You can see them in motion in these videos: (Starts at 26:00) https://www.youtube.com/watch?v=...
3
votes
1answer
330 views

How to implement a pixelated screen transition shader?

I am interested in creating a screen transition seen in a lot of retro games. The transition is just a kind of pixelated distortion that increases or decreases in granularity over time. The effect is ...
0
votes
1answer
123 views

Create a white background for the texture and then blend using GLSL

I have a transparent png texture and I'd like to create a white background and then blend this on top of that. Is this possible using just GLSL? I can't multiply, add or mix colors because I don't ...
-1
votes
1answer
148 views

Help with dual quaternion skinning

I'm trying to convert my code to use dual quaternion skinning instead of matrix skinning because i just can't get the skinning matrix created correctly from bones+weights using matrices. Edit: just ...
0
votes
2answers
145 views

Rotating a Quad in Shader

I'm working Opengles2 and I have a just a texture ID and a quad from an SDK and its shader, and I can not access their code, just the vertex and pixel shader. The quad from the SDK is rotated and ...
0
votes
1answer
43 views

GLSL Shader compiles, but source is empty

I'm trying to compile a GLSL shader, to which I use the following code. Initialization ...
0
votes
1answer
62 views

GLSL - Efficient Point inside Box Check

I'm attempting to improve the performance of a shader that changes the colour of a region of the world that is inside a "zone". I am using a deferred lighting system, so the colour and world-space ...
1
vote
1answer
134 views

OpenGL Deferred Shading Pixelation

I'm working on a 3-pass deferred lighting system for a voxel game, however I am having problems with pixelated lighting and ambient occlusion. The first stage renders the color, position and normal ...
1
vote
1answer
45 views

How to implement multicolored flashing sprite effect like in Contra and the Messenger?

I want to implement an effect similar to what you see in this clip of Contra. When the boss takes damage, he flashes wildly with different colors. A similar effect can be seen in this clip from the ...
0
votes
0answers
54 views

UV flipped in parallax mapping

I'm attempting to implement parallax mapping using the following shader pair in a deferred renderer, but as you can see in the attached image, the vertical shifting of uv coordinates for sampling is ...
1
vote
1answer
55 views

Why does my terrain texture fail to load? (OpenGL)

I'm currently using a vertex shader and a fragment shader for loading my texture onto the terrain I made. Here is my vertex shader ...