We changed our privacy policy. Read more.
82

Ambient light is a light type in computer graphics that is used to simulate global illumination. Ambient occlusion is simply a simulation of the shadowing caused by objects blocking the ambient light. Because ambient light is environmental, unlike other types of lighting, ambient occlusion does not depend on light direction. As such, it can be pre-computed ...


52

This lets the user choose the game's quality versus its performance. Some prefer higher-quality graphics settings on a lower resolution, others the opposite. Some computers can handle maximum settings on everything, some can't. Devices with homogenous hardware (PlayStation, Xbox, iPhone...) usually don't offer graphics settings for this reason.


49

There is a very simple way achieving this with shaders, you need three* textures: empty health bar, health bar texture and mask with gradient of health distribution with one extreme(e.g. darkest not black or most transparent alpha value) on one end and the other on other end. It is best shown on image, I am currently unable do draw curved gradient only ...


43

Yep, you're not the first person to notice this. :) With today's high contrast ratios, 8 bits per component is not enough to make a smooth gradient without visible banding - unless dithering is used. Using more than 8 bits per channel on a display is called "deep color" by display manufacturers. It isn't very widespread because of a chicken-and-egg ...


40

Digital colors can be made up of three components: red, green, and blue. Combine these together, and you get final color, eg. yellow is 100% red, 100% green and 0% blue. The fourth component is, as you mentioned, transparency. Together, these form the tuple RGBA (red, green, blue, alpha) which represent an image. Now, instead of pixels, think about it ...


40

I think a lot of the answers miss an important point: you can write apps that access hardware directly, but not on modern operating systems. It's not just a time problem, but a "you don't have a choice" problem. Windows, Linux, OSX, etc. all ban direct hardware access to arbitrary applications. This is important for security reasons: you don't want any ...


39

Like most things in game development, and especially in game graphics, the answer is "it depends" Texture Size The resolution of your texture can have an impact on rendering speed. The more pixels it contains, the more raw data there is to upload to the GPU, and the less of the texture we can fit in cache at a time, so the shader might hit more pauses ...


36

I don't think any of the other answers here will achieve the effect in Pokémon X/Y. I can't know exactly how it's done, but I figured out a way which seems like pretty much what they do in the game. In Pokémon X/Y, outlines are drawn both around the silhouette edges and on other non-silhouette edges (like where Raichu's ears meet his head in the following ...


34

Implemented mathematically, as a pixel shader: On the CPU, calculate HealthDirection and its' dot product with V2 On the GPU, calculate a normalized direction away from the centerpoint for each pixel. Compare each dot product to HealthDirections' to choose whether to shade "background", or in color. If you "inverted" this algorithm and worked from the ...


29

There is no way to completely reliably detect the correct screen resolution. One approach is to simply leave at the user's desktop resolution. This is annoying, as I know a number of people (some with visual impairments) who prefer to run their desktop at a lower resolution to make things look larger, but still prefer games at the native resolution where ...


28

Practically its necessary, yes. It's necessary because unless you want to spend years writing what is essentially driver code for the multitude of different hardware configurations out there, you need to use an API that unifies against existing drivers written by GPU vendors for all popular operating systems and hardware. The only realistic alternative is ...


26

The physical basis of the colors of an oil slick is iridescence, and also related to Newton's rings. Specifically, the thickness of the oil layer is on the order of the wavelength of light. Since light reflects from both the top and bottom surface of the oil, at any given wavelength, at some angles the two reflections will be out of phase and cancel each ...


23

Yes, To name a few: Pannini Mercator Fisheye Miller The Pannini projection, for example, can capture wide fields of view in nice ways. (totally just my opinion) I think implementation details would be beyond the scope of this specific question. EDIT: Thanks for the comment, I did misspell Pannini. And to make this edit worthwhile here are a few more: ...


23

There are two main benefits: First, if you downsample by more than a factor of two, some pixels in the original image will have no impact on the result image. Using GL_LINEAR, each destination pixel will only sample from at most 4 pixels from the source image; the other pixels simply get discarded. By downsampling by a factor of two, you ensure that each ...


