A programming language for OpenGL shaders.

learn more… | top users | synonyms

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 ...
4
votes
0answers
90 views

Raymarching tangents

I've recently started to experiment with raymarching over on shadertoy.com. It seems common to find the normal for a distance field like so: vec3 scene_normal(vec3 p) { vec3 e = vec3(0.001, 0.0, ...
4
votes
0answers
269 views

How much is atomicAdd slower than an atomic counter?

I am considering replacing an atomic counter in my shader code with a SSBO an atomicAdd operation. What I need to know is the difference in performance of these two. I know the atomic counter executes ...
4
votes
0answers
449 views

Ashikhmin-Shirley model implementation: ugly result

I am trying to implement the Ashikhmin-Shirley model using these formulas: This is the GLSL 1.2 fragment shader code: uniform vec4 materialAmbient, materialDiffuse, materialSpecular; uniform ...
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 ...
3
votes
0answers
54 views

Virtual infinite plane in shadow map

I have a WebGL deferred rendering pipeline, where I'm rendering shadow map with VSM technique. The goal is that the scene, or model, is hovering in space, and in addition to casting shadow on itself, ...
3
votes
0answers
113 views

OpenGL Planet Generation - Simple Matrix Issue (Planet “Spins” With Mouse)

I originally asked this question on StackOverflow & was directed here by a commenter. Im currently working on a OpenGL planet rendering. I'm using the Tessellation pipeline. So far things are ...
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, ...
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 ...
2
votes
0answers
93 views

Texture coordinates for custom geometry in SceneKit ios9

I am trying to texture the a custom plane shape I created in scenekit on iOS9. I need the texture to spread out and stretch over the entire surface. I have a vertex and fragment shader on an ...
2
votes
0answers
48 views

Consistent Shadow Map Filtering

I want to filter my shadow map generated by PSSM, but the problem is that I have a inconsistent filter size. The problem is that the shadow map sources rotate to find the best fit for the camera ...
2
votes
0answers
76 views

Understanding webgl min/mag filter texture artifacts in orthographic projection?

Summary Flickering and shimmering of image plotted on a geometry where the viewport exceeds the size of the screen. I am using an orthographic projection for the camera. In this case, it is tied to ...
2
votes
0answers
175 views

Texturing Objects in OpenGL

Using OpenGL tutorials found here, I constructed an .obj file loader as well as a texture file loader using SOIL. I have an issue with drawing a textured object. (Shown here) Assuming I created the ...
2
votes
0answers
348 views

Uniform Buffer Binding-points

I believe Uniform Buffers/Blocks has been the hardest thing to grasp in OpenGL. Hopefully this will be my final issue regarding this. I have created a uniform buffer that contain data of Light ...
2
votes
0answers
572 views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
2
votes
0answers
337 views

iPhone GLSL shader dynamic branching issue

I am trying to pass an array of vec3 as uniform and then iterate through them on each pixel. The size of array varies on situations so I can't make the loop with constant number of iterations. ...
2
votes
0answers
577 views

Per fragment lighting with OpenGL 4.x tessellated model

I'm experienced with OpenGL 3+. I'm dabbling with tessellation shaders and have now got to a point where I have a nicely tessellated teapot/plane demo (quick look here) As can be seen from the ...
2
votes
0answers
313 views

Full screen shader causes performance hit

I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting. To do this, I create a new bitmap each time the display resizes that ...
2
votes
0answers
319 views

Kinect User Silhouette Shader

I have this usermap from kinect's depth data (size is 320x280) and i want to display it on my game. The problem, of course it's ugly (first image) and i want to have beautiful effect like in the ...
1
vote
0answers
90 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 ...
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 ...
1
vote
0answers
27 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 ...
1
vote
0answers
69 views

Converting glsl shaders

I need to convert these shaders from #version 400 core to #version 130 successfully but for some reason when I do it my models are not rendering properly when I load more then one type and I cant find ...
1
vote
0answers
66 views

Set Render Target usage

I am using Unity and I have some difficulties about understanding the way Set Render Target works and how it can behave with the shaders. Is it possible to render a shader pass in multiple render ...
1
vote
0answers
45 views

glsl specular not working

ok, i'm a complete noob regarding shaders and all this, so i must be doing something really stupid, but i cannot get specular lighting to work. I've read a whole lot of different shaders on the ...
1
vote
0answers
376 views

Confused About My Code Suggesting The Normal Matrix Is Equivalent To The ModelView Matrix

I'm learning environment mapping in OpenGL by following this page. In his vertex shader, the author calculates the vertex normal in eye space with the following code: nEye = vec3(viewMatrix * ...
1
vote
0answers
182 views

glGetUniformLocation returns 23724032

as the title says, I have a problem using glGetUniformLocation call that returns, for the following code, the value 23724032. I'm writing a little engine and the draw function of my models is: void ...
1
vote
0answers
133 views

