501 reputation
28
bio website josephmansfield.uk
location York, United Kingdom
age 23
visits member for 3 years, 4 months
seen Jul 16 at 8:28

Apr
21
comment XNA Diffuse Shader Issue. Edge lighting problem. Image Attached
Looks to me like some of your normals are probably pointing backwards. Remember that the cross product is anticommutative, which means that if you swap the two vectors your applying it to you'll get a negated result.
Apr
18
comment What dimensions should you use for a perspective projection frustum?
@MarkIngram That's the nature of 3D rendering. Games typically allow the player to adjust the FOV, because the most comfortable FOV depends on the size of their display and their distance from it. The comfortable FOV for a smaller or further away display will give a smaller view of the game world, simply because the player is effectively looking through a smaller window into that world. You could do the maths to ensure that all objects are placed within the frustum, but that means that a smaller FOV will squash the objects together.
Apr
18
comment What dimensions should you use for a perspective projection frustum?
@MarkIngram You can place them anywhere, but they will only be seen within a vertical FOV of 45 degrees and between 1 unit and 100 units away from the camera. You need to choose your units however you like them. If the units are meters, then the frustum will cover 100 meters. Where you place your objects depends on where you want them to appear in the viewport (and how far away).
Sep
11
comment do games use multiple threads to play music?
Some games will, some games won't. I know I've noticed more often than not that when a game freezes the music just stutters.
Aug
27
comment Game Trailer Reference other Games
Trademark law varies per country but generally says that it's fine to use a trademark to identify products as those of the proprietor as long as you aren't attempting to confuse or deceive anybody. To be safe, you can place a ™ character next to the names and state at some point in your trailer "Pokémon is a registered trademark of Nintendo Co., Ltd.", for example. Of course, your safest bet is to speak to a lawyer in your country.
Aug
25
comment Why don't we use the whole color depth for normal maps?
@danijar It's because the values in the normal vector can range from -1 to +1. If -1 maps to 0, and +1 maps to 255, then 0 maps to 128. So (0, 0, 1) maps to (128, 128, 255).
Aug
24
comment Why don't we use the whole color depth for normal maps?
@danijar The full color depth may very well be used by a surface. It would be a very, very bumpy surface. It's just that almost all realistic surfaces are almost flat. Yes, those harsh values are not commonly used in normal maps, but if you took them away, you wouldn't be able to represent every set of normals.
Aug
24
comment Why don't we use the whole color depth for normal maps?
@danijar What do you mean by blank? There's no such thing as a blank normal. A normal is always pointing in some direction. When the normal is pointing directly away from the surface (i.e. all normals in a flat surface), you get the color (128, 128, 255), which is the light blue you're probably referring to. It's half way between full blue (0, 0, 255) and white (255, 255, 255). See the corners of this image for an example.
Aug
24
comment Why is it possible to encounter a texture coordinate greater than 1 or less than 0
@sepideh Of course. OpenGL uses whatever values you give it. If you give it values in the range 0 to 1, you will never get anything else.
Aug
24
comment Why is it possible to encounter a texture coordinate greater than 1 or less than 0
@sepideh What does "not a run-time possible event" mean? It's perfectly fine to change your code in the comment to have glTexCoord2f(0, 2); for example. This has a very specific well-defined meaning in both code and when the program is running. If you see this, the programmer has intentionally done it because it gives the result they want.
Aug
22
comment Move a player in the opposite direction they are looking
@thedeadlybutter If you have a camera direction vector (x,y,z), the opposite direction is (-x, -y, -z).
Aug
22
comment Move a player in the opposite direction they are looking
Is it a first person game?
Aug
21
comment Can't get indices with VBO working
vboBufferId = indicesBuffer; - is that really supposed to be vboBufferId? Not something like indicesBufferId?
Aug
18
comment OpenGL additive blending not working as expected
I'm quite curious why you expect additive blending of red colors to go to yellow and white. I think it would help to see your thought process. Is it because you see white as what you get when you add all color together, and you see yellow as halfway between red and white? You need red, green, and blue added together to end up with white - not just red. Also, yellow is not a lighter red. A lighter red is a pinkish color. Yellow is in fact what you get if you mix red and green light together.
Jul
30
comment How do I position a 2D camera in OpenGL?
@Elfayer You're misunderstanding glLookAt. It is for looking at a particular point in the world. You are making it look at point (0, 0, -1) which is always the point next to the corner of your map. It is not a direction (and if it were, it'd be the wrong direction). It doesn't matter where the camera is moved to, it will always look towards that point. The problem here is that you don't want to look at a particular point all the time, you want to look in a particular direction, so you should be using glRotate. You want to make your camera look down the y-axis.
Jul
30
comment How do I position a 2D camera in OpenGL?
(Oh, in this case it won't matter, because your glTranslatef doesn't do anything)
Jul
30
comment How do I position a 2D camera in OpenGL?
You should not be doing the glTranslatef and gluLookAt on the GL_PROJECTION stack. They are setting up the view, so they go on the GL_MODELVIEW stack. I believe the gluLookAt should also come before glTranslatef.
Jul
29
comment Drawing game objects that are bigger than tiles
Your for loops seem pretty unnecessary. Can't you just have if (object.visible(firstX, lastX, firstY, lastY)) which then just does if (x >= firstX && x <= lastX && y >= firstY && y <= lastY)? In addition, your visible function could just be return <condition here>;.
Jul
5
comment How would you implement chromatic aberration?
You may also want to implement chromatic aberration to counter any aberration caused by a lens through which the game is being viewed. For example, it is a good idea to have chromatic aberration at the edges of the view in a game played with the Oculus Rift.
Oct
5
comment How does one save a procedural world?
@Random832 Minecraft does save the world in a binary format, rather than regenerating it from the seed and replaying the modifications. To get around the problem of saving the entire world, Minecraft only saves the chunks that have been generated so far. As you further explore the world, your save game becomes larger.