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
...
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 ...
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, ...
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:
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 (...
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 ...
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 ...
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:
...
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 ...
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.
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 ...
4
votes
Accepted
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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:
...
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. ...
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 ...
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 ...
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.
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
graphics × 1068opengl × 175
unity × 116
2d × 105
3d × 102
graphics-programming × 100
java × 79
c++ × 77
shaders × 74
rendering × 73
textures × 62
xna × 57
mathematics × 49
directx × 45
c# × 42
optimization × 36
libgdx × 34
graphic-effects × 33
sprites × 32
android × 31
animation × 31
physics × 26
lighting × 25
art × 25
algorithm × 23