7 ms·
"Simpler" is maybe a bit of a stretch, since what's happened is that a lot of the data which previously existed in vertices has been moved to substantially high
by mewse 4y ago
"Simpler" is maybe a bit of a stretch, since what's happened is that a lot of the data which previously existed in vertices has been moved to substantially higher-detail storage in texture maps. If you weren't using the texture maps, you'd have to have a lot more vertices to compensate and get an acceptable look.
In modern games, you often can't really separate the model from the textures the way that you used to. Hell, I have a couple models I render in my game which take their geometry entirely from textures and don't use traditional model vertices to carry their mesh at all. These days you kind of have to consider models and textures to be basically the same thing; just different data sources that get fed into your shader and accessed in different ways, and you can often move data back and forth between them depending on the exact effect you want to get. But I wouldn't call my no-vertex-data models "simpler" than a version which was drawn from a static mesh; all that complexity is still there, it's just being carried in a texture instead of in a vertex buffer object.
- thiht 4y ago> "Simpler" is maybe a bit of a stretch It’s not. The full rendering might not be simpler, but the model is simpler.
- jstimpfle 4y agoThe mesh is simpler.
- qikInNdOutReply 4y agoEh, the low-poly mesh is simpler, the high fidelity mesh to bake out the normal texture is actually more complex then ever.
- gcr 4y agosorry for nitpicking but that's actually a misconception - the GPU doesn't generate intermediate vertices as a result of normal maps! all of that happens in the fragment shader, which only changes how light behaves at the fragments being rendered. Look close and you'll see distortion. a vertex shader could change the geometry or emit intermediate vertices from a displacement map, but my understanding is that that also happens via fragment shader tricks! perhaps you mean the artist's highly detailed mesh used to bake normal maps but those aren't typically shipped out to the user's game engine to save space, it's just an artifact of the artist's production process
- wccrawford 4y agoThey literally said "bake" so yeah, they mean the original mesh.
- woah 4y agoCould you do it by lighting a clay model with some colored lights?
- account42 4y agoAs the sibling comment points out, gp is clearly talking about the source mesh from which the normal map is generated. But that there is never a higher-detail intermediate mesh during rendering is also wrong since the engine could use tesselation or geometry shaders to do just that. Doing it all in the fragment shaders means you either need to limit yourself to small displacements, have visibly wrong rendering at oblique viewing angles or add a lot of complexity to the fragment shader to simulate self-occlusion via raymarching and still end up with visibly wrong rendering in some cases.
- jstimpfle 4y agoI would guess the textures for this model have been directly created from a CSG description, no need for a higher fidelity mesh.
- klodolph 4y agoThe CSG approaches are somewhat more rare. The tools for working with meshes are just so much better. When I’ve seen people use CSG these days, it’s often used as a tool to create a mesh.
- ajross 4y agoSeems unlikely. Neither look like more than a few dozen vertices. The version with the normal map is likely going to be significantly larger in GPU resources due to the texture storage. That said... how is this news, exactly? Bump/normal mapping was a novel, new fangled technique back in the late 1990's... In its original form, it actually predates programmable GPUs.
- astrange 4y agoThe Switch is only Nintendo's second console with programmable shaders, so…
- rhn_mk1 4y agoHow do you even create an object without any vertex data? The texture has to be stretched over something. Is this something just the center point of the object?
- tskool3 4y ago[dead]
- mewse 4y agoYou can put anything in a texture these days; they're just generic pod arrays now and you can do pretty much whatever you want with them; they definitely aren't always images that get stretched over explicit meshes! In my game, for example, I have one texture which contains the xyz positions and rgb colors of lights. And another which contains connectivity data for a road network. Neither one is an image that gets displayed or stretched over things, but they're used as data within various shaders. The most "pure" way to do a "no mesh" render would probably be to use geometry shaders to emit your geometric primitives. (You do need to give it at least one "starting" primitive to make the draw call, but you're free to entirely ignore that primitive). It'd be trivial to embed some mesh data into a "texture", for example, just by reading vertex xyz positions into the rgb channels of a 1D texture that's `number_of_triangles*3` elements wide, and your geometry shader could walk along that texture and output those vertices and triangles and have them get rendered, without ever accessing a vertex buffer object.
- user3939382 4y agoWow this has advanced a lot. I'm a programmer but in a totally different space. The last time I learned about this, many years ago, textures were basically bitmap files.
- tenebrisalietum 4y agoTextures still are, but I think what OP was saying is they can be used for purposes other than painting the sides of polygons. Shaders are basically programs that run massively parallel per pixel to be rendered if I understand right.
- Jasper_ 4y agoThe distinction is that textures are dense and have rigid topology (a grid) while a vertex mesh can be sparse, and has arbitrary topology. The distinction is extra clear in a voxel/SDF approach, where you see harsh grid boundaries because detail is undersampled, but you can't crank up the resolution without oversampling elsewhere. The rigid topology of textures can really hurt you.
- h0l0cube 4y ago> The rigid topology of textures can really hurt you. Technically you could distort the UV map if you need variable resolution across a model.
- fxtentacle 4y agoYou can even automatically generate the optimal UV allocation by balancing resulution-to-area distortion against polygon edge distortion and optimizing with a constrained least-squares solver.
- LolWolf 4y agoAnd, lucky for everyone involved, we can solve huge constrained least squares problems in less than milliseconds on modern machines !
- Arrath 4y agoI'm half convinced you pulled this line from a ST:TNG script.
- justinator 4y agoAll that's needed is for Data to say, "Captain, I've figured a way out:"
- xg15 4y agoEnsign Crusher might have a point here!
- flangola7 4y agoTextures are an image stretched over a wireframe. I don't see how you can have that without a wireframe.
- gcr 4y agoInigo Quilez does some incredible stuff with signed distance fields! Those don't use textures in the traditional sense, but see https://www.youtube.com/watch?v=8--5LwHRhjk https://www.youtube.com/watch?v=8--5LwHRhjk
- Aeolun 4y agoHow do you determine position/size of something that is entirely a texture/shader? The shader just makes something up based on size?
- vikingerik 4y agoIt still has a position and size. It's just a simple definition, something like only the center point of the object and one size value, rather than a mesh with hundreds or thousands of vertex coordinates.
- polishdude20 4y agoDoesn't the bump map use more data than the extra vertices?
- tinus_hn 4y agoIf you render a bump map, the graphics system actually creates geometry and draws it. This is a normal map, which just fiddles with the lighting to make it approximately match what you would get if the details were actually there. The normal map probably takes up slightly more memory than all the geometry that is in the more complex model, but the more complex model causes the gpu to render a lot more triangles which is a lot more work. Looking up values in the normal map is something the gpu is very good at.
- Buttons840 4y ago> Hell, I have a couple models I render in my game which take their geometry entirely from textures and don't use traditional model vertices I've briefly looked at rendering API, newer ones like Vulkan or WGPU. I got the impression that ultimately there is only data and shaders. Is there any truth to this? Of course, you want your data to be useful to the parallel calculations done by shaders.
- klodolph 4y agoI’m not exactly sure what you’re getting at here, but “only data and shaders” is not correct. We still have big fixed-function chunks like perspective divide, clipping, rasterization, depth test, etc. The pipeline is very flexible and programmable, but games aren’t using GPGPU approaches to render the game (although they might use GPGPU approaches for certain tasks).
- brundolf 4y agoBut a normal map renders much more cheaply than the equivalent geometry, right? I assume that's why they exist at all. "All that complexity is still there" feels beside the point
- ladberg 4y agoMaybe, maybe not. It depends what your constraints are. The normal map probably takes up much more memory than the mesh and the shaders needed to render it are likely more complicated (though they would likely already be included in the engine, and thus no additional cost).
- BearOso 4y agoProbably not. You save on vertex transforms, but all the work is put into the pixel shaders, which do a bunch of calculations per fragment. If this is full parallax mapping, it's definitely more total work this way. Whether it's faster in the end depends on where you have CPU/GPU time to spare and what your GPU is good at.
- deleted 4y ago[deleted]
- chc 4y agoIf parallax mapping is more expensive than just rendering the equivalent polygons, doesn't that imply that the Spider-Man games are being wasteful with their texture-based building interiors? I thought it was supposed to be an optimization and rendering actual objects would be wasteful. Have I got that wrong?
- wildpeaks 4y agoIt's not wasteful because Interior Mapping replaces many objects (which would each have their own vertices and textures) by a single square and texture, so you can have a complex room with many objects at the cost of a single object. Example: https://andrewgotow.com/2018/09/09/interior-mapping-part-2/ https://andrewgotow.com/2018/09/09/interior-mapping-part-2/
- aidenn0 4y agoWith normal maps are there issues with improper occlusion when viewing at an angle, or are the textures "smart" enough to avoid that?
- Synaesthesia 4y agoWhen you view it from the side you can tell it’s still a flat polygon without depth, but mostly it’s a really convincing effect.
- dudeinjapan 4y agoIn terms of bytes of data of the asset, the Odyssey coin has got to be way larger.
- bowmessage 4y agoYour point about models taking their geometry entirely from textures reminds me of 'sculpties' from Second Life.