A programming language for OpenGL shaders.

learn more… | top users | synonyms

4
votes
0answers
71 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 ...
3
votes
0answers
121 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
89 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, ...
3
votes
0answers
110 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 ...
3
votes
0answers
237 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 ...
3
votes
0answers
433 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 ...
2
votes
0answers
54 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
76 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

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, ...
2
votes
0answers
61 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
172 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
334 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
557 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
316 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
36 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 ...
1
vote
0answers
44 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 ...
1
vote
0answers
64 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
61 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
42 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
257 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
170 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
327 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 ...
1
vote
0answers
127 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
623 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.)], ...
1
vote
0answers
543 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 ...
1
vote
0answers
390 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
249 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
306 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 ...
1
vote
0answers
477 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
18 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
0answers
48 views

Using different shaders for different objects openGL

Basically, I want to draw one object with one shader, and another object with a different shader, but the second object wont show. Currently working on some openGL stuff, and am trying to get one ...
0
votes
0answers
20 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. ...
0
votes
0answers
18 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
48 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
41 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
43 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
33 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
31 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
59 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
67 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
28 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
51 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
86 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
44 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, ...
0
votes
0answers
49 views

ETC1 texture opacity

I'm using the cocos2d-x engine and want to support etc1 on android devices for my game. For ETC1 i'm using the mali compression tool, and GLSL. Everything is working, but I can't change the opacity ...
0
votes
0answers
39 views

GLSL lighting shader with model scale

Basically, i'm just trying to find out where to insert the model scale into the lighting calculations. Ive searched the web, but amazingly, couldn't find anything dealing with scale + GLSL. This is ...
0
votes
0answers
67 views

Slick2d - apply shader

I have a problem. I'm trying to apply a shader to the whole screen. Since I haven't used shaders before I don't know how to pass the texture to the shader. Everything else works... So here are the ...