A programming language for OpenGL shaders.

learn more… | top users | synonyms

5
votes
2answers
826 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 ...
3
votes
0answers
914 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 ...
4
votes
1answer
489 views

Phone complains that identical GLSL struct definition differs in vert/frag programs

When I provide the following struct definition in linked frag and vert shaders, my phone (Samsung Vibrant / Android 2.2) complains that the definition differs. struct Light { mediump vec3 ...
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
877 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 ...
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_ = ...
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
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 ...
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 ...
1
vote
1answer
234 views

Can you have shader variables that vary per primitive?

A shader normally has values that vary per-vertex and values that vary per-fragment. Can you have values that vary only per primitive, such as per-triangle or per-quad?
11
votes
6answers
12k views

OpenGL ES 2.0: Repository of Quality Shaders

Could I kindly ask, to suggest me a repository of high quality OpenGL (OpenGL ES 2.0) vertex and fragment shaders, please? I am looking for pixel based ligting shaders (such as phong) and simmilar. ...
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?
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
767 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 = ...
16
votes
2answers
7k views

Is there a successor to RenderMonkey? [closed]

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?
0
votes
1answer
1k views

Formula for replicating glTexGen in OpenGL ES 2.0 GLSL

I also posted this on the main StackExchange, but this seems like a better place, but for give me for the double post if it shows up twice. I have been trying for several hours to implement a GLSL ...
5
votes
3answers
4k views

how to add water effect to an image

This is what I am trying to achieve: A given image would occupy say 3/4th height of the screen. The remaining 1/4th area would be a reflection of it with some waves (water effect) on it. I'm not sure ...
8
votes
1answer
21k 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, ...
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. ...
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 ...
1
vote
1answer
338 views

OpenGL 3 and the Radeon HD 4850x2

A while ago, I picked up a copy of the OpenGL SuperBible fifth edition and slowly and painfully started teaching myself OpenGL the 3.3 way, after having been used to the 1.0 way from school way back ...
5
votes
1answer
2k views

Morph a sphere to a cube and a cube to a sphere with GLSL

I'm getting started with GLSL with quartz composer. I have a patch with a particle system in which each particle is mapped into a sphere with a blend value. With blend=0 particles are in random ...
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 ...
38
votes
6answers
16k views

What are the pros and cons of HLSL vs GLSL vs cg? [closed]

What are the pros / cons of the three?
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 ...