Skip to main content
41 votes
Accepted

Game loop isn't performing well enough, so my frame rate is too low (Windows Form + GDI+)

TLDR: Get DirectBitmap from https://stackoverflow.com/a/34801225 and add ...
PTwr's user avatar
  • 526
39 votes
Accepted

Does a detailed texture take longer to render?

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 ...
DMGregory's user avatar
  • 141k
19 votes
Accepted

The view matrix finally explained

Spaces and Matrices First of all, as you know, we use matrices to represent and to do coordinate transformations. They can be any of the affine transformations. That includes translation, scaling, ...
Theraot's user avatar
  • 28.2k
17 votes

Game loop isn't performing well enough, so my frame rate is too low (Windows Form + GDI+)

When things bog down, check your inner loop. That's the code being run the most often, so even a small inefficiency there stacks up. Here we see: ...
DMGregory's user avatar
  • 141k
12 votes
Accepted

How to avoid minecraft-like map to blend

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 ...
Bálint's user avatar
  • 15.1k
11 votes

What are normal, tangent and binormal vectors and how are they used?

I know this is old but i would like to add a little practical information. As stated by others but more specifically related to graphical programming. A Normal aka (a surface normal) is orthogonal to ...
WillMotil's user avatar
  • 111
8 votes
Accepted

What is the purpose of tangent and bitangent vertex attributes?

Tangent and bitangent vectors are used for tangent space normal mapping / lighting and certain forms of displacement mapping. In a tangent space normal map, we store the per-pixel normal in the ...
DMGregory's user avatar
  • 141k
7 votes
Accepted

Recreate red & cyan menu item highlight from Persona 5

For color, this is basically an additive blending: Unity has made an additive shader for the particle system, for convenience you can use it directly: For shapes, this basically draws two quads on ...
Mangata's user avatar
  • 2,796
6 votes

How do mipmapping, anti-aliasing and anisotropic filtering contribute to rendering quality?

In an ideal world, we wouldn't want them. We'd just use the same high quality textures far away and not care about wasted resources. Not really. If we forget about wasted resources and use fast ...
Ruslan's user avatar
  • 161
6 votes
Accepted

Is it possible to apply a texture to a 2D-sprite in unity 2-d?

You need to create a custom shader. The following examples are made in Unity's node based shader creation tool called Shader Graph. You need to multiply the alpha output of your character texture (...
shanji97's user avatar
  • 302
5 votes
Accepted

Space nebula cloud generation?

I've done something similar in the past through glsl's Fragment Shaders: https://www.shadertoy.com/view/lsyfWy And a Processing version: https://github.com/felipunky/Stars It is basically a ...
Felipe Gutierrez's user avatar
5 votes
Accepted

Does it make sense to do more calculations in the fragment shader if there are more vertices than pixels?

The calculation falls apart like so: If every one of those 3 million polygons rasterizes to at least one pixel on average, then doing the operation in the fragment shader still results in it being ...
DMGregory's user avatar
  • 141k
5 votes

Getting data from the backbuffer D3D11 using Map

Your code doesn't use your created texture with D3D11_CPU_ACCESS_READ. It creates a texture: ...
Chuck Walbourn's user avatar
5 votes

Why do computer graphics applications use piecewise polynomial curves of degree 3 rather than curves of higher-order, say degree 100?

the higher the degree the more parameters you have to tweak. For example for a 100 point bezier curve there are 100 points to tweak and each point affects every part of the entire bezier curve, a ...
ratchet freak's user avatar
4 votes

How to edit specific mipmap images in a DDS?

DDS support is standard in GIMP since version 2.10, plugin installation is no longer required.
魔大农's user avatar
4 votes
Accepted

Depth Intersection Shader

This issue exists with the original shader as well, but is less apparent with the sphere mesh. Notice how it looks alright when the model's vertices are close to the intersecting object. But as they ...
jhoffman0x's user avatar
4 votes
Accepted

Interesting graphic artifact

That's usually just due to non-existent mipmapping. Turn it on.
Bálint's user avatar
  • 15.1k
4 votes

How to create a decent strategy game without becoming an artist?

Your options are: Source assets that fit your needs, either from free asset collections like OpenGameArt, or by purchasing the assets you want. The downside with this method is that the selection may ...
DMGregory's user avatar
  • 141k
4 votes

How to create pixel graphics in 3D?

Some of that pixelated look might be achievable by using normal 3D rendering with low-poly models and low-resolution textures, but render to a small texture instead of the screen, then draw that ...
user137's user avatar
  • 443
4 votes
Accepted

How does cube mapping work?

So far, my understanding is that you need a direction vector, and from the direction vector we can determine the point of intersection with one of the six planes. Basically, yes. Is the direction ...
Theraot's user avatar
  • 28.2k
4 votes
Accepted

How to make player seem bigger / world smaller, without changing world coordinates

Move the camera higher up. The human brain expects to see things from the normal human eye height above the ground, about 150-170 cm. So your walls look about 4-6 metres high. Make the camera 10 times ...
Stack Exchange Broke The Law's user avatar
4 votes
Accepted

Can less than 30 FPS feel good with 60 FPS input handling?

Yes. But it depends on what you do with that input, the player, and the game design as a whole. How a game "feels" is all about feedback. I beleive this to be a consequence of the user ...
Romen's user avatar
  • 416
4 votes
Accepted

Sprite becomes blurry or jagged when camera zooms out

First, make sure your sprite/texture import format is set to RGBA 32-bit. Any other import settings apply some compression algorithms to save video memory/loading time, at the cost of image quality. ...
DMGregory's user avatar
  • 141k
4 votes
Accepted

Shader to give the effect of a 2D character covered in oil

I'd like to propose taking some inspiration from the 3D graphics / PBR world. From that perspective, the problem here is that your sprite image combines into a single color value, two different ...
Kevin Reid's user avatar
  • 5,671
4 votes

How to create colorizable vegetation albedo textures similar to Horizon Zero Dawn?

You can reverse the formula, assuming you want the "result" after colourization to look like your original texture: ...
LudoProf's user avatar
  • 784
3 votes

What is the purpose for multiple windows in games?

I can't tell you exactly why they added it, because I'm not privy to their motivations, but the most likely reason is of course that games can use it. You also asked if there is a purpose to it. ...
Jared K's user avatar
  • 131
3 votes
Accepted

Project 2D texture onto a cubemap

I think I was going about this the wrong way. I didn't need to do some unruly math to convert spherical coordinates into UV coordinates for all 6 faces, I just needed to project the quad properly. I ...
Yattabyte's user avatar
  • 1,043
3 votes

Ordered dithering between "discrete" colors?

This is a very late reply to this, you've likely sorted it out by now but for anyone else who wants an answer to your question. dithering doesn't do what you are expecting - it breaks the colours up ...
Ben Jack's user avatar
3 votes
Accepted

Strange realtime shadows in Unity3D

Just like your main rendering camera, your shadowcasting lights have a near plane. They can only see geometry that's out past the near plane - anything closer along the light's axis gets clipped out. ...
DMGregory's user avatar
  • 141k
3 votes

Midpoint displacement generating unsatisfactory terrain

The magnitude of your random displacement is not changing appropriately. For your initial points, you're using a random value between 0 and 10. But for the subdivisions you're only using a random ...
user1118321's user avatar
  • 2,642

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