3 ms·
Normal maps are more efficient than finely tessellated geometry on the GPU for a number of reasons: - GPUs are bad at very fine/small triangles (think like <5
by MindSpunk 4y ago
Normal maps are more efficient than finely tessellated geometry on the GPU for a number of reasons:
- GPUs are bad at very fine/small triangles (think like <5 pixels per triangle) as the rasterization pipeline is not designed for triangles that small. It can actually be more efficient to rasterize in software in compute shaders when trying to render tiny triangles. For example, Unreal Engine's Nanite does this. You'd need crazy polygon density to match the visual look of normal maps, let alone parallax mapping.
- To get similar resolution to a normal map in geometry would take much more memory. Normal maps can be naively implemented with a 32 bits-per-pixel texture compared to geometry which will often be minimum 128-bits just for the vertex position, let alone the vertex normal, vertex tangent and texture coordinate. For the same memory footprint you would get less than a quarter of the effective detail using just geometry.
- Higher memory usage from the geometry would also increase the memory bandwidth needed to fetch the vertex attributes which will slow down the vertex transform stage further, beyond just needing to transform more vertices. Using too much memory bandwidth is an easy way to bottleneck yourself, a lot of work in modern renderers goes into finding ways to use less memory just so less data needs to be fetched from memory.
CPU never matters in normal mapping/parallax mapping or other techniques, it's never even in the pipeline for where this stuff is processed. It's all on the GPU. If it was cheaper to throw more geometry at the GPU then that's what would be done as normal maps and similar techniques all have very obvious flaws that finer geometry doesn't.
- BearOso 4y agoI think you read too much into what I said. In this example, the two coins, performance difference is going to be negligible. More "work" would be done in the fragment shader, assuming fragments > vertices, but it can do that significantly faster.