Sonic the Hedgehog (2006) Shaders: Difference between revisions
No edit summary |
mNo edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 12: | Line 12: | ||
|<code>/game/xenon/archives/shader_lt.arc</code> | |<code>/game/xenon/archives/shader_lt.arc</code> | ||
|} | |} | ||
Within the archives, shaders are stored in a number of sub-folders. | Within the archives, shaders variants are stored in a number of sub-folders. | ||
{| class="wikitable" | {| class="wikitable" | ||
!Folder | !Folder | ||
!Description | !Description | ||
|- | |||
|<code>std</code> | |||
|Standard | |||
|- | |||
|<code>np</code> | |||
|Standard without point lights | |||
|- | |- | ||
|<code>lm</code> | |<code>lm</code> | ||
| | |Replaces CSM with baked lightmaps and shadows. | ||
|- | |- | ||
|<code>lm_np</code> | |<code>lm_np</code> | ||
| | |Same as <code>lm</code> without point lights | ||
|- | |- | ||
|<code> | |<code>morph</code>, <code>morph_np</code> | ||
| | |Morph targets (only affects vertex shaders) | ||
|- | |- | ||
|<code> | |<code>skin</code>, <code>skin_np</code> | ||
|Skined meshes (only affects vertex shaders) | |||
| | |||
|} | |} | ||
| Line 48: | Line 42: | ||
The shader and specific technique used are defined per mesh set in [[NN Chunk Format|XNO files]]. Some shaders are not referenced in XNO files, either because they are used internally or because they are unused altogether. | The shader and specific technique used are defined per mesh set in [[NN Chunk Format|XNO files]]. Some shaders are not referenced in XNO files, either because they are used internally or because they are unused altogether. | ||
== Shader Inputs == | |||
All shaders used for rendering 3D objects use a common input block format. | |||
{| class="wikitable" | |||
|+ | |||
!Registers | |||
!Parameter | |||
!Description | |||
|- | |||
|<code>c0</code>-<code>c3</code> | |||
|<code>g_Material</code> | |||
|NinjaNext material parameters. Not always used as described. | |||
|- | |||
|<code>c4</code> | |||
|<code>g_Misc</code> | |||
| | |||
|- | |||
|<code>c5</code>-<code>c6</code> | |||
|<code>g_OffsetUV</code> | |||
| | |||
|- | |||
|<code>c8</code>-<code>c13</code> | |||
|<code>g_OLS</code> | |||
|[https://renderwonk.com/publications/gdm-2002/GDM_August_2002.pdf Hoffman–Preetham] scattering parameters. Most shaders evaluate phase at constant <code>cos(θ) = 0.5</code>. | |||
|- | |||
|<code>c14</code> | |||
|<code>g_RTDimensions</code> | |||
| | |||
|- | |||
|<code>c15</code> | |||
|<code>g_ClipInfo</code> | |||
| | |||
|- | |||
|<code>c16</code> | |||
|<code>g_KhronosParam</code> | |||
|Time | |||
|- | |||
|<code>c28</code>-<code>c30</code> | |||
|<code>g_LightMisc</code> | |||
| | |||
|- | |||
|<code>c31</code>-<code>c34</code> | |||
|<code>g_DirectionalLights[2]</code> | |||
| | |||
|- | |||
|<code>c39</code>-<code>c44</code> | |||
|<code>g_PointLights[2]</code> | |||
| | |||
|- | |||
|<code>c64</code>-<code>c66</code> | |||
|<code>g_MatW</code> | |||
|World matrix | |||
|- | |||
|<code>c68</code>-<code>c70</code> | |||
|<code>g_MatWV</code> | |||
|World * View matrix | |||
|- | |||
|<code>c72</code>-<code>c75</code> | |||
|<code>g_MatWVP</code> | |||
|World * View * Projection matrix | |||
|- | |||
|<code>c76</code>-<code>c78</code> | |||
|<code>g_MatV</code> | |||
|View matrix | |||
|- | |||
|<code>c80</code>-<code>c82</code> | |||
|<code>g_MatVI</code> | |||
|Inverse View matrix | |||
|- | |||
|<code>c84</code>-<code>c87</code> | |||
|<code>g_MatP</code> | |||
|Projection matrix | |||
|- | |||
|<code>c88</code>-<code>c91</code> | |||
|<code>g_MatVP</code> | |||
|View * Projection matrix | |||
|- | |||
|<code>c92</code>-<code>c95</code> | |||
|<code>g_mtxCSMViewProj</code> | |||
|CSM View * Projection matrix | |||
|- | |||
|<code>c96</code>-<code>c191</code> | |||
|<code>g_BoneMtx[32]</code> | |||
| | |||
|- | |||
|<code>c192</code> | |||
|<code>g_Morph</code> | |||
| | |||
|- | |||
|<code>c193</code> | |||
|<code>g_MorphFlags</code> | |||
| | |||
|- | |||
|<code>c194</code> | |||
|<code>g_SystemLightMapWork</code> | |||
| | |||
|- | |||
|<code>c210</code>+ | |||
|Shader-specific constants | |||
| | |||
|- | |||
|<code>b0</code> | |||
|<code>bReflection</code> | |||
| rowspan="2" |<code>CharacterMaterial</code> only | |||
|- | |||
|<code>b1</code> | |||
|<code>bCubeReflection</code> | |||
|- | |||
|<code>s0</code>-<code>s3</code> | |||
|Material textures | |||
| | |||
|- | |||
|<code>s8</code> | |||
|<code>g_smpEnvMap</code> | |||
|Static environment cube map | |||
|- | |||
|<code>s9</code> | |||
|<code>g_smpDepth0</code> | |||
|Packed linear depth, used by <code>Fog00</code>, <code>DepthOfFieldFilter</code> | |||
|- | |||
|<code>s10</code> | |||
|<code>g_smpDynamicEnvMap</code> | |||
|Planar reflection, used by <code>CscGlass02</code>, <code>MefiressSpecific</code>, <code>TpjWater00</code>, <code>Water03</code> | |||
|- | |||
|<code>s11</code> | |||
|<code>g_smpCSM</code> | |||
|CSM array | |||
|- | |||
|<code>s13</code> | |||
|<code>g_smpFB</code> | |||
|Resolved framebuffer, used by <code>OpticalCamouflage</code> | |||
|} | |||
== Shader List == | |||
{| class="wikitable" | {| class="wikitable" | ||
!Shader | !Shader | ||
!Notes | !Notes | ||
!Morph/Skin | |||
!Used in XNOs | !Used in XNOs | ||
|- | |- | ||
| Line 57: | Line 185: | ||
|- | |- | ||
| Air00 | | Air00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 62: | Line 191: | ||
| Animal00 | | Animal00 | ||
| Used for Kingdom Valley eagle. | | Used for Kingdom Valley eagle. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 80: | Line 210: | ||
|- | |- | ||
| Aqua00 | | Aqua00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 109: | Line 240: | ||
| Billboard00 | | Billboard00 | ||
| No lighting, CSM sampling or point lights support. | | No lighting, CSM sampling or point lights support. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Billboard01 | | Billboard01 | ||
| Vertex lighting and point lights, no CSM sampling. | | Vertex lighting and point lights, no CSM sampling. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Billboard02 | | Billboard02 | ||
| By far the most used shader. Vertex lighting with no CSM sampling or point lights support. | | By far the most used shader. Vertex lighting with no CSM sampling or point lights support. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Billboard03 | | Billboard03 | ||
| Vertex lighting, CSM sampling and point lights. | | Vertex lighting, CSM sampling and point lights. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Billboard04 | | Billboard04 | ||
| Pixel lighting, CSM sampling, no point lights. | | Pixel lighting, CSM sampling, no point lights. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Billboard05 | | Billboard05 | ||
| Pixel lighting, no CSM sampling or point lights. | | Pixel lighting, no CSM sampling or point lights. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Billboard06 | | Billboard06 | ||
| Pixel lighting and point lights, no CSM sampling. | | Pixel lighting and point lights, no CSM sampling. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 139: | Line 277: | ||
|- | |- | ||
| BillboardSp00 | | BillboardSp00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| BillboardSp01 | | BillboardSp01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| BillboardSp02 | | BillboardSp02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 155: | Line 296: | ||
| bod_light | | bod_light | ||
| Used by "Book of Darkness" aka Scepter of Darkness. | | Used by "Book of Darkness" aka Scepter of Darkness. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| bod_metal | | bod_metal | ||
| Used by "Book of Darkness" aka Scepter of Darkness. | | Used by "Book of Darkness" aka Scepter of Darkness. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 165: | Line 308: | ||
|- | |- | ||
| ChaosDrive | | ChaosDrive | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 170: | Line 314: | ||
| CharacterMaterial | | CharacterMaterial | ||
| Responsible for rendering playable characters, NPCs, and many random hub world objects. By far the densest shader in the game, including many unused techniques. | | Responsible for rendering playable characters, NPCs, and many random hub world objects. By far the densest shader in the game, including many unused techniques. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 194: | Line 339: | ||
|- | |- | ||
| CscGlass00 | | CscGlass00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 201: | Line 347: | ||
|- | |- | ||
| CscGlass02 | | CscGlass02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| CscScene00 | | CscScene00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| CscScene01 | | CscScene01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 237: | Line 386: | ||
|- | |- | ||
| DtdSand01 | | DtdSand01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| DtdSand02 | | DtdSand02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 251: | Line 402: | ||
|- | |- | ||
| DtdScene00 | | DtdScene00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 258: | Line 410: | ||
|- | |- | ||
| DtdScene02 | | DtdScene02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| DtdScene03 | | DtdScene03 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| DtdScene04 | | DtdScene04 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 274: | Line 429: | ||
| ecb_light | | ecb_light | ||
| Used for Egg Cerberus. | | Used for Egg Cerberus. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| ecb_metal | | ecb_metal | ||
| Used for Egg Cerberus. | | Used for Egg Cerberus. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Effect00 | | Effect00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| egen_light | | egen_light | ||
| Used for Egg Genesis. | | Used for Egg Genesis. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| egen_metal | | egen_metal | ||
| Used for Egg Genesis. | | Used for Egg Genesis. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| egen_slight | | egen_slight | ||
| Used for Egg Genesis. | | Used for Egg Genesis. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| emob_light | | emob_light | ||
| Used for Egg Mobile. | | Used for Egg Mobile. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| emob_metal | | emob_metal | ||
| Used for Egg Mobile. | | Used for Egg Mobile. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| en_bullet | | en_bullet | ||
|Used by <code>en_cmn_bullet00</code>. | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 312: | Line 476: | ||
|- | |- | ||
| en_lava | | en_lava | ||
| | |Used by various Iblis enemies, and Solaris. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| en_light | | en_light | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| en_lightani | | en_lightani | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| en_metal | | en_metal | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| en_plating | | en_plating | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 333: | Line 502: | ||
| en_rock | | en_rock | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| EndSky00 | | EndSky00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 341: | Line 512: | ||
| FBTex_NrmMap | | FBTex_NrmMap | ||
| Used by <code>esp_ripple</code> and <code>esp_Sphere</code> | | Used by <code>esp_ripple</code> and <code>esp_Sphere</code> | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Fence00 | | Fence00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Fence01 | | Fence01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 353: | Line 527: | ||
| FlcCore00 | | FlcCore00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| FlcScene00 | | FlcScene00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 363: | Line 539: | ||
|- | |- | ||
| Fluff00 | | Fluff00 | ||
| | |Used by Tropical Jungle plant grind rails. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Fog00 | | Fog00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 375: | Line 553: | ||
| fsol_armor | | fsol_armor | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 387: | Line 566: | ||
|- | |- | ||
| Gadget | | Gadget | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 394: | Line 574: | ||
|- | |- | ||
| Glass00 | | Glass00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Glass01 | | Glass01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 409: | Line 591: | ||
| iblis01_eye | | iblis01_eye | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| iblis01_lava | | iblis01_lava | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| iblis01_rock | | iblis01_rock | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 424: | Line 609: | ||
| iblis02_lava | | iblis02_lava | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| iblis02_rock | | iblis02_rock | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| iblis03_eye | | iblis03_eye | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| iblis03_lava | | iblis03_lava | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| iblis03_rock | | iblis03_rock | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Ice00 | | Ice00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Ice01 | | Ice01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Ice02 | | Ice02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 459: | Line 652: | ||
| Item_Board | | Item_Board | ||
| Crisis City snowboard. Separate from White Acropolis board. | | Crisis City snowboard. Separate from White Acropolis board. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| ItemGlass00 | | ItemGlass00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| ItemMetal00 | | ItemMetal00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 473: | Line 669: | ||
|- | |- | ||
| KdvAqua01 | | KdvAqua01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| KdvMist00 | | KdvMist00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 488: | Line 686: | ||
| Kyozoress | | Kyozoress | ||
| Likely referring to "巨像", the large monsters in Mephiles' final boss fight. | | Likely referring to "巨像", the large monsters in Mephiles' final boss fight. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 495: | Line 694: | ||
| Laser01 | | Laser01 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Leaf00 | | Leaf00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Leaf01 | | Leaf01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 509: | Line 711: | ||
|- | |- | ||
| LightCore | | LightCore | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Lightmap00 | | Lightmap00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Lightmap01 | | Lightmap01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| LightmapSp00 | | LightmapSp00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 528: | Line 734: | ||
|- | |- | ||
| LightmapSp02 | | LightmapSp02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 535: | Line 742: | ||
|- | |- | ||
| LightmapSp04 | | LightmapSp04 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 540: | Line 748: | ||
| Luminous00 | | Luminous00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Luminous01 | | Luminous01 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Luminous02 | | Luminous02 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Luminous03 | | Luminous03 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Luminous04 | | Luminous04 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Luminous05 | | Luminous05 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Luminous06 | | Luminous06 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 576: | Line 791: | ||
|- | |- | ||
| Mantle00 | | Mantle00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 581: | Line 797: | ||
| Mantle01 | | Mantle01 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Mantle02 | | Mantle02 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 594: | Line 812: | ||
|- | |- | ||
| Mefiress | | Mefiress | ||
| | |Mephiles-specific CharacterMaterial variant. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| MefiressSpecific | | MefiressSpecific | ||
|Used for Flame Core Mephiles boss floor to draw his "shadow". | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| MefiressSpecific2 | | MefiressSpecific2 | ||
|Used for goopy Dusty Desert Mephiles boss floor. | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 610: | Line 831: | ||
| Metal00 | | Metal00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Metal01 | | Metal01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Metal02 | | Metal02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 655: | Line 879: | ||
| psi_effect | | psi_effect | ||
| Used for rendering Silver's psychokinesis effects. | | Used for rendering Silver's psychokinesis effects. | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Ring | | Ring | ||
|Goal rings, hint rings, regular rings, and keys. | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 669: | Line 895: | ||
| Rust00 | | Rust00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 675: | Line 902: | ||
|- | |- | ||
| scr_metal | | scr_metal | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Shield | | Shield | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 687: | Line 916: | ||
| Sky00 | | Sky00 | ||
| Used for Egg Wyvern fight and E0026 skybox. | | Used for Egg Wyvern fight and E0026 skybox. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Sky01 | | Sky01 | ||
| Used for Egg Wyvern fight skybox. | | Used for Egg Wyvern fight skybox. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Sky02 | | Sky02 | ||
| Used for every other skybox not previously mentioned. | | Used for every other skybox not previously mentioned. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Snow00 | | Snow00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Snow01 | | Snow01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Snow02 | | Snow02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 711: | Line 946: | ||
| Stone00 | | Stone00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Stone01 | | Stone01 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Stone02 | | Stone02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 723: | Line 961: | ||
| Stone03 | | Stone03 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 730: | Line 969: | ||
| Terrain00 | | Terrain00 | ||
| Only used by <code>kdv_obj_D_bridge01</code> | | Only used by <code>kdv_obj_D_bridge01</code> | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Terrain01 | | Terrain01 | ||
| Only used by <code>tpj_obj_oldtree</code> and <code>tpj_obj_sphere</code> | | Only used by <code>tpj_obj_oldtree</code> and <code>tpj_obj_sphere</code> | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Terrain02 | | Terrain02 | ||
| Only used by <code>csc_obj_groundA</code>, <code>csc_obj_groundB</code>, and <code>tpj_obj_sphere</code> | | Only used by <code>csc_obj_groundA</code>, <code>csc_obj_groundB</code>, and <code>tpj_obj_sphere</code> | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 745: | Line 987: | ||
| Terrain04 | | Terrain04 | ||
| Only used by <code>e0125_map02_nos_</code> and <code>tpj_mapA_roadlm</code> | | Only used by <code>e0125_map02_nos_</code> and <code>tpj_mapA_roadlm</code> | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Terrain05 | | Terrain05 | ||
| Used extensively (91 times). | | Used extensively (91 times). | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 764: | Line 1,008: | ||
|- | |- | ||
| TpjWater00 | | TpjWater00 | ||
|Tropical Jungle specific variant similar to Water03. | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| TpjWater01 | | TpjWater01 | ||
|Tropical Jungle specific variant similar to Water04. | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 776: | Line 1,022: | ||
| TwnGate | | TwnGate | ||
| Used for warp gates. | | Used for warp gates. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Line 785: | Line 1,032: | ||
|- | |- | ||
| TwnScene00 | | TwnScene00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 792: | Line 1,040: | ||
|- | |- | ||
| TwnScene02 | | TwnScene02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 802: | Line 1,051: | ||
|- | |- | ||
| WapScene00 | | WapScene00 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 809: | Line 1,059: | ||
|- | |- | ||
| WapScene02 | | WapScene02 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 816: | Line 1,067: | ||
|- | |- | ||
| Water01 | | Water01 | ||
|Used by translucent waterfalls and splash effects. | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 823: | Line 1,075: | ||
|- | |- | ||
| Water03 | | Water03 | ||
|Used for planar-reflection enabled liquids, water in Kingdom Valley and mercury pools in Aquatic Base. | |||
| | | | ||
| ✓ | | ✓ | ||
|- | |- | ||
| Water04 | | Water04 | ||
|Used for static environment-mapped liquids. | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 835: | Line 1,089: | ||
| Waterrise | | Waterrise | ||
| Unused Kingdom Valley object. Some kind of rippling water/mist. | | Unused Kingdom Valley object. Some kind of rippling water/mist. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Wood00 | | Wood00 | ||
| | | | ||
|✓ | |||
| ✓ | | ✓ | ||
|- | |- | ||
| Wood01 | | Wood01 | ||
| | |||
| | | | ||
| ✓ | | ✓ | ||
| Line 847: | Line 1,104: | ||
| Zakoress | | Zakoress | ||
| Referring to "雑魚" small-fry crowd of NPCs, the tiny shadow minions in Mephiles' boss fight. | | Referring to "雑魚" small-fry crowd of NPCs, the tiny shadow minions in Mephiles' boss fight. | ||
| | |||
| ✓ | | ✓ | ||
|- | |- | ||
Latest revision as of 18:56, 28 October 2026
Shaders in Sonic the Hedgehog (2006) are compiled GPU programs that control the appearance of objects and effects. Most shaders have several different variants with different feature support. Multiplayer shaders may have additional optimisations, like replacing real-time planar reflections with cubemaps.
In the Xbox 360 version of the game, shaders are stored in the following archives:
| Type | Location |
|---|---|
| Singleplayer | /game/xenon/archives/shader.arc
|
| Multiplayer | /game/xenon/archives/shader_lt.arc
|
Within the archives, shaders variants are stored in a number of sub-folders.
| Folder | Description |
|---|---|
std
|
Standard |
np
|
Standard without point lights |
lm
|
Replaces CSM with baked lightmaps and shadows. |
lm_np
|
Same as lm without point lights
|
morph, morph_np
|
Morph targets (only affects vertex shaders) |
skin, skin_np
|
Skined meshes (only affects vertex shaders) |
Many of the shaders within the sub-folders are exact duplicates of the standard variant.
Each of the shaders listed below are in the .fxo format in the 360 version of the game. Each shader can contain multiple techniques, which hold the respective vertex and fragment shaders.
The shader and specific technique used are defined per mesh set in XNO files. Some shaders are not referenced in XNO files, either because they are used internally or because they are unused altogether.
Shader Inputs
All shaders used for rendering 3D objects use a common input block format.
| Registers | Parameter | Description |
|---|---|---|
c0-c3
|
g_Material
|
NinjaNext material parameters. Not always used as described. |
c4
|
g_Misc
|
|
c5-c6
|
g_OffsetUV
|
|
c8-c13
|
g_OLS
|
Hoffman–Preetham scattering parameters. Most shaders evaluate phase at constant cos(θ) = 0.5.
|
c14
|
g_RTDimensions
|
|
c15
|
g_ClipInfo
|
|
c16
|
g_KhronosParam
|
Time |
c28-c30
|
g_LightMisc
|
|
c31-c34
|
g_DirectionalLights[2]
|
|
c39-c44
|
g_PointLights[2]
|
|
c64-c66
|
g_MatW
|
World matrix |
c68-c70
|
g_MatWV
|
World * View matrix |
c72-c75
|
g_MatWVP
|
World * View * Projection matrix |
c76-c78
|
g_MatV
|
View matrix |
c80-c82
|
g_MatVI
|
Inverse View matrix |
c84-c87
|
g_MatP
|
Projection matrix |
c88-c91
|
g_MatVP
|
View * Projection matrix |
c92-c95
|
g_mtxCSMViewProj
|
CSM View * Projection matrix |
c96-c191
|
g_BoneMtx[32]
|
|
c192
|
g_Morph
|
|
c193
|
g_MorphFlags
|
|
c194
|
g_SystemLightMapWork
|
|
c210+
|
Shader-specific constants | |
b0
|
bReflection
|
CharacterMaterial only
|
b1
|
bCubeReflection
| |
s0-s3
|
Material textures | |
s8
|
g_smpEnvMap
|
Static environment cube map |
s9
|
g_smpDepth0
|
Packed linear depth, used by Fog00, DepthOfFieldFilter
|
s10
|
g_smpDynamicEnvMap
|
Planar reflection, used by CscGlass02, MefiressSpecific, TpjWater00, Water03
|
s11
|
g_smpCSM
|
CSM array |
s13
|
g_smpFB
|
Resolved framebuffer, used by OpticalCamouflage
|
Shader List
| Shader | Notes | Morph/Skin | Used in XNOs |
|---|---|---|---|
| AcrobataPrimitive | Used in rendering of Acroarts particle effects. | ||
| Air00 | ✓ | ||
| Animal00 | Used for Kingdom Valley eagle. | ✓ | ✓ |
| Animal01 | |||
| Animal02 | |||
| AqaScene00 | |||
| AqaScene01 | |||
| AqaScene02 | |||
| Aqua00 | ✓ | ||
| Artifact00 | |||
| Artifact01 | |||
| Artifact02 | |||
| Artifact03 | |||
| Artifact06 | |||
| Artifact07 | |||
| BackGround | |||
| balloonicon | Used for rendering quest "balloons" in hub worlds. | ||
| Billboard00 | No lighting, CSM sampling or point lights support. | ✓ | ✓ |
| Billboard01 | Vertex lighting and point lights, no CSM sampling. | ✓ | ✓ |
| Billboard02 | By far the most used shader. Vertex lighting with no CSM sampling or point lights support. | ✓ | ✓ |
| Billboard03 | Vertex lighting, CSM sampling and point lights. | ✓ | ✓ |
| Billboard04 | Pixel lighting, CSM sampling, no point lights. | ✓ | |
| Billboard05 | Pixel lighting, no CSM sampling or point lights. | ✓ | |
| Billboard06 | Pixel lighting and point lights, no CSM sampling. | ✓ | |
| Billboard07 | Unused. Pixel lighting, CSM sampling and point lights. | ||
| BillboardSp00 | ✓ | ||
| BillboardSp01 | ✓ | ||
| BillboardSp02 | ✓ | ||
| BloomFilter | |||
| bod_light | Used by "Book of Darkness" aka Scepter of Darkness. | ✓ | |
| bod_metal | Used by "Book of Darkness" aka Scepter of Darkness. | ✓ | |
| BurnoutBlurFilter | Responsible for the radial "motion" blur seen in the final game. Likely named after the Burnout racing series. | ||
| ChaosDrive | ✓ | ||
| CharacterMaterial | Responsible for rendering playable characters, NPCs, and many random hub world objects. By far the densest shader in the game, including many unused techniques. | ✓ | ✓ |
| ColorCopyFilter | |||
| ColorCorrectionFilter | |||
| ColorOutFilter | Outputs a solid colour. Used for bright areas of spotlights in White Acropolis stealth sections. | ||
| Common | |||
| conditional_rendering | Used in rendering of lens flare effect. | ||
| CopyFilter | |||
| core_circle | |||
| CscGlass00 | ✓ | ||
| CscGlass01 | |||
| CscGlass02 | ✓ | ||
| CscScene00 | ✓ | ||
| CscScene01 | ✓ | ||
| CscScene02 | |||
| CscScene03 | |||
| csd | Used in rendering of CSD (UI) scenes. | ||
| csd3D | Used for world-space UI like enemy health gauges. | ||
| csdBG | |||
| cyl | |||
| DepthOfFieldFilter | Unused in the final game. Likely a depth of field effect similar to the one in Sonic Unleashed. | ||
| DtdSand00 | |||
| DtdSand01 | ✓ | ||
| DtdSand02 | ✓ | ||
| DtdSand03 | |||
| DtdSand04 | |||
| DtdScene00 | ✓ | ||
| DtdScene01 | |||
| DtdScene02 | ✓ | ||
| DtdScene03 | ✓ | ||
| DtdScene04 | ✓ | ||
| DtdScene05 | |||
| ecb_light | Used for Egg Cerberus. | ✓ | |
| ecb_metal | Used for Egg Cerberus. | ✓ | |
| Effect00 | ✓ | ✓ | |
| egen_light | Used for Egg Genesis. | ✓ | |
| egen_metal | Used for Egg Genesis. | ✓ | |
| egen_slight | Used for Egg Genesis. | ✓ | |
| emob_light | Used for Egg Mobile. | ✓ | |
| emob_metal | Used for Egg Mobile. | ✓ | ✓ |
| en_bullet | Used by en_cmn_bullet00.
|
✓ | |
| en_laser00 | |||
| en_lava | Used by various Iblis enemies, and Solaris. | ✓ | ✓ |
| en_light | ✓ | ✓ | |
| en_lightani | ✓ | ✓ | |
| en_metal | ✓ | ✓ | |
| en_plating | ✓ | ||
| en_rock | ✓ | ✓ | |
| EndSky00 | ✓ | ||
| FBTex_NrmMap | Used by esp_ripple and esp_Sphere
|
✓ | |
| Fence00 | ✓ | ||
| Fence01 | ✓ | ||
| FlcCore00 | ✓ | ✓ | |
| FlcScene00 | ✓ | ||
| FlcScene01 | |||
| Fluff00 | Used by Tropical Jungle plant grind rails. | ✓ | ✓ |
| Fog00 | ✓ | ||
| font | Used in font rendering for CSD. | ||
| fsol_armor | ✓ | ✓ | |
| fsol_eye | |||
| fsol_fluid | |||
| Gadget_Glider | |||
| Gadget | ✓ | ||
| gindows | |||
| Glass00 | ✓ | ||
| Glass01 | ✓ | ||
| Glass02 | |||
| Glass03 | |||
| iblis01_eye | ✓ | ✓ | |
| iblis01_lava | ✓ | ✓ | |
| iblis01_rock | ✓ | ||
| iblis02_eye | Unused, iblis02.xno uses iblis01_eye. They seem more or less identical.
| ||
| iblis02_lava | ✓ | ✓ | |
| iblis02_rock | ✓ | ✓ | |
| iblis03_eye | ✓ | ✓ | |
| iblis03_lava | ✓ | ✓ | |
| iblis03_rock | ✓ | ✓ | |
| Ice00 | ✓ | ||
| Ice01 | ✓ | ||
| Ice02 | ✓ | ||
| Ice03 | |||
| Item_Board | Crisis City snowboard. Separate from White Acropolis board. | ✓ | ✓ |
| ItemGlass00 | ✓ | ✓ | |
| ItemMetal00 | ✓ | ✓ | |
| KdvAqua00 | |||
| KdvAqua01 | ✓ | ||
| KdvMist00 | ✓ | ||
| KdvRope | |||
| KdvWindRoad | |||
| Kyozoress | Likely referring to "巨像", the large monsters in Mephiles' final boss fight. | ✓ | ✓ |
| Laser00 | |||
| Laser01 | ✓ | ✓ | |
| Leaf00 | ✓ | ||
| Leaf01 | ✓ | ||
| lensflare | |||
| LightCore | ✓ | ||
| Lightmap00 | ✓ | ||
| Lightmap01 | ✓ | ||
| LightmapSp00 | ✓ | ||
| LightmapSp01 | |||
| LightmapSp02 | ✓ | ||
| LightmapSp03 | |||
| LightmapSp04 | ✓ | ||
| Luminous00 | ✓ | ✓ | |
| Luminous01 | ✓ | ✓ | |
| Luminous02 | ✓ | ✓ | |
| Luminous03 | ✓ | ✓ | |
| Luminous04 | ✓ | ✓ | |
| Luminous05 | ✓ | ✓ | |
| Luminous06 | ✓ | ||
| Luminous07 | |||
| lzout_pt | |||
| lzout | |||
| Mantle00 | ✓ | ||
| Mantle01 | ✓ | ✓ | |
| Mantle02 | ✓ | ✓ | |
| MarathonSpeedTree | |||
| MaskCopyFilter | |||
| Mefiress | Mephiles-specific CharacterMaterial variant. | ✓ | ✓ |
| MefiressSpecific | Used for Flame Core Mephiles boss floor to draw his "shadow". | ✓ | |
| MefiressSpecific2 | Used for goopy Dusty Desert Mephiles boss floor. | ✓ | |
| Mercury | |||
| Metal00 | ✓ | ✓ | |
| Metal01 | ✓ | ||
| Metal02 | ✓ | ||
| MotionBlurFilter | BurnoutBlurFilter is used in retail rather than this shader. | ||
| movie | |||
| movieARGB | |||
| movieYUV420 | |||
| no_shader | |||
| OpticalCamouflage | Used for rendering camouflaged enemies. | ||
| pe | |||
| PhaseShiftFilter | |||
| physicsviewer | |||
| player_homing | |||
| primitive | |||
| psi_effect | Used for rendering Silver's psychokinesis effects. | ✓ | ✓ |
| Ring | Goal rings, hint rings, regular rings, and keys. | ✓ | |
| rt_clear | |||
| rt_restoration | |||
| Rust00 | ✓ | ✓ | |
| SampleFilter | |||
| scr_metal | ✓ | ||
| Shield | ✓ | ||
| simple | |||
| Sky00 | Used for Egg Wyvern fight and E0026 skybox. | ✓ | |
| Sky01 | Used for Egg Wyvern fight skybox. | ✓ | |
| Sky02 | Used for every other skybox not previously mentioned. | ✓ | |
| Snow00 | ✓ | ||
| Snow01 | ✓ | ||
| Snow02 | ✓ | ||
| Stone00 | ✓ | ✓ | |
| Stone01 | ✓ | ✓ | |
| Stone02 | ✓ | ||
| Stone03 | ✓ | ✓ | |
| Stone04 | |||
| Terrain00 | Only used by kdv_obj_D_bridge01
|
✓ | |
| Terrain01 | Only used by tpj_obj_oldtree and tpj_obj_sphere
|
✓ | |
| Terrain02 | Only used by csc_obj_groundA, csc_obj_groundB, and tpj_obj_sphere
|
✓ | |
| Terrain03 | |||
| Terrain04 | Only used by e0125_map02_nos_ and tpj_mapA_roadlm
|
✓ | |
| Terrain05 | Used extensively (91 times). | ✓ | ✓ |
| Terrain06 | |||
| Terrain07 | |||
| Tex_Phone | |||
| Tex_Spec_Phone | |||
| TpjWater00 | Tropical Jungle specific variant similar to Water03. | ✓ | |
| TpjWater01 | Tropical Jungle specific variant similar to Water04. | ✓ | |
| TwnFence00 | |||
| TwnGate | Used for warp gates. | ✓ | |
| TwnGlass00 | |||
| TwnGlideWire | |||
| TwnScene00 | ✓ | ||
| TwnScene01 | |||
| TwnScene02 | ✓ | ||
| TwnScene03 | |||
| vout | |||
| WapScene00 | ✓ | ||
| WapScene01 | |||
| WapScene02 | ✓ | ||
| Water00 | |||
| Water01 | Used by translucent waterfalls and splash effects. | ✓ | |
| Water02 | |||
| Water03 | Used for planar-reflection enabled liquids, water in Kingdom Valley and mercury pools in Aquatic Base. | ✓ | |
| Water04 | Used for static environment-mapped liquids. | ✓ | |
| Water05 | |||
| Waterrise | Unused Kingdom Valley object. Some kind of rippling water/mist. | ✓ | |
| Wood00 | ✓ | ✓ | |
| Wood01 | ✓ | ||
| Zakoress | Referring to "雑魚" small-fry crowd of NPCs, the tiny shadow minions in Mephiles' boss fight. | ✓ | |
| ZakoressBillboard | Billboarded approximation for distant Zakoress. | ||
| zout_pt | Used for rendering depth pre-pass for punchthrough. | ||
| zout | Used for rendering depth pre-pass. |