A programming language for OpenGL shaders.

learn more… | top users | synonyms

0
votes
0answers
52 views

GLSL - skewed parallax occlusion mapping

I'm currently trying to implement Parallax Occlusion Mapping, based off a post on sunandblackcat.com With my current implementation, I have the following: i.stack.imgur.com/H0c2s.png Notice how the ...
0
votes
1answer
29 views

Identify shading language in Trove

I'm playing this voxel game named Trove, running it in DirectX, their requirements are DirectX 10 and OpenGL 3.2 The character entity in this game emits light when it gets close to any surfaces (...
1
vote
1answer
28 views

Texture filtering of look-up table in post process shader

I am doing post processing by drawing to an FBO and then applying a certain fragment shader when drawing the FBO's texture to the screen. I want to use a look-up table texture to apply color grading. ...
0
votes
1answer
29 views

Artifacts when trying to implement Cook-Torrance BRDF

I am trying to implement the Cook-Torrance BRDF within OpenGL, but I keep running into issues. The most obvious one are black patches and a bright spot at (0, 0). I checked my shader multiple times, ...
0
votes
0answers
27 views

rust effect or detecting object edges within shaders

I'm relatively new to GLSL which I'm studying for a course. I wish to find a way to apply rust to an object. If I have a cube then making it rust would be simply colouring the edges a brownie color. ...
0
votes
1answer
36 views

GLSL - Stretched vertices after translating

I'm trying to translate 3D object in my game engine. I copied all formulas from my old, working game engine, where translation was working. When I set position and rotation to 0, everything looks to ...
0
votes
1answer
44 views

Fragment processing depends on polygon size?

I just set up some simple vertex/fragment shaders for handling lighting instead of using the openGL calls. I have a few terrain VBOs setup that are drawing a million or so triangles for testing (bunch ...
1
vote
1answer
35 views

Combining and drawing 2D lights in OpenGL

I have progressed to the lighting portion of my little framework and I managed to solve a few initial problems so now I'm left with the subtle weirdnesses. At this stage I just have 2 lights - the ...
0
votes
0answers
30 views

gl_VertexID always 0 under some hardware

I'm trying draw a color box with TBO technique for my project, but something strange happens! Please Help Me. VERTEX SHADER: #version 330 uniform mat4 matPrj; uniform mat4 matView; uniform mat4 ...
4
votes
1answer
42 views

GLSL error on AMD gpu. No error on nVidia

I have an OpenGL program that works fine on nVidia card, but produces Access violation error and GL_INVALID_OPERATION at glDrawElements on AMD gpu. For starters I have this geometry shader which now ...
0
votes
2answers
42 views

LWJGL - My glsl code somehow does not work

I am following the tutorial "3D Game Development with LWJGL3" using LWJGL 3.0.2(stable) https://www.gitbook.com/book/lwjglgamedev/3d-game-development-with-lwjgl/details I am following the chapter "...
3
votes
0answers
101 views

LibGDX Shader works fine on desktop but does not work at all on Android device

I made a very basic shader that works perfectly fine on Desktop, but when I try it with an AVD the sprite affected by the shader is not drawn. I have tried with WQVGA API 16 and Nexus S API 23. I have ...
1
vote
0answers
18 views

OpenGL - Multiple Render Target - write only to some targets, discard others

In OpenGL, is it possible to achieve behaviour like this: out float out1 out vec4 out2; //..... out1 = /* write some value */ out2 = /* discard */ My output targets are R32F and RGBA.
1
vote
2answers
69 views

How do I create a view matrix that does not contain the camera translation?

I'm looking at this tutorial https://capnramses.github.io/opengl/cubemaps.html about half way down the webpage, there is a description of a vertex shader #version 400 in vec3 vp; uniform mat4 P, V; ...
1
vote
1answer
30 views

Is there anyway to filtere a texture in glsl that turns stair like texels into smooth lines

I'm trying to filter a static, low resolution shadowmap. Unfortunatly, it doesn't look smooth, because of the way the default trilinear filtering works. It does have a smooth transition from light ...
3
votes
1answer
103 views

What technique should I use in a shader to give this reflective effect?

I'm working on a top-down 2D strategy game written in Java with LibGDX (though really for the purposes of this question I'll be using GLSL). I want to give metallic materials in the game a shiny ...
0
votes
1answer
65 views

