S0lll0s wrote:Jasoco wrote:Davidobot wrote:-snip-
I played around last night and created a large map with a big open area in your engine and you get the same slowdown I do when viewing a lot of floor tiles. We really need to create a new shader for the floor that runs once per floor and ceiling and does the whole thing at once and possibly works the same way it does in older textured floor FPS games like DOOM and Blake Stone. I could bump my performance back up to 150+ FPS again. The textured polygon shader just isn't feasible when a lot of tiles are involved and you need a large open room.
how about baking the floor into one canvas in 2d and then drawing that as one transformed large tile?
Because the math used to calculate the 3D gets completely broken if the point is behind the camera. (Negative distance) Which causes the calculated rear points to be inverse and up in the opposite edge of the screen. Which is why you need to break it into separate tiles. Believe me, if there was a way to calculate that all properly with all four corner points being in the right place, I'd be happy.
Until we figure something out, it's going to be a terrible bottleneck. And I'm on an i7 quad-core Haswell with two threads per core and a 2GB GPU. But each textured polygon that's drawn takes a small amount of time to render and when you have to do 30-60+ each frame, it just gets slow. Combine that with having to actually calculate the grid intersection point locations as well and it gets unwieldy.
I will say however, David does do it better than I do right now. I'll be looking into mimicking his method. (He seems to only calculate the corner locations when drawing the tile while I currently have it calculating the entire grid every frame which makes it super slow when using a 64x64 sized grid. (The maximum size of a Wolfenstein level.)
Of course, making sure to not use really large open areas would help too. The less empty visible tiles means less textured polygons.