Blending Lightmaps and Dynamic Texture Shadows in HLSL/GLSL

I'm using Gile[s] as my lightmapper and my engine can execute GLSL/HLSL scripts. I would like to accomplish something like this for performance reasons. I was told that this technique can only be ...
1
vote
0answers
670 views

Is it reasonable to use a 2D texture as a lookup table in GLSL

I need a lookup table in a shader. The input values would be color values and the output other color values. Something like: uniform float lut[256]; color = vec3(lut[int(color.r*255.)], lut[int(...
1
vote
0answers
406 views

How to shade hair (line segments) correctly in GLSL

I render my hair geometry in line segments. The problem I have is with the correct shading of the hair. From what I've read I understood that I need the direction of the line segment and the ...
1
vote
0answers
261 views

Different way to pass uniforms to seperate draws in glMultiDrawElementsIndirect

Given OpenGL version 4.3 and GLSL 430, what would be the best way to pass a matrix to each model in a draw call to glMultiDrawElementsIndirect? I am thinking of going the way of a TBO and indexing it ...
1
vote
0answers
110 views

Texture not visible on particles

This is the first time I am working with particles (GL_POINTS) I am using kinematic equations and controlling their movement in vertex shader. I am following an example given in OpenGL 4.0 Cookbook ...
1
vote
0answers
380 views

How can I compute spotlight attenuation when I only have a spotlight cutoff angle?

I am trying to compute the spot light attenuation, though I don't have a spotCosCutoff (cosine of the spotlight cutoff angle) predefined variable in the shader so I have to compute it myself. This is ...
1
vote
0answers
486 views

How to setup my texture cordinates correctly in GLSL 150 and OpenGL 3.3?

I'm trying to do texture mapping in GLSL 150 and OpenGL 3.3 Here are my shaders I've tried my best to get this correct as possible hopefully this is :) I'm guessing you want to know what the ...
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
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
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 ...
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
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 ...
0
votes
0answers
56 views

SSAO attenuation problem

I followed this tutorial and I'm getting incorrect results for SSAO. My gBuffer seems valid. Here is a picture showing Ambient Occlusion, Normalized Depth, Normals in View Space and Position. ...
0
votes
0answers
72 views

Modern OpenGL and SpriteBatching

I tried to find tutorials regarding SpriteBatch done in Modern OpenGL 3.0+, but failed to find any good resources so far. So can anybody please provide me a good resource/tutorial to achieve ...
0
votes
0answers
37 views

Issue with Use SSBO OpenGL

Students that use OpenGL. Do not speak English well. So please understand. There is currently a problem C++ Code Setup() : glGenBuffers(1, &ssboHandle); GLuint ssbo_binding_point_index = 0; ...
0
votes
0answers
38 views

LWJGL 3 GLSL normal problem

I have a pretty strange problem today. I started to make a 2d game yesterday, and everything was right until now. I wanted to make a lighting system, wich required me to send the vertexnormal from ...
0
votes
0answers
68 views

Unity - _LightMatrix0 and Directional Light

I am trying to access the _LightMatrix0 in a forward base pass to calculate some light point of view coordinate but it seems that the _LightMatrix0 is empty with directional light. Any idea how can I ...
0
votes
0answers
69 views

Color bleed ZX Speccy style

When having fun writing an imitation shader of attribute clashing on the ZX Speccy in OpenGL 3 and some fancy shaders, but I can't seem to think of an eficcient way for creating the attribute block ...
0
votes
0answers
29 views

Pass custom data rather than vertices/indices to GPU?

(For reference, I'm using OpenGL 3.3, core profile.) I'm attempting to render a decent number of 2D quads on the screen. Each quad is different, and a GLSL shader does all of the work of rendering ...
0
votes
0answers
31 views

Opengl - atomicMin/atomicMax issues

I have my compute shader and it compiles fine, but when linking I get an error stating "too many uniforms are used in this shader". Weirdly enough when i remove two lines of the code the shader ...
0
votes
0answers
57 views

Pass uniforms to Filter's shader

I wanna implement this shader (https://www.shadertoy.com/view/MslGWN#) in PhaserJS state. So i transformed the shader to WebGL style. I overload Phaser.Filter's update function to pass iChannel ...
0
votes
0answers
102 views

Image speeds up while moving and or rotating instead of constant speed

I'm having a problem with rotating/moving an image. I've set one of my images to rotate on it's z-axis buy updating the angle, but when I run my game, the image starts slowly starts to rotate from a ...
0
votes
0answers
49 views

OpenGL, glDrawElementsInstanced behaving differently on NVIDIA GPU than AMD

I have an AMD GPU on my desktop, AMD HD 5770. I am working on a project on my desktop for over a year. In the scene, I have instanced grass and instanced trees. Everything is working fine on desktop, ...