Calculating vertex normals in OpenGL C++

Does anyone knows a simple solution for calculating vertex normals? I've been looking for this on the internet but i cant find a simple solution, for example, if I have some vertices like this: ...
0
votes
0answers
25 views

Can I map uniform variables?

I'm literally just starting with GLSL, I'm using python and I actually can't run 330 (intel hd3000 on Debian) so I'm using 130, so far is ok. I started using in first and didn't know about uniform ...
0
votes
0answers
52 views

GLSL Texture 2D Array indexing does not work as ecpected

For some reason i can only ever get either the first or the last texture in my texture Array to render. But if i hardcode an index Value in the shader like texture(sampler, vec3(u, v, 2); i get the ...
1
vote
0answers
17 views

Android glsl discard problem

Whenever I use discard or an if statement in my shaders, I get an error message with the text <qgl2DrvAPI_glAttachShader:398>: GL_INVALID_VALUE I think this is a version problem, but I'm ...
0
votes
0answers
38 views

Can see triangles in translucent/transparent object OpenGL

I added a sphere to my scene in OpenGL and tried modifying the alpha values of its vertices in the fragment shader. However, the result is that I can now see through half the triangles on the object ...
0
votes
0answers
59 views

webgl draw call batching and optimizations

I'm working mostly with three.js and webgl, i have some experience with unity. I don't consider three.js a game engine, more of a "rendering library" - something that takes care of the GL ...
0
votes
0answers
32 views

Shadow Mapping Distortions only on large polygon surfaces

SOLVED See bottom :) Hi Ive got a GLSL Shader question Ive been teaching basic programming to some young students. Basic and some C++. Ive setup a shader in a modern compiled basic to show what can ...
0
votes
1answer
37 views

Modifying UV's origin on shader (OpenGL)

Is there a way to change the UV's origin (bottom-left) on shader?
1
vote
1answer
53 views

OpenGL tesselation doesn't change geometry shape

I implemented tessellation control and evaluation shaders in OpenGL, but the effect it has on my terrain was not what I expected. I expected that the low poly-count curves and shapes on the terrain ...
0
votes
0answers
29 views

FFP Alpha Test shader - function decleration

I'm trying to use FFP_Alpha_Test RTSS from ogre on GLES2 platform. I added the relevant files and built everything but got an error: No matching function for call to 'FFP_Alpha_Test' Fragment Program ...
3
votes
1answer
154 views

Procedural Hatching

I know that it is possible to make a shader that uses procedural hatching instead of pre-designed tonal art maps. But is it possible to make that procedural hatching in the fragment shader? I would ...
0
votes
1answer
17 views

Aggregation of value in GLSL loop results in 0

I'm banging my head against a wall trying to understand why this code is giving me some reasonable results with some visible colors on parts of the screen... #version 130 in vec2 vTex; // must match ...
0
votes
0answers
53 views

World-space position from logarithmic depth

After changing my current deferred renderer to use a logarithmic depth buffer I can not work out, for the life of me, how to reconstruct world-space depth from the depth buffer values. When I had the ...
0
votes
0answers
51 views

Is this 2D light implementation with shaders good enough?

After some days reading and programming shaders in GLSL (and Allegro 5) I came up with the stages I will be using to render the lights in my 2D test game. My first goal is to reach something like what ...
1
vote
1answer
69 views

Texture coordinates projection

I have some classic texture coordinates and as a normal behaviour they follow the mesh's transformations. I am trying to use the same texture coordinates behaviour but without being affected by the ...
0
votes
2answers
50 views

How to use texelFetch

I'm trying to switch from using the GLSL texture() function in my shader to using texelFetch() because I want very little processing of the texture pixels (no smoothing), and I want to use pixel ...
-5
votes
1answer
53 views

Why isn't this glsl program working? [closed]

