GLSL is a programming language for OpenGL shaders.
3
votes
1answer
702 views
Renderbuffer to GLSL shader?
I have a software that performs volume rendering through a raycasting approach. The actual raycasting shader writes the raycasted volume depth into a framebuffer object, through gl_FragDepth, that I ...
4
votes
2answers
347 views
OpenGL, Offset and Camera Space
I was reading chapter 4 of the Arcsyntesis OpenGL tutorial when I came across this line in the GLSL shader.
vec4 cameraPos = position + vec4(offset.x, offset.y, 0.0, 0.0);
About it, the tutorial ...
4
votes
1answer
622 views
How does one get adjacency information in a geometry shader?
If you use triangle_adjacency as the input type of a geometry shader, do you need to do something on the client side besides make the primitive mode triangle_adjacency?
Basically what I'm asking do ...
2
votes
1answer
781 views
GLSL Core Functionality Geometry Shader examples
I'm doing some research on geometry shaders and am having problems finding code examples/tutorials that does not use one of the extensions introduced before it was core functionality of OpenGL 3.2.
...
1
vote
1answer
883 views
Pygame water ripple effect
I have Googled for it but there are no ready scripts - as opposed to the same effect on Flash. I have checked the algorithm on The Water Effect Explained and also tested an implementation of the ...
3
votes
1answer
463 views
Why are my texture coordinates always (0,0) in this shader?
What I'm trying to do is add my depth buffers values to my scene, ie. I'm trying to make objects closer to the camera darker and objects further away lighter. Which should be easy: just render the ...
5
votes
2answers
712 views
How'd they do it: sphere effects in Osmos
I'm curious how the sphere effects were done in Osmos from Hemisphere Games. Any ideas how the resolution independent zoom in was achieved?
Edit, more specifics on questions:
How do you render the ...
6
votes
3answers
381 views
shadowing billboards
I have a lot of billboarded 3D spheres (they have a heightmap so work properly with depth and penetration; although each is made of just a quad (with slight distortion), they look and feel and are ...
5
votes
2answers
2k views
Using a GLSL fragment shader to draw a texture in the middle of a quad
I'm not sure how possible this is, but I'm trying to use a fragment shader to draw a portion of a texture in the middle of a quad. This is all 2D. The quads consist of four vertices from (0, 0) to ...
3
votes
1answer
415 views
moving glDepthMask into a shader
Can a fragment shader make per-fragment decisions on whether the fragment updates the depth buffer or not, even if the fragment is not discarded and the color is written?
2
votes
2answers
811 views
Multiplatform GLSL shader validator?
Im working on a multiplatform (Pc,Mac,Linux) game that uses shaders quite extensively. Since we do not have any funding, it is pretty hard to test our game on all possible hardware configurations.
...
2
votes
1answer
454 views
Model in Blender GLSL to XNA HLSL
Is it possible to make model in Blender, with enabled GLSL, add multiple textures, etc, and then just load it in XNA, where's own HLSL? Will it work?
2
votes
1answer
361 views
Learning GLSL: What's a good intermediate project to work on?
I know the basics of OpenGL and I'm starting to love computer graphics more and more. I have a computer science background and have been programming for 5 years. I've been reading the orange book and ...
3
votes
2answers
1k views
computing gl_FragDepth
I am trying to draw spheres using a billboard, so I have a normal map with a z component that I am sampling in my fragment shader. I just need to add this z component to the depth of my fragment to ...
1
vote
1answer
646 views
GLSL woes involving texturing
I'm a beginner to OpenGL and GLSL especially, and I'm having a lot of trouble getting textures to display via shaders. My shader code compiles without any warnings or errors, but I seem completely ...
6
votes
1answer
2k views
GLSL - Rewriting shaders from #330 to #130
I recently created a game (LD21) that uses a geometry shader to convert points into textured triangles/culling. Since I was under the impression that the support for #330 was widespread I only wrote ...
18
votes
4answers
4k views
Why is programmable pipeline( GLSL ) faster than fixed pipeline?
So I'm teaching myself GLSL and am trying to figure out why it's suppose to be faster than the fixed function pipeline.
The reason I am having a problem is that from my understanding , the shaders ...
35
votes
1answer
2k views
How can I reduce aliasing in my outline glow effect?
I'm trying to replicate the glowing outline effect in the Left 4 Dead game. The effect causes an objects outline to glow, even when the object is occluded. Here is a screenshot of the effect:
I'm ...
4
votes
3answers
2k views
How can I draw the depth value in GLSL?
I want to draw the depth buffer in the fragment shader, I do this:
Vertex shader:
varying vec4 position_;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
position_ = ...
6
votes
2answers
774 views
Casting a shadow over a whole scene with GLSL in 2D?
I'm making a (non-isometric) side scrolling 2D game and I want each fragment that I draw to cast a small drop shadow when it is near another object. What sort of algorithms are used in fragment ...
3
votes
0answers
691 views
Sampling from depth texture causes shader to stop working
I'm currently having issues with depth textures. When I sample from a depth texture it causes my other samplers to fail. For example, when I set gl_FragColor manually the depth buffer is correct. I ...
1
vote
3answers
877 views
Is it possible to batch draw sprites that use different textures without using an atlas?
I've implemented a sprite batch class that uses a sampler array so that I can select a texture to use based on the gl_PrimitiveID. The idea was to be able to draw sprites that use different textures ...
6
votes
4answers
838 views
Spell Effects/Shaders
I want to be able to achieve spell effects that cause a fragmenting/discoloring effect on the sprite. The first couple seconds of this video http://www.youtube.com/watch?v=HNCFh7mkvuc shows what I ...
-1
votes
2answers
632 views
How does OpenGL-ES 2 assemble primitives?
Two things I'm quite confused about.
1) OpenGL ES 2.0 creates primitives before the vertex shader is invoked. Why, then, does it not automatically provide the vertex shader the position of the ...
1
vote
1answer
479 views
Questions before I revamp my rendering engine to use shaders (GLSL)
I've written a fairly robust rendering engine using OpenGL ES 1.1 (fixed-function.) I've been looking into revamping the engine to use OpenGL ES 2.0, which necessitates that I use shaders. I've been ...
5
votes
1answer
263 views
How can I test shaders for nVidia on an ATi system?
I and our other devs have ATi graphics cards. However we have encountered that some shaders that compile without warnings on ATi don't compile at all on nVidia. The problems are trivial to fix, but ...
0
votes
0answers
403 views
geomipmapping using displacement mapping (and glVertexAttribDivisor)
I wake up with a clear vision, but sadly my laptop card doesn't do displacement mapping nor glVertexAttribDivisor so I can't test it out; I'm left sharing here:
With geomipmapping, the grid at any ...
1
vote
2answers
3k views
OpenGL ES 2.0: Controlling Transparency in Fragment Shader
The following is the OpenGL ES 2.0 simple GLSL Fragment Shader, I use to place textures on polygons, to render 2D sprites.
varying mediump vec2 TextureCoordOut;
uniform sampler2D Sampler;
void ...
0
votes
0answers
166 views
varying by triangle and index
A shader has values that are per vextex and values that are per call.
Can you have values that vary only per triangle or quad
And can you have values that vary only per pair. Of indicies in a ...
7
votes
4answers
1k views
glsl demo suggestions?
In a lot of places I interviewed recently, I have been asked many a times if I have worked with shaders. Even though, I have read and understand the pipeline, the answer to that question has been no. ...
7
votes
1answer
242 views
Overview/showcase of shader techniques/uses for games
I am looking for resources that can provide me with a better understanding of what kind of things shaders are used for in games, what they can do, and maybe even more importantly, what they cannot. I ...
7
votes
4answers
426 views
What types of effects or shaders would you teach in a rendering class? [closed]
I am looking for a list of topics that would be fun to learn and not too complicated to implement with a prototyping tool like FX Composer or Rendermonkey for an intermediate class of real-time ...
4
votes
2answers
608 views
Optimising the modelview transformation in GLSL for 2D
So, the standard way to transform vertices and then pass to the fragment shader in GLSL is something like this:
uniform mat4 u_modelview;
attribute vec4 a_position;
void main() {
gl_Position = ...
14
votes
1answer
4k views
Is there a successor to RenderMonkey?
I'm starting with GLSL shader programming and have been looking into RenderMonkey. Sadly, AMD no longer supports it. Why? Is there a successor to it?
6
votes
1answer
8k views
GLSL: How Do I cast a float into an int?
In a GLSL fragment shader I am trying to cast a float into an int. The compiler has other ideas. It complains thusly:
ERROR: 0:60: '=' : cannot convert from 'mediump float' to 'highp int'
I am ...
1
vote
1answer
330 views
Mandelbrot set not displaying properly
I am trying to render mandelbrot set using glsl. I'm not sure why its not rendering the correct shape. Does the mandelbrot calculation require values to be within a range for the (x,y) [ or (real, ...
2
votes
1answer
245 views
Bluring behind something then drawing text?
I want to basically make a blur shader in glsl and use it like Windows 7 does for Windows. I want to for example draw something and then blur a rectangle, then draw text over it.
If someone could ...
2
votes
1answer
1k views
Why does glGetUniformLocation report some of my uniform locations as -1?
I have been writing GLSL shaders for over a year but this is the first time I have run into this problem. I am on the iOS platform - if that matters.
In a vertex shader I have this:
uniform mediump ...
3
votes
2answers
931 views
interpolating frames in a vertex shader
My models are stored as a set of meshes, each with a vertex list and normal list per key-frame, and indices for GL_TRIANGLES which is shared for all frames. Each frame I lerp between two adjacent ...
1
vote
1answer
840 views
Draw multiple LINE_LOOPs in one glDrawElements call
The game I'm working on has OpenGL (2.1) vector graphics, and I need to draw up to 1000 enemies, each of which is composed of between 4 and 100 lines.
Each enemy can be drawn as a single line loop, ...
4
votes
1answer
673 views
GLSL shader without a vertex array
Ok so I have a idea for a neat GPU driven curve renderer, and I realised that the vertex shader can be hardwired to generate points of the curve segment (to be rendered as a line strip) without ...
5
votes
2answers
982 views
OpenGL equivalent of .fx files in GLSL or Cg?
There's a lot of learning material in the DirectX world that uses .fx files to manage shaders, and .fx seems to be well integrated with 3D packages such as Maya and 3D Studio Max
What do larger ...