New answers tagged

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.


0

The problem is your multiplication code. When you do: m00 = m00 * matrix.m00 + m10 * matrix.m01 + m20 * matrix.m02 + m30 * matrix.m03; You change m00, so you are not allowed to reuse it later in that function. Same for m01 and all the other ones. Use temporary values instead: float temp_m00 = m00 * matrix.m00 + m10 * matrix.m01 + m20 * matrix.m02 + m30 * ...


0

Your z rotation is messed up, it should be negative at (0; 1), and positive at (1; 0)


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.


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 < ...


0

Use the built-in glsl function step to set any alpha value below 0.5 to 0.0. color.a *= step(color.a, 0.5);


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 ...


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

http://www.geforce.com/hardware/desktop-gpus/geforce-gtx-670/specifications Nvidia homepage says only 4.2 is supported. Check the error logs and for any other opengl error and fix them if any.


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 ...


0

I believe your problem can be solved by simply creating a Vertex Array Object for OpenGL to utilize before you create your Vertex Buffer Object. You're required to use VAOs past OpenGL 3.1 core. // In ObjectRenderInfo create your VAO GLuint vertexArrayId; glGenVertexArrays(1, &vertexArrayId); glGenBuffers(1, &vbo); ... It may help you avoid ...


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 ...



Top 50 recent answers are included