GLSL is a programming language for OpenGL shaders.
0
votes
1answer
107 views
deferred rendering and a few shading functions
How to use a few shading functions together with deferred rendering (for example some objects are shaded based on a lighting equation,
other get a fixed color) ? I draw a full screen quad when ...
12
votes
1answer
477 views
Why does this geometry shader slow down my program so much?
I have an OpenGL program, and I'm rendering a terrain mesh. I displace the vertices in the vertex buffer and don't really color them in the fragment shader yet. I'm adding a geometry shader one part ...
1
vote
0answers
306 views
2D water shader in SFML
I want to implement the algorithm for a 2D water surface described here and here.
Before somebody finds out, beats me up and deletes this, I'm gonna say it myself. I posted this question over at ...
2
votes
0answers
154 views
Shader Maker version 130 is not supported
I am trying to compile a vertex shader with Shader Maker and if I try to use the version 130 it says:
Compiling Vertex Shader
ERROR: 0:3: '' : version '130' is not supported
Compiling ...
0
votes
1answer
86 views
OpenGL RTT FrameBuffer question and Rendering to texture while sampling it
What i need to do:
Blur the selected texture and pass the texture to another effect for postprocessing.
Notice that i want one texture passed all over.
How do i want to do this:
Bind the FBO ( ...
2
votes
1answer
142 views
Would I perform one pass per effect in Deferred Shading?
I'm implementing deferred shading the first time. Doing so I came up with a conceptual question.
First I render the geometry in a framebuffer with muptiple rendering targets for depth, normals, and ...
4
votes
1answer
425 views
OpenGL GLSL skinning problem
This time I've decided to ask a question related to my skinning problem. Two earlier ones were not really related to my problem and I've deleted them.
Ok, first of all, I'm using OpenGL 3, 3ds max, ...
2
votes
1answer
119 views
mat3x4 in webGL shaders
I am porting the IQM bone animation format to Javascript and have run into a problem...
The vertex shader is failing to compile and the only error message I get out is 'mat3x4' : syntax error on the ...
2
votes
1answer
99 views
Texture prefetching in GLSL
I have a fragment shader which needs lots of semi-random access to 32x32 texture patch. Fortunately, the patch is constant for each poly, so there should be no issue storing the whole thing to the ...
1
vote
1answer
236 views
How to have qt5 work on desktop like on mobile devices (es2, correct glsl version)?
I am looking for help/information concerning this issue :
My work: I have an opengl es2 render engine that works on an iOS app. I almost managed to make it work by calling the same openGL rendering ...
0
votes
2answers
219 views
GLSL light coloring blocked surfaces
I have created a very simple lighting shader. It currently only supports point lights, but it lights up surfaces that are completely blocked from the light. I know why, but I want to know how I can ...
4
votes
1answer
94 views
Forcing early-z with raytracing
I'm working on a GLSL raytracer, and I need to be able to edit gl_FragDepth in the FS. However, doing so disables early-z culling. The scene is rendered front-to-back and the FS can only push points ...
0
votes
0answers
149 views
Regarding Multisampling of textures [closed]
i am rendering white cube with green background in non default FBO and attaching the created multisampled texture to this FBO. When i render a cube in default FBO using above texture, it gives ...
1
vote
0answers
275 views
shader-based particle systems
I have a classic particle system where each particle is represented by a quad and, each time step, I move each particle.
My target is webGL which means I don't have instancing, attribute divisors nor ...
1
vote
1answer
91 views
Multisampled Texture
i have some doubts with multisampled textures.
In fragment shader, how to pass multiple samples?
We use glTexImage2DMultisample instead of glTeximage2D. so, how to upload texture data?
I want to ...
0
votes
0answers
35 views
Using GL_INT_2_10_10_10_REV in glVertexAttribPointer()
Can anybody tell me how exactly do we use GL_INT_2_10_10_10_REV as type parameter in glVertexAttribPointer() ? I am trying to pass color values using this type. Also what is the significance of "REV" ...
0
votes
0answers
196 views
GLSL Vertex Shader works on Windows but not on OS X
I have a a vertex shader that's split into two files. It has about 30 uniforms (including an array of struct objects). It works just fine in my program on Windows but when I run the application under ...
5
votes
1answer
112 views
Blend multiple regions from same texture atlas
I'm representing terrain in my game as a grid with at each node a composition, for example 100% rock, or 50% grass, 50% soil. I'd like to use this composition vector to blend textures together. I'm ...
3
votes
1answer
98 views
Queries regarding Geometry Shaders
I am dealing with geometry shaders using GL_ARB_geometry_shader4 extension.
My code goes like :
GLfloat vertices[] =
{
0.5,0.25,1.0,
0.5,0.75,1.0,
-0.5,0.75,1.0,
...
3
votes
1answer
196 views
how to organize rendering
I use a deferred rendering. During g-buffer stage my rendering loop for a sponza model (obj format) looks like this:
int i = 0;
int sum = 0;
map<string, mtlItem *>::const_iterator itrEnd = ...
2
votes
1answer
126 views
Shadow cubemapping?
I am working on a game with C++ and OpenGL 3.2. I have successfully implemented directional shadow maps and now I'd like to upgrade them to shadow cube maps (for point lights). I've done some Googling ...
3
votes
1answer
406 views
How are vertex shader outs sent as inputs to the fragment shader?
I'm learning some OpenGL 3.2 way of doing things and I think it's quite great, I'm actually understanding more of shaders and non-fixed pipeline in 1 week rather than those 2 years I tried to learn ...
1
vote
1answer
217 views
Light following me around the room. Something is wrong with my shader!
I'm trying to do a spot (Blinn) light, with falloff and attenuation. It seems to be working OK except I have a bit of a space problem. That is, whenever I move the camera the light moves to maintain ...
1
vote
1answer
109 views
fragment shader with SNORM textures
I want to apply SNORM texture by using GL_TEXTURE_3D as a target, what will be the fragment shader for the same?
Also, what should be the data type of texture data?
1
vote
1answer
240 views
Low-level GPU code and Shader Compilation
Bear with me, because I will raise several questions at once. I still feel, though, that overall this can be treated as one question that may be answered succinctly.
I recently dove into solidifying ...
1
vote
2answers
202 views
Deferred rendering order?
There are some effects for which I must do multi-pass rendering. I've got the basics set up (FBO rendering etc.), but I'm trying to get my head around the most suitable setup. Here's what I'm ...
2
votes
0answers
330 views
OpenGL problem with FBO integer texture and color attachment
In my simple renderer, I have 2 FBOs one that contains diffuse, normals, instance ID and depth in that order and one that I use store the ssao result. The textures I use for the first FBO are RGB8, ...
11
votes
1answer
544 views
Toon/cel shading with variable line width?
I see a few broad approaches out there to doing cel shading:
Duplication & enlargement of model with flipped normals (not an option for me)
Sobel filter / fragment shader approaches to edge ...
1
vote
1answer
439 views
Problems implementing a screen space shadow ray tracing shader
Here I previously asked for the possibility of ray tracing shadows in screen space in a deferred shader. Several problems were pointed out. One of the most important problem is that only visible ...
4
votes
1answer
134 views
Cheap ways to do scaling ops in shader?
I've got an extensive world terrain that uses vec3 for the vertex position attribute. That's good, because the terrain has endless gradations due to the use of floating point. But I'm thinking about ...
1
vote
0answers
149 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 ...
1
vote
1answer
197 views
how to use a mask texture?
A texture pack for a sponza model contains mask textures (black and white). I guess that I should read only a red channel from that texture, right ? I use deferred rendering and for shading ...
4
votes
2answers
355 views
Rain drops on screen
I am trying to make simple rain drop effect on screen.Something like this
http://fc00.deviantart.net/fs20/f/2007/302/5/6/Rain_drops_by_rockraikar.png
My idea is to:
Create small drop shaped normal ...
2
votes
1answer
252 views
What is the difference between Constant Vertex Attributes and Uniforms?
According to the OpenGL ES 2.0 Programming Guide:
A constant vertex attribute is the same for all vertices of a primitive, and
therefore only one value needs to be specified for all the vertices of ...
3
votes
1answer
340 views
GLSL per pixel lighting with custom light type
Ok, I am having a big problem here. I just got into GLSL yesterday, so the code will be terrible, I'm sure.
Basically, I am attempting to make a light that can be passed into the fragment shader (for ...
1
vote
2answers
184 views
Low complexity shader to indicate the sides of a polyline
I have a bunch of polylines that I draw using GL_LINES. They can have thousands of points. They actually represent the separation of land and water on a map. I don't have complete polygons, just the ...
3
votes
1answer
256 views
GLSL custom interpolation filter
I'm currently building a fragment shader which is using several textures to render the final pixel color.
The textures are not really textures, they are in fact "input data" to be used in the formula ...
1
vote
0answers
524 views
ssao implementation
I try to implement a ssao based on this tutorial: link I use a deferred rendering and world coordinates for shading calculations. When saving gbuffer a vertex shader output looks like this:
...
0
votes
1answer
240 views
OpenGL ES 2. How do I Create a Basic Fading Streak Effect?
For the iPad app I am writing using OpenGL ES 2 I have a single quad - shaded using GLSL - that is dragged around the screen. Very basic. This works fine. But is rather boring.
I want to increase ...
0
votes
1answer
162 views
OpenGLES GLSL Shader attributes always bound to 0
So I have a very simple vertex shader as follows
#version 120
attribute vec3 position;
attribute vec3 inColor;
uniform mat4 mvp;
varying vec3 fragColor;
void main(void){
fragColor = inColor;
...
0
votes
2answers
871 views
Passing multiple Vertex Attributes in GLSL 130
(note this question is closely related to this one however I didn't fully understand the accepted answer)
To support videocards in laptops I have to rewrite my GLSL 330 shaders to GLSL 130. I'm ...
4
votes
3answers
113 views
How to read BC4 texture in GLSL?
I'm supposed to receive a texture in BC4 format.
In OpenGL, i guess this format is called GL_COMPRESSED_RED_RGTC1.
The texture is not really a "texture", more like a data to handle at fragment ...
1
vote
1answer
209 views
samplerCubeShadow and texture offset
I use sampler2DShadow when accessing a single shadow map. I create PCF in this way:
result += textureProjOffset(ShadowSampler, ShadowCoord, ivec2(-1,-1));
result += textureProjOffset(ShadowSampler, ...
2
votes
1answer
178 views
Billboarding restricted to an axis (cylindrical)
I have succesfully created a GLSL shader for a billboarding effect. I want to tweak this to restrict the billboarding to an arbitrary axis, i.e. a billboarded quad only rotates itself about the ...
5
votes
2answers
307 views
Geometry shader for multiple primitives
How can I create a geometry shader that can handle multiple primitives? For example when creating a geometry shader for triangles, I define a layout like so:
layout(triangles) in;
...
2
votes
2answers
249 views
Is this a reliable method of parsing glGetShaderInfoLog()?
I want to get a list of errors and their line numbers so I can display the error information differently from how it's formatted in the error string and also to show the line in the output.
It looks ...
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
405 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 ...
