Tag Info

Hot answers tagged

7

Not really. Use vertex buffer objects. There can be perfectly efficient for large numbers of small triangles. The thing is that you don't want to make one VBO per quad, but rather few VBOs into which you stuff multiple quads.


4

No. You can use the GL_QUADS primitive type instead of GL_TRIANGLES and draw four vertices instead of three. But even with this, OpenGL will internally render with triangles.


2

SFML 2.0+ makes it even easier to load a texture; sf::Texture texLid; std::string image2="images/top.jpg"; if (!texLid.loadFromFile(image2)) { std::cout << "Could not load" << image2; char c; std::cin>>c; return false; } glEnable(GL_TEXTURE_2D);//tell OpenGL to use textures when drawing ...


2

It depends on the implementation of the multiply operation. The internals will suppose an ordering within your matrices, row major or column major. If the ordering of your matrices is arranged the way the function expects them, then it is up to the second dpendancy: namely the respect of the correct mathematical commutativity. (which they should) When you ...


1

This isn't a trivial task for someone new to graphics programming, I'm assuming you know how to write fragment shaders and sample textures. To convert the Bayer image to an RGB texture you'll want to point sample the monochrome Bayer image, and do the interpolation in the fragment shader. For each destination pixel, you'll know the value of one channel - ...


1

just append the data and adjust the indices: if the hilt has X vertices and the blade has Y then you first put the X vertices of the hilt and then put the vertices of the blade. Do the same for the indices but add X to each index of the blade. This will then force you to use only a single texture for the entire model.


1

You can use instancing and a texture atlas to combine all the draw calls into a single one. You only have a single 4 vertex VBO with the 4 corners 0,0 0,1 1,1 1,0 and an index buffer to draw them using GL_TRIANGLES. Then in a separate VBO you have the position and size of the quad (in a single vec4) and the position and size of the texture to use in the ...


1

I had forgotten to ask for a depth buffer when creating my window: Before: Display.create(new PixelFormat(4,0,0,4)); After Display.create(new PixelFormat(4,24,0,4));


1

I found a great resource for comparing what specific APIs are available across different versions of OpenGL/WebGL/OpenGL ES. I think you will find what you are looking for, here: http://web.eecs.umich.edu/~sugih/courses/eecs487/common/notes/APITables.xml



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