how this game made millions of rooms using 1 polygon

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
lately I've been playing a bunch of games that take place in large sprawling cities like Spider-Man and cyberpunk 2077 but there is one thing that's been bothering me the buildings when you look at a game like Spider-Man every single room visible within the buildings has depth and is fully furnished this blew my mind so I decided to learn how this technique works and as it turns out every single room in these buildings is completely faked using a very special technique called interior Parallax mapping but to understand what's Happening Here I want to take you somewhere a little unexpected let's go visit the 2D world of Super Mario if you've ever played Super Mario you might have seen that when Mario starts moving forward the background moves as well but at a much slower speed this trick creates the illusion that the background is further away from the camera adding a bit of three-dimensionality to an otherwise two-dimensional game this illusion technique of Shifting the environment based on the player's perspective is called Parallax and can be seen all over 2D games to fake depth just like how we use parallax in 2D games as it turns out 3D games also use parallax as well I first noticed this phenomenon when playing gen impact on PC where a lot of the ground and wall textures had a lot of depth and shaped them from pretty much any angle you could view it from so what is going on here how is the geometry getting shifted this is where height maps come in a height map also known as a displacement map is a 2d grayscale texture representing the depth of the image at a fundamental level displacement Maps can be used to shift geometry up and away from the surface giving textures real height and geometry the downside is this is extremely expensive as it takes tens of thousands of polygons to make these textures not look blocky so instead of displacing the geometry game developers can use these same height maps to simulate the displacement of the geometry for just a fraction of the cost this technique is called parallel relax mapping here's how it works to determine how The Parallax texture is rendered we can use the image's height map and the player's viewing direction to calculate which surface Parts would be visible based on where the player is looking this is accomplished by shooting a line called a vector from the player's camera to the polygon surface now imagine this line piercing the mesh's surface and traveling until it hits where the height map says the texture exists so instead of showing you the flat surface the geometry is offset from the camera according to the height map not creating actual displaced geometry but a virtual approximation of what this displacement would look like and that is why this ground texture ingention impact looks like it has depth at pretty much every angle you view it from it's completely flat geometry is being displaced virtually by a height map Parallax mapping can be used for many other cool tricks in video games and is used all over your favorite games most likely without you ever noticing if you're interested in learning how to create Parallax mapped Textures in an Unreal Engine I've added a full tutorial to my patreon where I teach you how to easily turn your textures into Parallax ones so if you're more serious about learning game art go check that out so that is how Spider-Man gives its rooms depth using Parallax textures okay guys see you next video wait we're still missing something up until now we've only been talking about a single texture a wall and a few floors here and there but these rooms have a ceiling a floor and three walls a single height map won't work so what the hell is going on here I think it's finally time to introduce you to the final piece of the puzzle cube Maps a cube map is a single texture of six images stitched together to form an environment these Cube maps are commonly used for Sky boxes but these Cube maps are static and don't move based on the player's perspective by taking the floor ceiling and wall textures and placing them into a cube map we can then use an algorithm to Parallax the Q map on a fake window so the room shifts and moves based on the player's perspective faking an entire room using only one texture and a single polygon this explains why if you look closely the Interiors of the rims of Spider-Man are completely flat textures all it is is a cute map texture that's been repurp and Parallax on a single flat plane we have all been bamboozled this may look a little strange when you look at it up close but when flying through the city at high speeds interior Parallax mapping turns out to be a graceful cheap solution that makes the cities in games like Spider-Man Payday 2 SimCity Forza 4 and even Farming Simulator Seymour alive even though all of these windows are completely flat meshes so yeah Parallax mapping is pretty cool
Info
Channel: Stylized Station
Views: 2,203,298
Rating: undefined out of 5
Keywords:
Id: eX7x1mJrQJs
Channel Id: undefined
Length: 4min 57sec (297 seconds)
Published: Mon Oct 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.