![]() ![]() ![]() This seems like an ideal use case for shaders: make a single, straight road model once, then let the GPU shift the vertices left or right, instead of constructing a brand new model each step. ![]() I've tried to streamline it as much as possible, but it's still not a particularly fast process my PC can handle it, but I worry about slowdown on lower-spec machines or consoles, especially as the game gets more complicated. It all looks great, but the road model needs to be re-made each frame, as all the vertex positions need to change each time the player moves forwards or backwards. Instead of projecting the segments with stretched sprites like I did in this game, I'm using that information to create a vertex buffer and drawing that with a shader. The road is made up of segments, and starting at the segment closest to the camera, we skew the segments slightly left or right according to how much that segment curves and the accumulated skew of each previous segment. I'm working on a driving game that uses a combination of modern-ish 3D rendering and old-school pseudo-3D. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |