{\rtf1\ansi\ansicpg1252\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}{\f1\fnil\fcharset2 Symbol;}} {\colortbl ;\red0\green0\blue255;} {\*\generator Riched20 10.0.19041}\viewkind4\uc1 \pard\qc\b\f0\fs48\lang1033 PSX Shader Kit\b0\fs24\par {{\field{\*\fldinst{HYPERLINK https://twitter.com/PeacecrabVal }}{\fldrslt{https://twitter.com/PeacecrabVal\ul0\cf0}}}}\f0\fs24\par \par Interior model by Liron\par {{\field{\*\fldinst{HYPERLINK https://twitter.com/LironHero }}{\fldrslt{https://twitter.com/LironHero\ul0\cf0}}}}\f0\fs24\par {{\field{\*\fldinst{HYPERLINK https://sketchfab.com/3d-models/ps1-phasmophobia-da1af845dd6643079b379f3018d451f5 }}{\fldrslt{https://sketchfab.com/3d-models/ps1-phasmophobia-da1af845dd6643079b379f3018d451f5\ul0\cf0}}}}\f0\fs24\par \par \b\fs36 Emulated PSX rendering features\b0\fs24\par \pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\fi-360\li1800 Dithering\par {\pntext\f1\'B7\tab}Color Banding\par {\pntext\f1\'B7\tab}Retro vertex lighting\par {\pntext\f1\'B7\tab}Fixed-point precision vertex snapping\par {\pntext\f1\'B7\tab}Affine texture mapping\par {\pntext\f1\'B7\tab}Triangle sorted rendering\par {\pntext\f1\'B7\tab}Interlacing\par \pard\qc\tab\par \b\fs36 Contents\b0\fs24\par \pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\fi-360\li1800 PSX Post-process effect for Dithering and Color Banding.\par {\pntext\f1\'B7\tab}Unlit and Vertex-Lit variants of the PSX shader. (Opaque, Transparent, Cutout)\par \pard\qc\tab\par \b\fs36 Usage\b0\fs24\par Add the \b PSXShaderManager\b0 Behaviour to a GameObject to customize global settings for the PSX shaders.\par \par Add the \b PSXPostProcessEffect \b0 Behaviour to a camera to enable the PSX-style image effects.\par \tab\par \b\fs36 Settings\b0\fs24\par \pard{\pntext\f1\'B7\tab}{\*\pn\pnlvlblt\pnf1\pnindent0{\pntxtb\'B7}}\fi-360\li720\b Color/Dither Depth\b0 : Amount of unique colors per color channel for the color banding/dither passes. eg. a setting of 16 simulates a 4-bit color depth.\par {\pntext\f1\'B7\tab}\b Dithering Matrix Size\b0 : 4x4 provides a higher quality dither with more dithering patterns per block.\par {\pntext\f1\'B7\tab}\b Vertex Grid Resolution\b0 : Simulates the fact that vertex transformations on the PSX were done with low precision fixed point math. Lower values increase the snapping effect.\par {\pntext\f1\'B7\tab}\b Triangle Sorting Emulation\b0 : Simulates the PSX's lack of a depth buffer, requiring triangles to be sorted individually back to front. Enabling it makes the PSX shaders calculate depth per-triangle rather than per-pixel.\par {\pntext\f1\'B7\tab}\b Retro Vertex Lighting\b0 : Custom vertex lighting with linear attenuation.\par {\pntext\f1\'B7\tab}\b Retro Lighting Normal Factor\b0 : How much the lighting is affected by the angle of surfaces relative to the light. 0 means the lighting intensity is based entirely on the distance between a vertex and the light. 1 means the lighting intensity is based on the distance and also the angle between the light and the vertex normal.\par {\pntext\f1\'B7\tab}\b Depth Debug View\b0 : makes the PSX Shaders render the custom per-triangle depth for debugging.\par \pard\qc\tab\par \b\fs36 Triangle Sorting Customization\b0\fs24\par There isn't a single best solution for triangle sorting as it depends on the scene and camera setup. To customize the triangle sorting for your game, open \b PSX-Utils.cginc \b0 and change the function the \b PSX_TRIANGLE_SORTING_FUNC \b0 macro points to. These functions take in the 3 vertices of the triangle in object space and output the custom depth that should be written. By default, \b GetTriangleSortingDepth_ClosestVertexDepth \b0 is used by default but more are provided for testing, as well as a pre-made custom function template in \b GetTriangleSortingDepth_Custom\b0 .\par \tab\par Unfortunately this method is fairly limited compared to being able to actually sort triangles. Actual PS1 games were able to use pre-computed sorting lists and per-object rules compared to the completely generic math based approach here. The effect will almost always produce worse artifacts than actual PS1 games had.\par \tab\par \b\fs36 Notes\b0\fs24\par The PSX object shaders will work best with scenes made with PS1 limitations in mind. The affine texture mapping and lack of a depth buffer made rendering less accurate the bigger the triangles were on the scene. Your scene should be sufficiently tessellated to make best use of the effects, otherwise they might be too distracting\par \par The triangle sorting function used outputs custom depth in the same value range and distribution as an object rendered without this shader. This is to allow the mixing of PSX and non-PSX shaders in the scene. If that's not a consideration for your project, your own custom triangle sorting solution can be simplified by not having to follow that rule. The \b GetTriangleSortingDepth_LinearCenterDistanceDepth\b0 function is provided as an example of that.\par \par The implementation for the shader variants is centralized in \b PSX-ShaderSrc.cginc \b0 and various features are toggled using \b #define \b0 preprocessor macros. That way, the creation of custom variants is simplified. You can \b #define \b0 your keywords before including \b PSX-ShaderSrc.cginc \b0 to toggle these features.\par }