GLSL is a programming language for OpenGL shaders.
2
votes
1answer
105 views
Uniform not being applied to proper mesh [closed]
Ok, I got some code, and you select blocks on a grid.
The selection works. I can modify the blocks to be raised when selected and the correct one shows.
I set a color which I use in the shader. ...
1
vote
2answers
205 views
Depth buffer values reset on change shader?
I have 2 different shaders, and when I change the shader (glUseProgram), it seems that the depth information is lost, because everything drawn with the 2nd shader appears completely on top of anything ...
3
votes
2answers
408 views
OpenGL sprites and point size limitation
I'm developing a simple particle system that should be able to perform on mobile devices (iOS, Andorid). My plan was to use GL_POINT_SPRITE/GL_PROGRAM_POINT_SIZE method because of it's efficiency ...
1
vote
1answer
118 views
running GL ES 2.0 code under Linux ( no Android no iOS )
I need to code OpenGL ES 2.0 bits and i would like to do this and run the programs on my desktop for practical reasons.
Now, i already have tried the official GLES SDK from ATI for my videocard but ...
3
votes
2answers
444 views
Learning OpenGL GLSL - VAO buffer problems?
I've just started digging through OpenGL and GLSL, and now stumbled on something I can't get my head around this one!? I've stepped back to loading a simple cube and using a simple shader on it, but ...
2
votes
0answers
244 views
GLSL Bokeh using Quads and Textures
I'm trying to create a depth of field effect with bokeh sprites in GLSL. Specifically, what i would like to do is, for each pixel:
See if the pixel is out of the focal range
If it is, draw a quad ...
0
votes
1answer
225 views
What are the steps taken by this GLSL code?
1 void main(void)
2 {
3 vec2 pos = mod(gl_FragCoord.xy, vec2(50.0)) - vec2(25.0);
4 float dist_squared = dot(pos, pos);
5
6 gl_FragColor = (dist_squared < 400.0)
7 ? ...
0
votes
1answer
243 views
Correct Rotation and Translation with a 4x4 matrix
I am using a 4x4 matrix to transform verts in a shader. I multiply an identity matrix by a rotation matrix by a translation matrix. I am trying to first rotate the verts and then translate them, ...
0
votes
1answer
438 views
How to convert Maya shaders and Renderman shaders to GLSL?
I know this 2 products but i have never used them for production, since I have a bunch of cool shaders i would like to use them under OpenGL with GLSL but i don't know where to start.
If it's not ...
6
votes
1answer
171 views
GLSL vertex shaders with movements vs vertex off the screen
If i have a vertex shader that manage some movements and variations about the position of some vertex in my OpenGL context, OpenGL is smart enough to just run this shader on only the vertex visible on ...
12
votes
1answer
742 views
Should I distribute shaders in a compiled form or in plain text?
Having an application that uses shaders that have been wrote in GLSL, what is the best strategy for the distribution in the real world and for the desktop and mobile?
I'm aiming to distribute this in ...
3
votes
1answer
576 views
First-Time GLSL Shadow Mapping Problems [closed]
I'm working on building out a 2.5D engine and having massive problems getting my shadows working. I'm at a point where I'm VERY close.
So, let's see a picture to see what I have:
As you can see ...
5
votes
1answer
739 views
GLSL, all in one or many shader programs?
I am doing some 3D demos using OpenGL and I noticed that GLSL is somewhat "limited" (or is it just me?). Anyway I have many different types of materials. Some materials have ambient and diffuse color, ...
4
votes
3answers
313 views
Finding out what pixel on the screen the fragment falls on
In my 2D game, I render tiles. I want to do lighting without needing an extra buffer the size of the screen.
Either in glsl or hlsl, what could I feed to the shader each time I render a bitmap so ...
1
vote
0answers
198 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 ...
4
votes
1answer
1k views
Access vertex data stored in VBO in the shader
If I wanted to store extra data in a VBO for skinning (indices for indexing into an array of matrices of bones and floats for applying weights to those bones) How would I go about accessing that data ...
3
votes
1answer
742 views
Deferred Rendering and Normal Mapping
I'm working on a deferred renderer and need a bit of help getting normal maps working.
What I've been doing with them so far is just multiplying the normal texture with the object normals ...
8
votes
4answers
2k views
Debugging Shader Code?
I'm writing a game engine, and when I use a perspective camera I get a black screen. I am not going to ask exactly why this is because there would be a lot of code to share and, frankly, I think ...
2
votes
3answers
493 views
Can you dynamically set which texture to use in-shader?
I'm working on a user interface system, and I want to be able to mix textured polies with frag-coloured polies. Here's my shader code, that doesn't work:
attribute vec2 vertex_coords;
attribute float ...
2
votes
1answer
1k views
Does Macbook Air 2012 (Intel HD4000) support GLSL 1.3+?
I'm using SDL2 and GLEW on OSX Mountain Lion (2012 Macbook Air) to create an OpenGL context. Querying for the GLSL version, it reports GLSL version 1.2. I'm curious if this is a limitation of the ...
8
votes
2answers
2k views
OpenGL: VBO or glBegin() + glEnd()?
I recently was given this link to a tutorial site from someone who I gave the original OGL Redbook to. The third header down says distinctly to forget glBegin() & glEnd() as the typical render ...
3
votes
0answers
591 views
GLSL pack floats into an RGBA texture
I want to compose conventional triangle-based models and particles with a ray-traced scene at a reasonable frame-rate.
webGL does not let you write the gl_FragDepth in the fragment shader. You ...
3
votes
1answer
1k views
Sea water shader using only fragment processor
I have a game that runs on mobile devices (OpenGL ES 2.0) and for which I would like to create some sea water using the shaders. Now, the plane on which the sea water texture will be has only 4 ...
1
vote
3answers
209 views
Shaders not linking correctly
I'm writing a rather simple "ShaderManager" which aids me with loading shaders in Open GL, altough I am having a few issues:
The shaders don't link correctly
The the attributes don't bind
Here's ...
1
vote
2answers
308 views
Lights system with shaders in OpenGL?
In more than just 1 occasion, i read about 2 ways of doing a light's system in OpenGL:
normal way? i don't know how to call this one
with the shaders ( GLSL )
The problem is i don't get the ...
1
vote
1answer
637 views
Shader authoring/editing tools for GLSL ES
Since Render Monkey has been discontinued (perhaps due to the complexity of today's shading languages), there are few successors that can match its functionality. Is there any useful tool for material ...
1
vote
3answers
283 views
Writing a shader once without using CG?
Is there a tool that can convert a fragment shader from hlsl to glsl or glsl to hlsl? I do not want to use cg since it is not able to work on mobile platforms.
Is there a tool that can make it so I ...
10
votes
1answer
418 views
Special relativity shader in GLSL
I'm trying to implement a GLSL shader which helps understanding special relativity Lorentz Transformation.
Let's take two axis-aligned inertial observer O and O' . The observer O' is in motion w.r.t ...
1
vote
1answer
921 views
GLSL - rewriting (geometry) shader from #330 to #130 version
I'm having trouble running example from:
https://raw.github.com/progschj/OpenGL-Examples/master/07geometry_shader_blending.cpp
My graphics card supports only #130 shaders version so I have to rewrite ...
2
votes
2answers
428 views
Lighting problems with Terrain
I'm in the process of learning Open GL and am having issues with lighting on my Terrian, I don't know if the issue is related to how I calculate my normals or the shader itself (I am using the shader ...
0
votes
0answers
233 views
Making shaders work for both ATI and NVIDIA in Blender Game Engine
Unfortunately coding OpenGL shaders is more strict for ATI cards. I am trying to get this code from this thread http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR to ...
2
votes
0answers
199 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 ...
3
votes
1answer
1k views
GLSL if-else statement unexpected behaviour
This question is related to this other one I asked a few days ago. Because I have finally get to the bottom of the issue, I have rather preferred to open a new question with a more detailed ...
6
votes
4answers
450 views
Impact of variable-length loops on GPU shaders
Its popular to render procedural content inside the GPU e.g. in the demoscene (drawing a single quad to fill the screen and letting the GPU compute the pixels).
Ray marching is popular:
This means ...
1
vote
1answer
155 views
Blur gets displaced compared to original image
I have implemented a SSAO and I'm using a blur step to smooth it out. The problem is that the blurred texture is slightly displaced compared to the original. I'm blurring using a 4x4 kernel since that ...
0
votes
0answers
2k views
GLSL Shader Texture Performance
I currently have a project that renders OpenGL video using a vertex and fragment shader. The shaders work fine as-is, but in trying to add in texturing, I am running into performance issues and can't ...
1
vote
2answers
654 views
Updating texture memory via shader?
What the title says.Is it possible to update a texture via a glsl shader ? Something like :
//Read
vec4 Pixel = texture2D(TextureID,gl_TexCoord[TextureIndex].st);
//Write to texture memory ?
vec4 ...
2
votes
1answer
254 views
Build-time GLSL syntax validation
Is there a way to validate GLSL syntax build-time instead of run-time? My application takes a long time to start and I want to know at the earliest possible stage that my shaders are ok. I'm using ...
6
votes
1answer
956 views
Not getting desired results with SSAO implementation
After having implemented deferred rendering, I tried my luck with a SSAO implementation using this Tutorial. Unfortunately, I'm not getting anything that looks like SSAO, you can see my result below.
...
0
votes
1answer
278 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 ...
1
vote
2answers
565 views
Simple OpenGL program major slow down at high resolution
I have created a small OpenGL 3.3 (Core) program using freeglut. The whole geometry is two boxes and one plane with some textures. I can move around like in an FPS and that's it. The problem is I face ...
2
votes
1answer
533 views
How to detect GLSL warnings?
After compiling a shader with glCompileShader, I can call glGetShaderiv with GL_COMPILE_STATUS to check if the shader compiled successfully. I can also call glGetShaderInfoLog to get information about ...
0
votes
1answer
552 views
Making a surface transparent from blackness of texture
I am making a "halo" shader in unity using GLSL. And I've come to a roadblock.
What I need to do is take a texture, like the following, and make it transparent according to the darkness of it. And I ...
6
votes
2answers
2k views
First time shadow mapping problems
I have implemented basic shadow mapping for the first time in OpenGL using shaders and I'm facing some problems. Below you can see an example of my rendered scene:
The process of the shadow mapping ...
2
votes
1answer
536 views
GLSL compile error when accessing an array with compile-time constant index
I have this shader that works well on my computer (using an ATI HD 5700). I have a loop iterating between two constant values, which is, afaik, acceptable in a glsl shader. I write stuff in two arrays ...
5
votes
2answers
721 views
Sorting objects before rendering
I'm trying to implement a scene graph and in all the articles i've come across there is talk about object sorting. So you'd sort your objects by "material" for example. Now untill i sat down and ...
7
votes
1answer
2k 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 ...
4
votes
4answers
231 views
Shader compile log depending on hardware
I'm done with the core of my graphics engine and I'm testing it on every platform I can get my hands on. Now, what I noticed is that different drivers return different shader and program compile log ...
1
vote
3answers
402 views
GLSL mesh discard command?
Is there a GLSL command similar to the discard, but it discards the whole mesh and not just a fragment?
4
votes
1answer
442 views
My GLSL shader isn't compiling even though it should. What should I investigate?
I'm porting an iOS game to Android. One of the shaders I'm using wouldn't compile until I reduced the number of uniform variables. Here are the uniform definitions:
uniform highp mat4 ...
