Stack Exchange Network

Stack Exchange network consists of 174 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
17 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
12 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
33 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
0answers
15 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
23 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
23 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
25 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
69 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
21 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
21 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
votes
0answers
48 views

Good way to dynamically set uniforms during rendering (C++)

I'm trying to create a renderer generic enough so that it can dynamically set uniforms for a variable number of shaders. For instance, say mesh A uses shader A; mesh B uses shader B. "shader A" ...
1
vote
1answer
60 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
votes
0answers
27 views

can i use smooth normals and normal mapping together?

I am trying to use smooth normal and normal mapping together. And I made a test. In this test I draw a cube and man. They are using same vertex shader and fragment. I load them same md5loader ...
1
vote
0answers
38 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
41 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
54 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() ...
0
votes
0answers
39 views

Explanation Morgan's McGuire Screen Space Ray Tracing method

I tried to implement the Morgan's McGuire method, but my attempts failed. He described his method here: Screen Space Ray Tracing. Below is my code and screenshot. SSLR fragment shader: ...
-1
votes
0answers
21 views

How to debug glsl shaders on AMD

I have a glsl project which runs without any errors on nvidia, not on AMD cards it fails on glUseProgram no errors come up in shader compilation or linkage, even ...
1
vote
0answers
39 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
150 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 ...
-1
votes
0answers
58 views

Is the GPU's texture memory cache cleared when reading from multiple textures?

I have been reading lately about the memory layout of graphics cards and the issue with dependent texture reads. I am worried about the efficiency of the way I use framebuffer textures. Initially I ...
0
votes
0answers
53 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
58 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
60 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
0answers
40 views

How can I use bump map and fog in a shader at the same time?

I've been following a tutorial from someone named "thecplusplusguy" on YouTube. He showed how you can use shaders to emulate fog with OpenGL but when I tried to incorporate what he did in my bump ...
0
votes
1answer
81 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
155 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=...
2
votes
1answer
173 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
39 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
85 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 ...
-1
votes
0answers
54 views

Weird behaviour of glsl with fragment, vertex and geometry shaders

I am a beginner in developing games. I started some time ago with OpenGL and the glsl language. These days I am having so many problems and for me it is too difficult to solve, because the shaders are ...
0
votes
2answers
68 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
38 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
51 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
84 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
42 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
43 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
44 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 ...
0
votes
1answer
53 views

Glow effect shader for mesh generated at runtime

I'm using the leap motion-paint module and i would like the ribbons that are generated at runtime to have a glow effect, I tried editing the existing shader by adding a glow property but the colors ...
0
votes
0answers
41 views

Ambient Occlusion Rendering

I'm having a weird issue with rendering ambient occlusion. There seems to be a screen space split that inverts the ambient occlusion. Here is what my issue looks like SSAO Image my SSAO shader ...
1
vote
0answers
60 views

GLSL to Spir_V using GLSLang

I have been working with GLSLang to convert between GLSL and SpireV for the purpose of run time shader compilation. GLSLlang compiles my shader code and I can successfully create and run a compute ...
1
vote
1answer
179 views

How to access an uniform array with a float as index in GLSL?

I'm trying to do basic multitexturing of terrain in OpenGL. Im building the terrain with an image representing different elements (beach, water, jungle...) : Im trying to map each color of this ...
0
votes
2answers
285 views

Correctly transforming normals for G-Buffer in Deferred Rendering

I have a deferred rendering system: first there is the G buffer generation, then there is the lighting or shading calculation on that gbuffer data. However there seems to be an issue with various ...
0
votes
1answer
104 views

Tangent space normal mapping visual problem along UV islands (using Vulkan)

I'm learning Vulkan and computer graphics. First time implementing normal mapping. I've been struggling with this for days now and I can't seem to find the problem - so that's the question. What is ...
0
votes
0answers
33 views

Define GLSL shader version in LibGdx

I'm using libgdx 1.7.1 and I need a higher version for a shader, but when I define a version using #version I get this error: ...
1
vote
1answer
127 views

Day/Night cycle with GLSL - blend from one colour to another along Sin curve

I am attempting to implement a day/night cycle using a GLSL fragment shader in a 2D game i'm developing in SFML. I am a novice with shaders with this one being my first. Currently I am using a ...
1
vote
1answer
36 views

Wrap texels between desired values

I'm using a basic pixel shader here ...
0
votes
1answer
67 views

Why is clip-space 3 dimensional?

A vertex shader is basically a transformation function that converts a vertex in your world space to a space that can be rendered on screen. Since the screen is a 2 dimensional surface whats the ...
1
vote
1answer
512 views

How to create a 2D fog shader?

I am trying to write a fragment shader in GLSL for a fog effect in a 2D game. Here are some links showing what I'm after. Here the fog is in the foreground and near the ground: https://twitter.com/...
0
votes
0answers
103 views

Rendering model shading to frame buffer/texture for use on another model

I'm currently working on a game with a pixel-art style, but the visuals are accomplished by rendering 3D voxel-style meshes at an angle. Now I would like to add sub-pixel animation to the models by ...