New answers tagged

4

It's important to note that glxinfo -v only reports the supported values for the default OpenGL framebuffer, the one that represents the visible screen itself. It's common for other configurations (ones not reported by glxinfo) to be supported in offscreen framebuffer objects (FBOs). As you've noticed, most video cards do not support a 32-bit depth buffer ...


0

The Phong model (diffuse + specular + ambient) is just an approximation of how light behaves. In reality, there's what's called a BRDF or bidirectional reflectance distribution function. It is a function which tell you, for a given point on the surface the probability of light bouncing in a given direction given an incident ray of light. The components ...


-2

If you are starting with 2d I would suggest looking in to pixle art. I have found it a lot easier to make and a lot easier to find people who do it. I can suggest reddit to fund some awesome stuff. Or search around through some forums. There may also be forum for what you are looking for so I would try searching key terms like "hero art forums" or "hero art ...


0

I don't know about using a KD Tree for this but to find holes in a triangular mesh you must find all the border edges of the mesh which belong only to one triangle. One algorithm would be to iterate over every edge of the mesh and maintain a set of border edges. For every edge, if the edge is not in the set, then add it. If the edge is already in the set, ...


0

So, as you know, readimagefile displays an image to the screen by reading it off the disk, and on some systems, it apparently only ever reads it from the disk without caching the image. So, what we need to do is move calls to readimagefile out of the loop and into some initializing portion of the code. You mentioned getimage and putimage in your question, ...


1

To render a cross-hair, all you would need to do is render a piece of geometry using just a screen-space transformation, followed by the projection matrix. Mapping the identity matrix as your view will do this for you. A view matrix allows us to transform vertices into view space; removing this step allows us to go directly from model-space to screen-space. ...


0

In addition to Philipp's answer: Typically, you'll try to minimize the scaling done to your images, as the renderer may not be doing a good job in pixel interpolation/stretching. So what you can do is have multiple size images for your character, that you do yourself offline: you'll see the result right away and you'll be able to either improve the image ...


2

Just draw them larger. Also don't hesitate to have the sprites overlap vertically. The sprites are rendered from a 45° angle, so it is just natural that the soldiers in the front-row overlap the lower bodies of the soldiers in the row behind them. All you need to keep in mind in that case is that you need to draw them in the correct order from back to front. ...


0

opengl-tutorial has: a tutorial http://www.opengl-tutorial.org/intermediate-tutorials/billboards-particles/billboards/ focused on energy bars OpenGL 3.3+ WTF licensed code that just works: https://github.com/opengl-tutorials/ogl/blob/71cad106cefef671907ba7791b28b19fa2cc034d/tutorial18_billboards_and_particles/tutorial18_billboards.cpp Screenshot: ...


0

Your bullet list reads increasingly more efficient as you go. This should probably be taken as a hint on how to realistically get this done. The last thing you really want to be doing is modifying vertex data in the middle of a frame, you will stall the render pipeline if you do not have enough unfinished frames queued up by the driver already. Having all ...


0

Basically, the idea is to spread out the error to adjacent pixels. Let's take a grayscale image for simplicity (for RGB you'd just do the same thing for each channel), and say you had an 8-bit pixel value (255 max) of 116 that you want to scale to 4-bits. The closest 4-bit color (15 max) would be 116*15/255, which rounds to 7. This, expanded back to 8-bits ...



Top 50 recent answers are included