A programming language for OpenGL shaders.

learn more… | top users | synonyms

0
votes
1answer
48 views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen but an unable to using the Projection, View and Transformation Matrix's but an unable to get anything to the screen. Main loop ... ...
1
vote
0answers
88 views

How to “hot-reload” a glsl shader

I am wondering if its possible to dynamically change shaders while the code is running. In my game, I want to have a development mode in which users can change the shader source and dynamically see ...
3
votes
1answer
120 views

Trying to implement forward rendering in OpenGL

I'm working on implementing forward rendering in my 2D engine, as far as I'm aware everything should be set up correctly, I've ran into some issues earlier but I'm sure I've fixed those at this point. ...
1
vote
2answers
40 views

Generating face normals with the geometry shader

I'm trying to visualize the face normals for a mesh, using the geometry shader to generate lines represeting the normal vectors. My intention was to draw that line from the triangles centroid, ...
0
votes
1answer
43 views

drawing of heightmap gives weird single pixels

I'm working on a game where I want to generate a heightmap, however it draws a bunch of random white dots in a mostly black background, the function I have looks as following: void heightmap::layer1(...
0
votes
2answers
30 views

What does this shader error in Löve2D mean?

What could I've done wrong to get the following error message when trying to create a GLSL shader in Löve2D? I'm sincerely clueless of what the mistake could be, though I suspect the error being a ...
0
votes
1answer
38 views

Single pass box blur is not giving same result as double pass box blur

I've been using 2-pass box blur written in GLSL in Blender without problem. Blur horizontally: uniform sampler2D bgl_RenderedTexture; void main() { float blur = 0.3; float resolution = ...
1
vote
0answers
15 views

Simple coherent noise function to use in a GLSL shader

I'm looking for a simple (but especially fast) coherent noise function to use it in a shader written in GLSL. I don't need it to be excessively smooth or good looking, I just need that it has the ...
4
votes
1answer
276 views

deferred tiled lighting

EDIT I have discovered that it does not seem to be the lighting calculation but the culling code because when i draw the lights without the culling it works perfectly. I have been attempting to ...
1
vote
1answer
73 views

GL uniform variables

I have been studying on glsl lately, starting from very simple vertex and fragment shaders creation for Blender3d, I was quickly drawn to writing the OpenGL context in C++. I find it difficult to ...
0
votes
1answer
94 views

Transforming normals along with vertex? (GLSL)

So, I got a model matrix (Via uniform variable) in the shader, is there any way to use the model matrix to transform the normal of a vertex that has been transformed with glm::transform/rotate? If ...
0
votes
1answer
538 views

Will Vulkan Kill the use of GLSL? [closed]

After reading this link I am still unclear as to the shading language support in Vulkan. As Vulkan only supports SPIR-V is it the case that GLSL is therefore being phased out? Are there any ...
0
votes
1answer
410 views

Transparency in GLSurfaceView

I'm new in game development. I have a view using GLSurfaceview and call in MainActivity. i want to make transparent that view. i have tried setZOrderOnTop() method in MainActivity and glClearColor() ...
1
vote
1answer
44 views

texelFetch weird behavior

I am writing an isometric game engine on OpenGL (version 3.3 specifically). For each wall tileset i have volume mask tileset for the wall relative volume coordinates. Volume mask looks like this: ...
2
votes
1answer
311 views

Trying to implement Camera

I'm trying to implement a Camera class in order to walk and look on the world as follow: #ifndef _CAMERA_H_ #define _CAMERA_H_ #include <glm\glm.hpp> class Camera { public: Camera(); ~...
1
vote
1answer
597 views

OpenGL Tessellation makes point

A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points. Here's my vertex shader : out vec4 ecPosition; out vec3 ecNormal; void ...
4
votes
0answers
45 views

Environment mapping without cubemap (need coordinates projection)

I'm working on a project with C++ and glsl (4.1). I have implemented a mirror object which is a plane at height 0 that works as follow: I render the scene with a MVP computed such that the camera ...
9
votes
1answer
154 views

