0
votes
0answers
27 views
Unity - Help Shader texture coordinate
I am making a 2D water shader. For this, I use GrabPass which works well. But I am facing an issue.
If I want to display the GrabPass texture I have to create my own texture coordinates because ...
2
votes
0answers
51 views
OpenGL Calculate Matrices
Im trying to switch from the glTranslate etc to my own Matrices, but for some reason it does not work. Here are my 2 functions to create the view- and projection matrix:
public Matrix4f ...
0
votes
1answer
44 views
Get world-position in Vertex shader
I'm wondering how I can get the final position of a vertex. I use glTranslate in my render code, and I'm not getting the world-coordinates correct. My world is devided in chunks and my position get's ...
0
votes
1answer
61 views
GLSL Shaders-> How to manage?
As your game get's bigger and bigger, you will use more and more different shader effects.
Let's take an easy example:
I have clouds in my voxel-based world, and I want to give it a blue-ish tint ...
0
votes
0answers
42 views
Unity Shader GrabPass alternative
Is there an alternative for the heavy GrabPass method ?
Is there a solution to avoid the foreground issue ? I mean when using GrabPass, if the refracted object is in front of the bumpy refractor, he ...
4
votes
0answers
181 views
+50
Optimizing performance of a heavy fragment shader
I need help optimizing the following set of shaders:
Vertex:
precision mediump float;
uniform vec2 rubyTextureSize;
attribute vec4 vPosition;
attribute vec2 a_TexCoordinate;
varying vec2 tc;
...
-1
votes
1answer
24 views
Shader applied to Texture is not showed in GLSLES
I'm trying to learn the basic of shaders following basic tutorials in Ogre.
I use GLSL ES 2.0 #version 100
I think I have a basic concept problem. I'm trying to render a model + texture without make ...
3
votes
2answers
261 views
2D water shader similar to Limbo's effect
I'm wondering how I would go about creating a 2D water shader that is seen in this video http://www.youtube.com/watch?v=phChFfi4GOs
The water effect that limbo uses is pretty awesome. I'm not so ...
3
votes
1answer
131 views
variable number of lights in a glsl shader?
I want to render an arbitrary number of lights in my fragment shader. I do not understand how you can properly pass them into the shader though. For example, I want something like this:
uniform int ...
1
vote
0answers
69 views
iPhone GLSL shader dynamic branching issue
I am trying to pass an array of vec3 as uniform and then iterate through them on each pixel. The size of array varies on situations so I can't make the loop with constant number of iterations. ...
0
votes
1answer
98 views
How to get a smooth dimming with SSAO?
I implemented SSAO in my game based on the tutorial at gamerendering.com. But the results I get are disappointing. Instead of a smooth effect as seen in the nvidia demos, my implementation causes ...
1
vote
1answer
105 views
OpenGL VBO Additional Attributes
If I have a buffer with my vertices, normals and texture coordinates, and I use glDrawArrays to draw the VBO to the screen, how can I send attributes per vertex that I placed in an array to the shader ...
2
votes
1answer
204 views
Gaussian blur filter and “shimmering”
I have a fairly bog-standard Gaussian blur filter (seperable) I'm using to make a glow effect in my pipeline. At the moment I'm rendering it only to 256x256 texture and then doing a very simple ...
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 ( ...
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 ...
2
votes
1answer
127 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
410 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
222 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
244 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 ...
11
votes
1answer
546 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
0answers
526 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:
...
5
votes
2answers
309 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;
...
1
vote
2answers
206 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
444 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 ...
0
votes
1answer
442 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 ...
12
votes
1answer
743 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 ...
5
votes
1answer
744 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, ...
5
votes
3answers
315 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 ...
4
votes
1answer
1k views
Access vertex data stored in VBO in the shader
If I wanted to store extra data in a VBO for skinning (indices for indexing into an array of matrices of bones and floats for applying weights to those bones) How would I go about accessing that data ...
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 ...
1
vote
3answers
209 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
1answer
637 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
283 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 ...
10
votes
1answer
421 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 ...
1
vote
1answer
921 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 ...
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 ...
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
200 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 ...
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 ...
1
vote
1answer
155 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 ...
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
2answers
657 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 ...
0
votes
1answer
279 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 ...
2
votes
1answer
536 views
GLSL compile error when accessing an array with compile-time constant index
I have this shader that works well on my computer (using an ATI HD 5700). I have a loop iterating between two constant values, which is, afaik, acceptable in a glsl shader. I write stuff in two arrays ...
4
votes
1answer
442 views
My GLSL shader isn't compiling even though it should. What should I investigate?
I'm porting an iOS game to Android. One of the shaders I'm using wouldn't compile until I reduced the number of uniform variables. Here are the uniform definitions:
uniform highp mat4 ...
4
votes
1answer
987 views
How to invert background pixel's color
I'm writing a game and map editor using Java and jMonkeyEngine. In the map editor, I've got a brush done by wireframed sphere. My problem is: I want to make it visible everywhere, so I want to invert ...
0
votes
2answers
489 views
Can't render to FBO using a shader
I've added functionality so that I can render to a framebuffer (for post-processing and stuff). I can successfully render to my framebuffer and then render that framebuffer, but anything with a ...
2
votes
2answers
612 views
Optimizing gaussian blur with linear filtering
There's a few (here, and here) gaussian blur tutorials out there suggesting that you can essentially cut the number of texture lookups in a gaussian blur shader in half by exploiting the GPU's ...
