Shaders

Shaders #

There are a number of shaders included in the SDK that LSD:R uses.

You’ll notice there’s identical ‘Classic’ and ‘Revamped’ shaders - this is to support switching between Classic and Revamped graphics modes on the fly in LSD:R. The Classic shaders have affine texture mapping and vertex snapping designed to emulate PlayStation 1 hardware. These features are not present on the Revamped shaders, thus they are essentially ’normal’ shaders.

If you want your assets to support switching between Classic and Revamped graphics, you should use Classic/Revamped shaders in your materials and ensure any renderer objects have a ShaderSetter component added (it switches the shaders between their Classic and Revamped modes).

Also notice that there are ‘Set’ shaders (i.e. ClassicDiffuseSet and RevampedDiffuseSet) with 4 textures - these are to support the different texture sets from the original game. If you want your assets to support this too you’ll need to use these ‘Set’ shaders.

Classic #

Classic shaders have affine texture mapping and vertex snapping designed to emulate PlayStation 1 rendering.

ClassicDiffuse #

ClassicDiffuse shader

ClassicDiffuse is used for displaying diffuse textures with optional alpha cutout transparency.

ClassicDiffuseAlphaBlend #

ClassicDiffuseAlphaBlend shader

ClassicDiffuseAlphaBlend is used for displaying diffuse textures with alpha blending. If your texture does not need blending then use ClassicDiffuse.

ClassicDiffuseSet #

ClassicDiffuseSet shader

ClassicDiffuseSet is the same as ClassicDiffuse except it supports texture sets.

ClassicDiffuseSetAlphaBlend #

ClassicDiffuseSetAlphaBlend shader

ClassicDiffuseSetAlphaBlend is the same as ClassicDiffuseAlphaBlend except it supports texture sets. If your texture does not need blending then use ClassicDiffuseSet.

ClassicWater #

ClassicWater shader

ClassicWater emulates how the water from the original game worked - it’s a palette cycling shader that uses a greyscale water map and a palette texture, cycling through the palette for each pixel. The water map should map to the palette by the intensity of the pixels in the red channel.

It only supports texture sets. If you don’t need to support texture sets use the same textures for A, B, C, and D.

Revamped #

Revamped shaders are just regular shaders with no extra effects.

RevampedDiffuse #

RevampedDiffuse shader

RevampedDiffuse is used for displaying diffuse textures with optional alpha cutout transparency.

RevampedDiffuseAlphaBlend #

RevampedDiffuseAlphaBlend shader

RevampedDiffuseAlphaBlend is used for displaying diffuse textures with alpha blending. If your texture does not need blending then use RevampedDiffuse.

RevampedDiffuseSet #

RevampedDiffuseSet shader

RevampedDiffuseSet is the same as RevampedDiffuse except it supports texture sets.

RevampedDiffuseSetAlphaBlend #

RevampedDiffuseSetAlphaBlend shader

RevampedDiffuseSetAlphaBlend is the same as RevampedDiffuseAlphaBlend except it supports texture sets. If your texture does not need blending then use RevampedDiffuseSet.

RevampedWater #

RevampedWater shader

RevampedWater emulates how the water from the original game worked - it’s a palette cycling shader that uses a greyscale water map and a palette texture, cycling through the palette for each pixel. The water map should map to the palette by the intensity of the pixels in the red channel.

It only supports texture sets. If you don’t need to support texture sets use the same textures for A, B, C, and D.

Other #

These are other shaders that are used in-game (that don’t need to be swapped out for Classic/Revamped graphics).

Background #

Background shader

Background is used for objects that should show in the sky (like the sun, and the sunburst effect). Objects will be rendered as billboards. The shader is set up so that the rendering should work correctly.

You can adjust the scale, tint, alpha cutoff, and rotation angle of the object.