21

My 1988 version of Dangerous Dave was the Apple II version. The scrolling was done by moving all the screen bytes over then drawing a new tile on the edge of the screen - repeat 20 times for a full screen shift. The Apple II version was written all in 6502 assembly language. On the PC, the 1990 version, I wrote graphics code in 80x86 assembly language for ...


20

There does exist a flavour of Wavefront's *.obj that facilitates Vertex Coloring.. I know of two applications that can export these namely "MeshLab" (free) and "MeshMixer" (also free from Autodesk).. The vertex colours is actually found just after each vertex definition as shown below.. (Piece of *.obj) #### # # OBJ File Generated by Meshlab # #### # ...


19

You more or less said it yourself: 'I know, that would be a lot of work and a lot of hardware would have to be replaced.' While the graphics-hardware end of things would actually be relatively straightforward (if expensive - doubling the size of all textures and frame buffers is far from trivial), the 'ecosystem' for higher color-depth imagery simply isn't ...


18

You can absolutely use the GPU to render volumetric data. Since you want to evaluate a set of functions per pixel on the screen, a simple approach is to render a full-screen triangle. This is just a single triangle that covers the entire screen (actually, it covers more than the screen, since the screen isn't triangular, but the parts off-screen are ...


17

That does not appear to be using any kind of specific flat-shading approach, at all. The shading is smooth, though the projected shadows are hard-edged, and the objects are not rounded. The specific lighting effect appears to be a combination of ambient occlusion (probably SSAO, "screen space ambient occlusion") which is what gives it that soft shadowing ...


16

You can use the parametric equation as marked by Krom. To understand why we used this formula you have to understand what the equation is. This equation is derived from the Parametric equation of circle. Considering the circle is drawn with the center on the origin (O) as shown in the diagram below If we take a point "p" on the circumference of the circle,...


15

It depends on what you mean by "that could be used in a 3D system such as OpenGL". :) Narrowly speaking, 3D graphics hardware and APIs like OpenGL only deal correctly with linear projections - projections that map straight lines in world space to straight lines on the image. They never distort something into a curved shape (unless it was curved to begin ...


13

It's also worth noting that many LCD panels aren't even 8 bits per channel. The cheaper ones tend to use less bits and use various tricks to try to hide it. For example they might switch rapidly between two adjacent colours to represent the one in between. http://www.anandtech.com/show/1557/3 There's some details on how DXGI supports 10-bits per channel and ...


12

This is orthographic projection plain and simple. You can see this by the fact that all lines, especially the horizontal ones are perfectly parallel. Addendum: The comments are correct, this is isometric projection, which is a special case of the orthographic projection.


12

There's a number of pieces to this puzzle, each of which will provide a deep and interesting rabbit hole of exploration. Some of them are: Level of Detail -- automatically (or "manually") choosing detailed or simplified models, or even sprites or just dots, or for objects as they are further away. Culling -- choosing to only draw what's needed. This might ...


12

There are two easy ways to solve this. What minecraft does is use a pseudo ambient occlusion. This essentially creates a shadow around ledges, making them visible from any angle. It can even highlight the edges with the plainest blocks in the game: If you want to implement this, there's a nice tutorial about it here. You can basically make any corner ...


11

To the simple question of "can you use a projection matrix" to do this, the answer is no. The reason is that a matrix multiplication can only result in an linear or affine transform that maps lines to lines, whereas you're looking to map a line to a curve. To the question of "how do I implement a fisheye projection", see: How do I create ...


11

I tried to duplicate the effect by using shader. Shader00 Center : https://www.shadertoy.com/view/XsXSz2 Shader01 Sides : https://www.shadertoy.com/view/4sXSz2 :) you could, as Byte56 said, set up three planes. A plane facing camera directly forward with Shader00, and then two plane with Shader01, perhapss as RandyGaul mentioned, top/bottom non uniformly ...


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