Why isn't this glsl program working ? #shader vertex #version 430 layout (location = 0) in vec4 position; layout (location = 1) in vec3 normal; layout (location = 2) in vec2 texture_coordinate; ...
0
votes
1answer
29 views

Formula for range based attenuation

I am trying to implement a simple shader for point lights, but I am struggling with the attenuation function. I know that normally you would use three coefficients (constant, linear, and quadratic), ...
0
votes
0answers
14 views

Reading from SSBO causes black screen and lag

I tried porting my OpenCL raycaster to GLSL compute shaders. Only I'm having trouble with shader storage buffers. How I initiaize the buffer (constructor of class BufferGL): GLBuffer::GLBuffer(GLint ...
0
votes
1answer
96 views

Eye Parallax Refraction Shader

I am trying to implement the Parallax Refraction effect explained by Jorge Jimenez on this presentation: http://www.iryoku.com/downloads/Next-Generation-Character-Rendering-v6.pptx and I am facing ...
0
votes
1answer
35 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
1
vote
1answer
265 views

Implementing Valve's checkerboard rendering technique

I've been trying to implement Valve's VR checkerboard rendering technique (original document) and was wondering which way would be the best to proceed. The thing is that I need to "abort" the ...
3
votes
3answers
113 views

Can I make color data not render as gradient?

I would like for the color between my vertices to not be rendered as a gradient, but as a hard break. Is there any way to accomplish this in OpenGL/GLSL?
4
votes
1answer
119 views

Why do we multiply perspective * modelview * point?

A common line in vertex shaders is: gl_Position = projection_matrix * model_view_matrix * object_space_vertex; I've seen this a lot, why isn't it written like gl_Position = object_space_vertex * ...
4
votes
1answer
130 views

Directional light type

I am currently trying to implement a specific directional light type. This light type has been used in the game INSIDE and is called orthogonal spotlight (aka local directional light). I assume that ...
6
votes
1answer
246 views

What are screen space derivatives and when would I use them?

I see the ddx and ddy glsl functions and the hlsl equivalents come up in shader code every now and then. I'm currently using them to do bump mapping without a tangent or bitangent but I basically copy-...
0
votes
0answers
53 views

Opengl - Spotlight shadow clipping problem

I implemented a light system + shadow mapping. Everything works fine with point light / directionnal light, but when i come to do spotlight shadow mapping, its a little messy. Im pretty sure this is ...
0
votes
1answer
112 views

game maker - how to change color palette using shader and texture

how to change the color of the application surface, using the texture?? https://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes https://en.wikipedia.org/wiki/List_of_8-...
1
vote
1answer
45 views

Using normal maps to output world-space normals

Im using deffered shading and here is my g-pass Vertex shader code: vec3 T = normalize(vec3(transform * vec4(tangent, 0.0))); vec3 N = normalize(vec3(transform * vec4(normal, 0.0))); vec3 B = cross(T,...
1
vote
0answers
39 views

Game Maker - Shader CGA - how to swap the palette

I created a shader that get the actual color of the surface and render it to the closer of a cga palette I have to change it to swap the palette in 4 colors but I don't know how secondary, I have to ...
0
votes
2answers
103 views

LIBGDX: Changing colors of a Sprite on the fly

I have found a great tutorial series on creating a simple 2D side scroller, Super Mario Brothers, in this case, and I believe I can adapt it fairly well to create a Megaman clone(something I am quite ...
2
votes
1answer
234 views

How to create realistic rainfall animation in modern OpenGL using shaders?

I see many examples of particle system in old style OpenGL with falling raindrops. Examples of rainfall that can interact with environment lighting and look realistic are hard to find. How to create ...
0
votes
1answer
89 views

Opengl - Glsl for loop array iteration bug

I am facing a really weird bug. On an old copy of my engine, i was doing a loop to render all the lights in my scene: for(int i = 0; i < numLights; i++){ finalColor += ApplyLight(lights[...
1
vote
1answer
78 views

Problem with RGBA sampled shadowmap

I'm having a problem with the generation of a shadowmap that is converted to RGBA. The following glsl code is used to put the depth into the depthbuffer : /** * float/rgba8 encoding/decoding so that ...