O'Reilly logo

HLSL Development Cookbook by Doron Feinstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dynamic decals

Dynamic decals are probably the most common way to indicate some interaction with the environment. Decals can represent anything from a bullet impact location to vehicle tire skid marks. A common way to render decals is to alpha blend them on top of the environment, so the pixels covered by the decal can be changed to the decal values while keeping the rest of the scene the same. Because the decals are applied on top of the scene, it is important for each decal to fit perfectly on top of the scene without causing any artifacts. There are two common ways to render decals: projection of the decal using the scenes depth values or by rendering a mesh representing the decal. Both of these methods have pros and cons, but the second one ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required