Screen tearing in fragment shader on R9 380 GPUs

two players are encountering an issue with my game where the screen is tearing when it uses a fragment shader but it only seems to be doing this for players with a R9 380 GPU. Here is what it looks ...
1
vote
1answer
81 views

Strange artifacts when using gl_FragCoord to access texels

I ran into a problem with using gl_FragCoord variable to access texels. The problem can be illustrated by following example: First I render a textured quad into texture of size (W, H) where W and H ...
0
votes
0answers
200 views

Artifacts rendering high-poly procedural meshes with OpenGL

I am having some issues when rendering some procedural generated meshes. There are some really wierd artifacts when rendering high-poly count meshes (not that much actualy). I have been able to ...
0
votes
0answers
28 views

Blur shader decals

Im trying to implement custom shader for decal GroupStrategy in libgdx, and I'm having some noob GLSL and OpenGL problems. I have implemented shader looking at this: http://xissburg.com/faster-...
0
votes
1answer
49 views

GLSL - Only draw arond point / flashlight effect

I'm currently trying to achieve a sort of flashlight effect in GLSL. I only want to draw textures within a certain distance of a specified point (the mouse position, for example). Here's a quick ...
1
vote
1answer
45 views

Shader only rendering 1/4th of the screen

I've asked the same question on SO here and they suggested I should ask here instead. I'm currently trying to create a gaussian blur shader, and while I've successfully created the blur effect my ...
0
votes
1answer
26 views

GLSL uniform array with size set by another uniform

Will the follwing GLSL code work? #version 330 uniform int size; uniform float[size]; void main() { //do something }
6
votes
1answer
395 views

How is Signed Distance Field Ray Marching implemented for a dynamic world?

