The Redshift Sprite Node allows the use of texture to define the parts of a surface that are totally transparent. This can be useful to create detail on thin, low-polygon geometry. A good example of this is foliage: the leaves of a tree can be modeled as quads, but the shape of each leaf can come from a black and white texture. The alternative solution would be to model the shape of each leaf with triangles/quads but that could require a lot of effort and would occupy significant memory resources.
In Redshift, apart from the sprite node, one could achieve the same result by simply connecting a texture to the shader』s transparency port. In the case of the architectural shader, one could connect a black and white texture to the shader』s 『opacity cutout』 port.
However, both of these alternatives can be problematic:然而,以上兩種選擇都會帶來問題:
They can reduce the performance of the renderer. When a ray hits a polygon, Redshift has to execute certain operations to read the texture, setup the next transparency/refraction ray, etc. These operations can be wasteful if the ray hits a 『totally empty』 part of the polygon.
The transparency/refraction trace depth would have to be increased in order to prevent transparency/refraction rays from being terminated prematurely and introducing visual artifacts.
The Redshift Sprite Node addresses both of these issues! First, it is optimized to very quickly skip empty parts of a polygon and with very few operations. That can yield far superior performance compared to transparencies. Secondly, it does not rely on the refraction trace depth. So, even if your max refraction trace depth was zero, the rays would still successfully go through any opacity/alpha cutouts and without any artifacts.
However, to achieve this performance, the sprite node has a couple of limitations too:
然而,為了實現上述功能,Sprite Node也帶來了幾個局限性:
The textures used by the sprite node occupy GPU memory and cannot be out-of-core. This means that if your scene is using many high-resolution alpha textures, Redshift could potentially run out of GPU memory. This is in contrast to all other textures in Redshift which are out-of-core and can be of any size without triggering out-of-memory issues. A 1024x1024 sprite node texture occupies 1MB of memory, a 4K one occupies 16MB of memory and so on.The number of megabytes these textures occupy is shown in the 「Redshift Feedback Display」 window.
No shadernode operations are permitted on the sprite node alpha texture. This means that you cannot use shader nodes to adjust the texture』s look, like for example brighten or darken it. Or be able to blend multiple alpha textures together before connecting the result to the sprite node. Therefore, any modifications to the sprite node texture have to happen in your texture authoring tool.
Please note that the large performance difference demonstrated below is because of the multiple stacked cards which is a pathological case. In this scene all ray types
(primary, GI, shadow, reflection) have to travel and intersect many layers of alpha cutout geometry. A scene with fewer layers would yield a smaller performance benefit - but a benefit nevertheless!