All Questions

6
votes
4answers
6352 views

How to render depth linearly in modern OpenGL with gl_FragCoord.z in fragment shader?

I read lots of information about getting depth with fragment shader. such as http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=234519 but I still don't know whether or ...
3
votes
2answers
1319 views

Normal mapping gone horribly wrong

I tried to implement normal mapping in my opengl application but I can't get it to work. This is the diffuse map (which I add a brown color to) and this is the normal map. In order to get the tangen...
2
votes
0answers
898 views

ray and ellipsoid intersection accuracy improvement

I need to enhance precision for function in one of mine Atmospheric scattering GLSL fragment shader which computes the intersection between single ray and axis aligned ellipsoid. This is the core fun...
129
votes
8answers
117821 views

Random / noise functions for GLSL

As the GPU driver vendors don't usually bother to implement noiseX in GLSL, I'm looking for a "graphics randomization swiss army knife" utility function set, preferably optimised to use within GPU sha...
14
votes
1answers
1176 views

Should I ever use a `vec3` inside of a uniform buffer or shader storage buffer object?

The vec3 type is a very nice type. It only takes up 3 floats, and I have data that only needs 3 floats. And I want to use one in a structure in a UBO and/or SSBO: layout(std140) uniform UBO { vec4 ...
2
votes
1answers
2175 views

How to implement 2D raycasting light effect in GLSL

This was originally asked by @sydd here. I was curious about it so I try to code it but It was closed/deleted before I could answer so here it is. Question: How to reproduce/implement this 2D ray cas...
29
votes
5answers
15811 views

Why transforming normals with the transpose of the inverse of the modelview matrix?

I am working on some shaders, and I need to transform normals. I read in few tutorials the way you transform normals is you multiply them with the transpose of the inverse of the modelview matrix. B...
13
votes
2answers
5739 views

How do you pack one 32bit int Into 4, 8bit ints in glsl / webgl?

I'm looking to parallelize some complex math, and webgl looks like the perfect way to do it. The problem is, you can only read 8 bit integers from textures. I would ideally like to get 32 bit numbers ...
4
votes
3answers
1788 views

How to recover view space position given view space depth value and ndc xy

I am writing a deferred shader, and am trying to pack my gbuffer more tightly. However, I cant seem to compute the view position given the view space depth correctly // depth -> (gl_ModelViewMatri...
172
votes
5answers
58808 views

What is state-of-the-art for text rendering in OpenGL as of version 4.1?

There are already a number of questions about text rendering in OpenGL, such as: How to do OpenGL live text-rendering for a GUI? But mostly what is discussed is rendering textured quads using the ...

Previous Next