Salt Miner Posted January 5, 2022 I always thought that all OpenGL did with source ports was add in filtering and speed things up, but after paying closer attention to the freelook option I found that its vastly different from the y-shearing style of freelook that retro fps games added in to various degrees of success (if at all). With y-shearing the game just literally moves everything up or down and although its find for small angles below/above horizontal, looking too far up or down causes things to look far too distorted. However, the freelook and OpenGL, not just with source ports with Doom, but also other games like Duke 3d and even Ion Fury, gives a proper perspective (it has a vertical fov as well as a horizontal fov), it looks right, and we can look all the way up or down and the floors and ceilings don't look distorted. Is there something unique about OpenGL that allows the game(s) to be like that? Or is it just because OpenGL uses the graphics card so it can perform the very many needed computations in order for the effect to take place? Could the use of multi-threading on modern CPUs perform the same effect? 0 Quote Share this post Link to post
Quasar Posted January 5, 2022 The software Doom renderer draws walls as vertical strips of constant z depth called columns. You can move the starting point of those columns up and down, but you cannot make them "pitch" toward or away from the viewer as that would imply that they no longer have constant z depth, and you would not be able to draw them as a simple line of pixels down the screen any longer - they would have to taper off in one direction or the other. So instead, shifting the start point causes a form of distortion that's about the same as an oblique projection, as the angle of the walls remains parallel to the world z axis regardless of the frustum. A renderer fully rewritten to use OpenGL, or any 3D graphics API, and not of the "render to texture" variety, is using hardware 3D geometry primitives to represent walls. These are polygons (usually triangle strips) made up of vertices transformed into screenspace using 3D matrices. They can occur in any possible combination of 3-space angles relative to the camera as they are rasterized by the hardware in a very generic way that can be used to draw any closed and clipped polygon. 5 Quote Share this post Link to post
Edward850 Posted January 5, 2022 (edited) Basically, hardware rendered ports (such as with OpenGL) is typically done by rendering the level with actual polygons, allowing for a perspective correct camera. This allows looking at the geometry at any angle (roll, pitch and yaw) as you've observed. Meanwhile Doom's original renderer (dubbed the "Carmack Renderer") was designed to only be algorithmically correct at one angle, the camera pointed straight at the horizon. Any variance from that wasn't properly supported by the perspective rendering of either the walls or the floor/ceiling, leading to distortion. The floor/ceiling textures flood the screen at one specific angle until they would (hypothetically) reach the center of the screen, and the walls are designed to converge to a vanishing point. The more complex answer is this has nothing to do with OpenGL specifically; OpenGL is just a useful hardware API to facilitate drawing polygons in a 3D space. You can do the same thing in a software renderer (see Quake & Unreal), and you can present the Carmack Renderer in OpenGL or Vulkan or whatever hardware API. You can also do the Y Shearing effect in OpenGL even when using polygons, which is implemented as an option in Blood: Fresh Supply (though the reverse is harder/impossible if you don't have to geometry math to facilitate it). Edit: Or yeah what Quasar just said. Edited January 5, 2022 by Edward850 5 Quote Share this post Link to post
LexiMax Posted January 5, 2022 (edited) So in other words, software rendered idtech1 or BUILD relies on the assumption that all walls are perfectly vertical. You can't truly look up or down in a fully 3D perspective without breaking that assumption, so y-sheering is essentially a "better than nothing" hack. One interesting side-effect of y-sheering is because the walls remain vertical, you can actually render "fully looking up" and "fully looking down" stitched together and it won't look broken. All the game does is shift which part of the "tall perspective" is currently on your screen (like from the red square to green square). Edited January 5, 2022 by AlexMax 4 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.