GLSL is a programming language for OpenGL shaders.
2
votes
0answers
80 views
2D water shader similar to Limbo's effect
I'm wondering how I would go about creating a 2D water shader that is seen in this video http://www.youtube.com/watch?v=phChFfi4GOs
The water effect that limbo uses is pretty awesome. I'm not so ...
0
votes
1answer
54 views
bump mapping with 2 normal maps
I was wondering if its actually possible to do bump mapping with 2 normal maps... I have tried doing it this way however I get a function overload on max and dot.
uniform sampler2D n_mapTex;
uniform ...
0
votes
1answer
37 views
texture movement stutters
Hey I at the moment I have got my texture to move however it stutters as I increment by 0.001 every second. My animation is done via FPS if that make sense and here is some code
FrameCount++;
...
0
votes
1answer
38 views
texture won't move OpenGL ES 2.0
I want be able to move my texture in GLSL I have set my texture to wrap S and wrap T but not sure why it wont move
my fragment shader looks like this at the moment
uniform sampler2D n_mapTex;
...
-1
votes
0answers
39 views
Texture / shader template program [closed]
I would like to use OpenGL to downsize images, using shaders. I would be very grateful, if somebody can give me a sample program in C++, which loads bitmap texture, draws it to the entire screen and ...
0
votes
1answer
53 views
scaling point sprites with distance
How can you scale a point sprite by its distance from the camera?
GLSL fragment shader: gl_PointSize = size / gl_Position.w; seems along the right tracks; for any given scene all sprites seem nicely ...
2
votes
1answer
98 views
variable number of lights in a glsl shader?
I want to render an arbitrary number of lights in my fragment shader. I do not understand how you can properly pass them into the shader though. For example, I want something like this:
uniform int ...
0
votes
1answer
64 views
How to alter the angle of texture projection
I'm currently working on a 3Dish game; it's on a grid, with 3D props and the camera looking down on the grid at about 45ยบ, but I want to use 2D sprites for the player and NPCs.
Currently, I'm using a ...
-1
votes
2answers
139 views
GLSL: Why can only some of the matrices be found? [closed]
I've been learning GLSL and to start I've been trying to replicate the fixed-function pipeline functionality with it, for 2D graphics. I've done it successfully in most things, so far, but I came into ...
2
votes
1answer
78 views
gbuffer - how to store an integer data
In a gbuffer I store a diffuse color in following texture:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
I want to store an integer data which ...
5
votes
1answer
336 views
How to do simple bump mapping
I'm trying to do bump mapping, and I'm getting fairly close at achieving my goal. I miss one crucial piece of my puzzle to have bump mapped effect in my scene; I need to transform the normals from my ...
0
votes
1answer
68 views
Reinhard tone mapping and color space [closed]
I found two ways of doing tone mapping (first, second):
//Ld - this part of the code is the same for both versions
float lum = dot(rgb, vec3(0.2126f, 0.7152f, 0.0722f));
float L = (scale / ...
2
votes
1answer
71 views
RGB to xyY color space conversion and luminance
The luminance calculated by following GLSL functions (fragment shaders - tonemap) has different value:
float GetLuminance (vec3 rgb)
{
return (0.2126 * rgb.x) + (0.7152 * rgb.y) + (0.0722 * ...
1
vote
0answers
58 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. ...
0
votes
1answer
45 views
How do I pass textures into a fragment shader in Slick?
I've written a shader that uses three different textures, tex0, tex1, and tex2. I can load it into Slick and successfully display it, but I can't figure out how to set the three different textures. ...
1
vote
2answers
159 views
GLSL Motion blur on mobile.. possible at acceptable framerates?
I have been struggling to implement a simple linear motion blur effect on mobile (Android, OpenGLES 2.0) but it just seems to destroy my framerate.
I'm rendering to texture (FBO) then applying a ...
2
votes
1answer
139 views
How to solve artifacts caused by vertex lighting in my voxel engine?
My current lighting system bakes the light amount based on ray-tracing from the light source to the 8 corners of the block (so per-vertex) and the distance to the light on the blocks. It works ...
0
votes
1answer
75 views
How to get a smooth dimming with SSAO?
I implemented SSAO in my game based on the tutorial at gamerendering.com. But the results I get are disappointing. Instead of a smooth effect as seen in the nvidia demos, my implementation causes ...
0
votes
2answers
70 views
LWJGL Game crashes on some other machines [closed]
I just tried running my game on a friend's laptop, but for some reason it crashes. The exported .jar runs fine on my machine, and some others too. I can see that is has something to do with the ...
3
votes
3answers
345 views
Voxel engine artifacts
There are white little dots between blocks at random places, mainly at very near blocks. They disappear when I move the mouse and change the view direction.
I use Vertex Arrays with ...
1
vote
1answer
97 views
OpenGL VBO Additional Attributes
If I have a buffer with my vertices, normals and texture coordinates, and I use glDrawArrays to draw the VBO to the screen, how can I send attributes per vertex that I placed in an array to the shader ...
3
votes
2answers
208 views
Do opengl games tend to use multiple shaders? [duplicate]
For any given object that you want to render, there may be a whole bunch of things that need to be considered for rendering (Material, Texture, Lighting, Blending etc). But, you may also have some ...
0
votes
0answers
93 views
Program created with glCreateProgram is not identified as a valid OpenGL program outside [closed]
I've starting programming in OpenGL and I decided to create my own class to manage shader objects.
In the class constructor I create a new program calling glCreateProgram, and I'm able to print its ...
2
votes
1answer
172 views
glsl 150 struct in uniform buffer object
Can I do this in opengl 3.2 / glsl 150?
glsl shader:
struct LightSource {
vec4 ambient;
vec4 diffuse;
vec4 specular;
vec4 position;
vec4 direction;
};
...
layout(std140) uniform ...
2
votes
1answer
129 views
How to transform a shadow map to camera view?
I'm making a rendering engine as a hobby to learn more about 3D. I have a deferred renderer with the G-buffer (color, normal and depth). I also have a lighting controller that uses only spotlights at ...
-5
votes
3answers
195 views
in the shadow of a sphere [duplicate]
(Related, but somewhat different, to my previous question)
How can I determine in a fragment shader if a fragment is in the shadow of a sphere?
That is, if it is occluded by the sphere and is past ...
1
vote
0answers
96 views
What is the recommended way to output values to FBO targets? (OpenGL 3.3 + GLSL 330)
I'll begin by apologizing for any dumb assumptions you might find in the code below since I'm still pretty much green when it comes to OpenGL programming.
I'm currently trying to implement deferred ...
0
votes
1answer
240 views
Simple pass-through geometry shader with normal and color
I've written a very simple pass-through geometry shader. My input and output primitives are points. I also want to forward the color and normal from vertex shader to fragment shader through geometry ...
0
votes
1answer
122 views
Using two FBOs results in the second FBO having nothing drawn to [closed]
I'm writing a deferred renderer, and I use two FBOs: the first one for G-buffer (color, normal, depth) and the second one for lighting (light output), so the first one has three textures bound and the ...
3
votes
2answers
209 views
Jagged transparency when rendering translucent textures (OpenGL 3.2 + GLSL)
Like most others, I'll start off mentioning that I'm still a beginner when it comes to OpenGL and GLSL programming. So bear with me on any dumb mistakes you may spot in the code ahead.
I'm basically ...