A programming language for OpenGL shaders.

learn more… | top users | synonyms

6
votes
3answers
502 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 ...
6
votes
2answers
3k 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
528 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
1k 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
518 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
382 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
3k 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
736 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
4k 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 ...
22
votes
4answers
6k 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 ...
36
votes
1answer
4k 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
3k 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
923 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
912 views

Sampling from depth texture causes shader to stop working [closed]

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
1k 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
1k 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 ...
0
votes
2answers
876 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
502 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
303 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 ...
1
vote
2answers
5k 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 ...
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. ...
8
votes
1answer
297 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 ...
8
votes
4answers
486 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
766 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 = ...
8
votes
1answer
20k 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
381 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
258 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 ...
3
votes
1answer
2k 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 ...
4
votes
2answers
1k 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
1k 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, ...
5
votes
1answer
741 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
1k 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 ...