GLSL is a programming language for OpenGL shaders.
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 ...
0
votes
1answer
436 views
How to convert Maya shaders and Renderman shaders to GLSL?
I know this 2 products but i have never used them for production, since I have a bunch of cool shaders i would like to use them under OpenGL with GLSL but i don't know where to start.
If it's not ...
1
vote
1answer
208 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
176 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 ...
3
votes
2answers
443 views
Learning OpenGL GLSL - VAO buffer problems?
I've just started digging through OpenGL and GLSL, and now stumbled on something I can't get my head around this one!? I've stepped back to loading a simple cube and using a simple shader on it, but ...
4
votes
2answers
352 views
How Do I Raycast for a Spherical Harmonic Shader Using the iOS GPU?
I am beginning an Spherical Harmonics shader project for an iOS app I am writing. I have begun by reading this excellent in-depth paper on the subject (PDF) - http://bit.ly/aQmax3.
The paper ...
2
votes
2answers
248 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 ...
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
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
403 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 ...
2
votes
4answers
359 views
What is a right datatype in C++ for OpenGL scene representation with use of GLSL
I am programming in C++ OpenGl with GLSL. Until now I have been using a data structure that is composed of std::vector filled with structures of vertexes and with their parameters (position , normal, ...
5
votes
2answers
715 views
Sorting objects before rendering
I'm trying to implement a scene graph and in all the articles i've come across there is talk about object sorting. So you'd sort your objects by "material" for example. Now untill i sat down and ...
5
votes
1answer
729 views
GLSL, all in one or many shader programs?
I am doing some 3D demos using OpenGL and I noticed that GLSL is somewhat "limited" (or is it just me?). Anyway I have many different types of materials. Some materials have ambient and diffuse color, ...
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 ...
1
vote
2answers
564 views
Simple OpenGL program major slow down at high resolution
I have created a small OpenGL 3.3 (Core) program using freeglut. The whole geometry is two boxes and one plane with some textures. I can move around like in an FPS and that's it. The problem is I face ...
2
votes
0answers
243 views
GLSL Bokeh using Quads and Textures
I'm trying to create a depth of field effect with bokeh sprites in GLSL. Specifically, what i would like to do is, for each pixel:
See if the pixel is out of the focal range
If it is, draw a quad ...
9
votes
6answers
7k 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. ...
0
votes
1answer
225 views
What are the steps taken by this GLSL code?
1 void main(void)
2 {
3 vec2 pos = mod(gl_FragCoord.xy, vec2(50.0)) - vec2(25.0);
4 float dist_squared = dot(pos, pos);
5
6 gl_FragColor = (dist_squared < 400.0)
7 ? ...
0
votes
1answer
242 views
Correct Rotation and Translation with a 4x4 matrix
I am using a 4x4 matrix to transform verts in a shader. I multiply an identity matrix by a rotation matrix by a translation matrix. I am trying to first rotate the verts and then translate them, ...
6
votes
1answer
171 views
GLSL vertex shaders with movements vs vertex off the screen
If i have a vertex shader that manage some movements and variations about the position of some vertex in my OpenGL context, OpenGL is smart enough to just run this shader on only the vertex visible on ...
12
votes
1answer
737 views
Should I distribute shaders in a compiled form or in plain text?
Having an application that uses shaders that have been wrote in GLSL, what is the best strategy for the distribution in the real world and for the desktop and mobile?
I'm aiming to distribute this in ...
6
votes
4answers
448 views
Impact of variable-length loops on GPU shaders
Its popular to render procedural content inside the GPU e.g. in the demoscene (drawing a single quad to fill the screen and letting the GPU compute the pixels).
Ray marching is popular:
This means ...
1
vote
3answers
757 views
iOS - pass UIImage to shader as texture
I am trying to pass UIImage to GLSL shader. The fragment shader is:
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform sampler2D inputImageTexture2;
void main()
{
...
4
votes
3answers
313 views
Finding out what pixel on the screen the fragment falls on
In my 2D game, I render tiles. I want to do lighting without needing an extra buffer the size of the screen.
Either in glsl or hlsl, what could I feed to the shader each time I render a bitmap so ...
1
vote
0answers
198 views
Full screen shader causes performance hit
I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting.
To do this, I create a new bitmap each time the display resizes that ...
3
votes
1answer
734 views
Deferred Rendering and Normal Mapping
I'm working on a deferred renderer and need a bit of help getting normal maps working.
What I've been doing with them so far is just multiplying the normal texture with the object normals ...
8
votes
4answers
2k views
Debugging Shader Code?
I'm writing a game engine, and when I use a perspective camera I get a black screen. I am not going to ask exactly why this is because there would be a lot of code to share and, frankly, I think ...
2
votes
1answer
1k views
Does Macbook Air 2012 (Intel HD4000) support GLSL 1.3+?
I'm using SDL2 and GLEW on OSX Mountain Lion (2012 Macbook Air) to create an OpenGL context. Querying for the GLSL version, it reports GLSL version 1.2. I'm curious if this is a limitation of the ...
3
votes
0answers
580 views
GLSL pack floats into an RGBA texture
I want to compose conventional triangle-based models and particles with a ray-traced scene at a reasonable frame-rate.
webGL does not let you write the gl_FragDepth in the fragment shader. You ...
3
votes
1answer
1k views
Sea water shader using only fragment processor
I have a game that runs on mobile devices (OpenGL ES 2.0) and for which I would like to create some sea water using the shaders. Now, the plane on which the sea water texture will be has only 4 ...
1
vote
3answers
207 views
Shaders not linking correctly
I'm writing a rather simple "ShaderManager" which aids me with loading shaders in Open GL, altough I am having a few issues:
The shaders don't link correctly
The the attributes don't bind
Here's ...
1
vote
2answers
307 views
Lights system with shaders in OpenGL?
In more than just 1 occasion, i read about 2 ways of doing a light's system in OpenGL:
normal way? i don't know how to call this one
with the shaders ( GLSL )
The problem is i don't get the ...
1
vote
1answer
632 views
Shader authoring/editing tools for GLSL ES
Since Render Monkey has been discontinued (perhaps due to the complexity of today's shading languages), there are few successors that can match its functionality. Is there any useful tool for material ...
1
vote
3answers
281 views
Writing a shader once without using CG?
Is there a tool that can convert a fragment shader from hlsl to glsl or glsl to hlsl? I do not want to use cg since it is not able to work on mobile platforms.
Is there a tool that can make it so I ...
2
votes
2answers
428 views
Lighting problems with Terrain
I'm in the process of learning Open GL and am having issues with lighting on my Terrian, I don't know if the issue is related to how I calculate my normals or the shader itself (I am using the shader ...
10
votes
1answer
418 views
Special relativity shader in GLSL
I'm trying to implement a GLSL shader which helps understanding special relativity Lorentz Transformation.
Let's take two axis-aligned inertial observer O and O' . The observer O' is in motion w.r.t ...
7
votes
2answers
2k views
GLSL Shader Editors for Linux
Are there any good IDE's for linux that lets us edit GLSL shaders and visualize their effect?
Note : Shader Designer By Typhoon Labs is a good option but I am looking for alternatives as this ...
1
vote
1answer
919 views
GLSL - rewriting (geometry) shader from #330 to #130 version
I'm having trouble running example from:
https://raw.github.com/progschj/OpenGL-Examples/master/07geometry_shader_blending.cpp
My graphics card supports only #130 shaders version so I have to rewrite ...
0
votes
0answers
233 views
Making shaders work for both ATI and NVIDIA in Blender Game Engine
Unfortunately coding OpenGL shaders is more strict for ATI cards. I am trying to get this code from this thread http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR to ...
2
votes
0answers
199 views
Kinect User Silhouette Shader
I have this usermap from kinect's depth data (size is 320x280) and i want to display it on my game. The problem, of course it's ugly (first image) and i want to have beautiful effect like in the ...
4
votes
4answers
231 views
Shader compile log depending on hardware
I'm done with the core of my graphics engine and I'm testing it on every platform I can get my hands on. Now, what I noticed is that different drivers return different shader and program compile log ...
0
votes
1answer
277 views
OpenGL Tessellation makes point
A little problem with my tessellation shader. I try to implement a simple tessellation shader but it only makes points.
Here's my vertex shader :
out vec4 ecPosition;
out vec3 ecNormal;
void ...
0
votes
1answer
518 views
Help understand GLSL directional light on iOS (left handed coord system)
I now have changed from GLKBaseEffect to a own shader implementation. I have a shader management, which compiles and applies a shader to the right time and does some shader setup like lights. Please ...
3
votes
1answer
1k views
GLSL if-else statement unexpected behaviour
This question is related to this other one I asked a few days ago. Because I have finally get to the bottom of the issue, I have rather preferred to open a new question with a more detailed ...
0
votes
0answers
2k views
GLSL Shader Texture Performance
I currently have a project that renders OpenGL video using a vertex and fragment shader. The shaders work fine as-is, but in trying to add in texturing, I am running into performance issues and can't ...
1
vote
1answer
154 views
Blur gets displaced compared to original image
I have implemented a SSAO and I'm using a blur step to smooth it out. The problem is that the blurred texture is slightly displaced compared to the original. I'm blurring using a 4x4 kernel since that ...
1
vote
2answers
646 views
Updating texture memory via shader?
What the title says.Is it possible to update a texture via a glsl shader ? Something like :
//Read
vec4 Pixel = texture2D(TextureID,gl_TexCoord[TextureIndex].st);
//Write to texture memory ?
vec4 ...
2
votes
1answer
253 views
Build-time GLSL syntax validation
Is there a way to validate GLSL syntax build-time instead of run-time? My application takes a long time to start and I want to know at the earliest possible stage that my shaders are ok. I'm using ...
6
votes
1answer
951 views
Not getting desired results with SSAO implementation
After having implemented deferred rendering, I tried my luck with a SSAO implementation using this Tutorial. Unfortunately, I'm not getting anything that looks like SSAO, you can see my result below.
...