I think I understand the basics of Signed Distance Field Ray Marching. You model your scene with a bunch of distance fields (such as these: http://iquilezles.org/www/articles/distfunctions/...
1
vote
2answers
57 views

OpenGL [LWJGL3] - Matrix4x4 not rotating correctly

I tried today to make my own matrix4f class because of that LWJGL 3 does not include a class for it. So I arrived at rotation and it does not seem to work. I tried using the old util from LWJGL 2 and ...
1
vote
0answers
26 views

Logical operations per component in GLSL

According to the OpenGL spec in GLSL, the logical operators: &&, || etc work between booleans, not vectors of booleans. So, what is the best way to perform the logical and/or per component in ...
0
votes
1answer
91 views

Making a GUI shader in GLSL c++/opengl/freeglut

How do you make a shader that will draw ontop of everything else? Im using an approach where I draw square faces in 3d space to simulate a 2d box, but when I make a 3d object, it will clip over the 2d ...
1
vote
2answers
62 views

How to optimize this branching instruction?

I have an outline shader, which samples my texture 8 times to compute the outline. The problem is, that there's transitional alpha values between picture and background. To cut them off I'm using the ...
0
votes
1answer
53 views

OpenGL is box blur this slow?

I've never tried blur until recently, and by that i've noticed fps drop when doing box blur. My fps will go down from 4000-5000 fps to 1000-1500 fps. Currently rendering at 853x480 frame buffer and ...
1
vote
1answer
1k views

OpenGL Shader Storage Buffer Objects array length problem

Ok guys, I think I have a very strange problem. I have an old laptop, but its HD 6370M currently supports opengl 4.4, so i decided to learn how to use some new features of this platform, so after ...
3
votes
1answer
160 views

How do 2D volumetric lights work?

Context So in my current project (written in Java using LWJGL / OpenGL, so GLSL for shaders) I added lighting quite a few months ago, which was already an interesting challenge, having never done ...
0
votes
0answers
27 views

Inverted FXAA Shader

I'm trying to use an existing FXAA shader which works but when I try to run it the filtered image is inverted. http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-...
0
votes
0answers
54 views

vertex shader doesn't work properly

Linux, OPenGL 3.0, GLSL 130 (Intel card) I'm learning OpenGL and successfully rendered a triangle, but as soon as I create the matrix of projection I get an error. The shader compiles and works ...
0
votes
0answers
22 views

Skin Mesh Animation Shader Issue

I'm having troubles with properly animating a skin mesh from an .fbx file. I feel like the issue is in the shader, but not sure what is going on. All I know is that I am getting unexpected results ...
25
votes
1answer
19k views

in/out keywords in GLSL

I don't really understand how to use the in / out keywords in GLSL, and google is being uncharacteristically unhelpful. What exactly do they do? How would I use them if, for example, I want to pass a ...
0
votes
1answer
59 views

Invalid GLSL on some machines

I'm writing a game engine using OpenGL 4.3 using gcc 5, mainly to teach myself graphics programming. Initial development was on my Surface Pro 3 using mingw-w64 and worked like a charm. I've decided ...
0
votes
1answer
85 views

Black Screen when using High-Performance NVIDIA Processor

I have an issue where my program renders a black screen on other computers. I narrowed it down to when a different graphics card is being used. When I run the program using Integrated Graphics (...
1
vote
1answer
61 views

Solution for Shipping Optimized and Minified GLSL?

I've tried to find a reputable optimizing compiler for GLSL that takes source shaders, performs what optimizations it can statically assume, and outputs a minified GLSL file with optimizations, ...
2
votes
1answer
463 views

2D Hidden Object Silhouette Shader

Right now I am not using any depth information in my engine, but I just found out that it would be neat to be able to render the silhouette of important game objects that are "behind" something with a ...
4
votes
1answer
2k views

Problems implementing a screen space shadow ray tracing shader

Here I previously asked for the possibility of ray tracing shadows in screen space in a deferred shader. Several problems were pointed out. One of the most important problem is that only visible ...
1
vote
2answers
53 views

OpenGL strange color issue

I recently made terrain generation for my game, and I created a lighting system (simply diffuse lignting), but there's a strange problem around the edges. I know, OpenGL interpolates the different ...
0
votes
0answers
55 views

How to properly use a 3D texture in OpenGL 4?

I working on a student project which consists to make clouds volumetric rendering and implement the feature in an existing engine based on OpenGL 4 and written in C++. To do so, I have set a compute ...
2
votes
0answers
61 views

GLSL shader with light colors wrong on nvidia optimus

So, I built some code to draw a spinning cube with a red light on the right side, and a blue one on the left. I run it on my laptop with optimus graphics, and on my desktop with nvidia. On the laptop, ...
3
votes
0answers
186 views

Schlick Fresnel Shader

I hope you are all doing ok. I have an issue with my Fresnel shader that doesn't allow the Fresnel to change as my camera moves around. I'm not sure what i'm doing wrong. I'm using glsl with the ...
2
votes
0answers
54 views

Physically-based BRDFs

I'm starting to implement a real-time PBR shading pipeline in one of my projects and had a few questions that I thought folks around here could help clarify. 1) Is it fair to say that in a PBR ...
0
votes
1answer
60 views

GLSL Shader not compiling (Android & LibGDX) and no log available

I'm trying to get a "ripple"-shader working for OpenGL ES 2.0+ (using LibGDX). However, I can't get it to compile, and for some reason ShaderProgram.getLog() returns an empty string even though the ...
1
vote
2answers
219 views

Unity, shader, vertexID

I'm writing a shader and I just wanna ask if it's possible to get the ID of the vertex that is currently being manipulated. I read something about gl_vertexID, but I couldn't find out if that is ...
1
vote
1answer
115 views

GLSL strange if statement problems

I'm trying to use if statement in my fragment shader. I want to compare my in int finalLightType[4]; Here is my vertex shader code and fragment shader code: Vertex: #version 400 core in vec3 ...
0
votes
1answer
82 views

Projection Matrix Breaks My Rectangle

This is my vertex shader, shown below. #version 330 core in vec3 a_position; in vec4 a_colour; // FOV = 70, near plane = 0.1, far plane = 1000 const mat4 u_projection = mat4( 1.428148, 0.0, 0.0,...