Hot answers tagged

3

Yes and no. Yes, generally: the convolution operation is usually very computationally heavy and if you are sampling 7x7 area, that is 49 times more samples than you would usually do. No, in your case: One important thing about FPS is that it is inverse of a function. Because with 5000 FPS the time to render a frame is 0.20 ms and with 1500 FPS it is 0.66 ...


2

No. The size of the array has to be a constant. Specifically from the GLSL specification: 4.1.9 Arrays ... When an array size is specified in a declaration, it must be an integral constant expression (see Section 4.3.3 “Constant Expressions” ) greater than zero.


2

There's really not much room for optimization here, having divergent branches over such a small if body is probably not affecting your performance really at all. You could use something like discard which might convey your intention better, but ultimately will not change your performance. Taking from this post, here's an example usage. if (color.a < ...


1

The screen coords go from {-1,-1} to {1,1} but you are most likely feeding it {0,0} to {1,1} - hence the fact that only one-quarter of the screen gets rendered. So just to be clear - point {0,0} is not the top-left (or bottom-left, depending on your co-ordinate system) point; it's the center. This also explains the texture coord tranformation that you are ...


1

To do that you simply call glDisable(GL_DEPTH_TEST); before drawing your GUI and after drawing your scene/screen. That way, you draw your GUI on top of the scene and is unaffected by depth test. For the shader, i think a basic shader will do. I hope i remember it correctly.


1

I found a paper from Epic Games on how they do their area lights - relevant info starting on page 16. Essentially, you find the shortest distance to the line segment that defines your light source, and use that as the source of a light - in their case, a point light, but you could easily use your spotlight instead. They also use a calculation for the ...


1

Main Question: Is there a specific way of setting up and rendering OpenGL for NVIDIA Graphics so that it renders properly, and not a black screen? NVIDIA graphics cards are no different from any other cards seen from an OpenGL perspective. Different behavior on different platforms may exist as a result of: - Different capabilities. Some cards may ...


1

Unity's ArasP has written an optimizer that could possibly do what you need: https://github.com/aras-p/glsl-optimizer You could also save the driver's compiled shader binary using OpenGL extension GL_ARB_get_program_binary on the first run and use it on subsequent runs to reduce loading hitches. The binary is hardware and driver dependent so you can't ship ...



Only top voted, non community-wiki answers of a minimum length are eligible