I found a solution to this. The objective was to use the same blurring shader for color textures and depth buffers. To extend the shader to also allow blurring of depth buffers, I simply added the...
Type: Posts; User: Kopelrativ
I found a solution to this. The objective was to use the same blurring shader for color textures and depth buffers. To extend the shader to also allow blurring of depth buffers, I simply added the...
I don't understand. If I attach it as a depth buffer, I can't use the current blur filter that blurs a color buffer, can I?
I have a shader that does a two pass Gaussian blur on a GL_RED texture. Now I want to blur a depth buffer. Is it possible to use a FBO with the output to a depth texture in GL_COLOR_ATTACHMENT0? It...
Thanks, that nailed the problem! I thought the mipmaps would be accessible regardless of the minification filter.
And thanks also for the other comments, now I understand a little better how this...
I have a texture drawn in a quad. The texture has mimaps attached to it. I access the texture the usual way, with
texture(sampler, coord);According to the specification, A third argument can be...
Thanks, I see what you mean! And you are right of course. The reason is works for me is that I don't do the perspective divide (using orthographic projections).
The simplification should still be...
You can't remove data with glBufferSubData, you can only replace one set of data with another set.
You should use a transformation phase. Transform from a chunk data into a list of visible surfaces. For example, it is no use to draw quads from cubes facing in a direction where there is another...
It should be equivalent? Good enough for me to use it, and it is working.
Doing multiplication or division with a scalar on a vector is done piecewise.
Whether the compiler can do the...
You seem to be in for an unusually stubborn situation. I think everyone doing OpenGL has been through this, and sometimes you see the mention of the "black screen of death". There are just too many...
As Dark Photon mentioned, you've got the wrong matrix order. It should be
(COLUMN MATRIX)[x,y,z,w]=[bias matrix]*[projection matrix of light]*[view matrix of light]*[object of world...
The OpenGL program is a global state, and only one program can be active. So if you have more than one program, then you need to enable each of them every time you use them.
There is some overhead...
Definitely start with only one shader.
You can then do measurements to find if it is a performance problem. The test is simple, run the shader without updating the uniforms, and compare the time....
In general, see many good ideas at http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/.
Specifically, yes, there are ways to get a dynamic bias. In principle, you want...
I think the best practice is to not use multi threading for OpenGL. That is, only one thread is needed to keep the graphics card busy too 100%, and so you can't gain any FPS by using more than one...
Shearing and scaling can be done with a 3x3 matrix. Also rotations, but not perspective scaling. The following matrix
a 0 0
0 b 0
0 0 c
will scale 'x' with a, 'y' with b and 'z' with c....
There is one way to work around this, and that is to use glPolygonOffset. See also http://stackoverflow.com/questions/7836208/how-to-correctly-render-coincident-polygons-in-opengl-es.
Maybe this...
I had a deferred shader updated with tile based lights. For each light, I created a quad that will precisely cover the light. It is positioned correctly in z, to make use of depth culling. The...
There is the technique of using a deferred shader. It may be overkill, or it maybe what you want. In principle, you do the rendering in two steps (or more). You define a Framebuffer Object with...
There is a reference implementation, see https://github.com/progschj/OpenGL-Examples/blob/master/01shader_vbo1.cpp
It is a complete single file minimal OpenGL program that draws with a color.
As a complement to measuring CPU time, use a query to measure the time as reported by the GPU. But be careful about asking for the result, as it may stall the pipeline. One way is to do something as...
Thanks for the suggestion, that solved the issue!
I suppose that is why I only had the error with Intel, being of version 3.1.
The diffuse color is the material property. If you shine with a white lamp on this material, all colors brighten. That is done by multiplying the RGB values with the same constant (usually depending...
I am setting up a shadow map, as follows. But I get the error GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER. I am using a draw buffer, not a read buffer, how should I interpret this?
Also, the...
Deleted, I was too late :-)