Advertisement
Mawntee

Beat Saber shader shit

Apr 14th, 2024 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Godot GLSL 12.23 KB | Gaming | 0 0
  1. // y'all ever run into the weird quirky issue where you try to apply a post process shader using blit but u don't fill the `_MainTex`
  2. // texture slot right away and some other random ass texture sneaks on in there and starts squatting on your desktop and hmd views
  3. // refusing to leave so you start looking into the issue only to find out that like every shader in the game uses a bunch of global
  4. // shader variables so you decided to decompile every shader in game version 1.29.1 to try and see wtf is going on and you end up
  5. // making a massive list of every single variable and texture that could possibly be a global what the frick ever and then list off
  6. // exactly which shader each global variable is tied to just in case anyone would ever need this information for some reason and then
  7. // think man wait why stop there lets figure out the grabpasses (there's only one lol) and also the stencil buffer stuff?
  8. // ...because I did
  9.  
  10.  
  11.  
  12. // (guys i think i might be autistic)
  13.  
  14.  
  15.  
  16. // - From 1.29.1
  17. // Shader Globals: -----------------------------------------------------------------------------------
  18.  
  19.  
  20. // $Globals ConstantBuffers for Vertex Shader
  21.             uniform float4      _MainTex_ST;  // From : "Custom/Rain","Custom/ScreenDisplacementHD","Custom/SliderNoteCrossedStrips","Hidden/BlitAdd", "Hidden/BlitTint","Hidden/HM/KawaseBlur","Hidden/MainEffect","Hidden/PostProcessing/Bloom"
  22.             uniform float4      _MainTex_TexelSize;  // From : "Hidden/HM/KawaseBlur","Hidden/MainEffect"
  23.             uniform float       _Speed;  // From : "Custom/CloudsOpaque","Custom/Rain"
  24.             uniform float       _Height;  // From : "Custom/Rain"
  25.             uniform float       _TopPosition;  // From : "Unlit/HologramRays"
  26.             uniform float       _BottomPosition;  // From : "Unlit/HologramRays"
  27.             uniform float       _ScaleInverse;  // From : "Unlit/HologramRays"
  28.             uniform float2      _UvPanning;  // From : "Custom/CustomParticles","Custom/Rain","Custom/SliderNoteCrossedStrips"
  29.             uniform float       _GlobalRandomValue;  // From : "Custom/BloomSkyboxQuad","Custom/Mirror","Custom/OpaqueNeonLight","Custom/Spectrogram"
  30.             uniform float2      _GlobalBlueNoiseParams;  // From : "Custom/BloomSkyboxQuad","Custom/Mirror","Custom/OpaqueNeonLight","Custom/Spectrogram"
  31.             uniform float       _StereoCameraEyeOffset;  // From : "Custom/Beatmap Editor/ObstacleCore","Custom/BloomSkyboxQuad","Custom/Glowing","Custom/GlowingInstancedHD","Custom/GlowingInstancedLW","Custom/Mirror","Custom/ObstacleCoreLW","Custom/OpaqueNeonLight","Custom/ParametricBoxFakeGlow","Custom/ParametricBoxFrameHD","Custom/ParametricBoxFrameLW","Custom/Spectrogram","Custom/UnlitSpectrogram"
  32.             uniform float2      _CustomFogTextureToScreenRatio;  // From : "Custom/Beatmap Editor/ObstacleCore","Custom/BloomSkyboxQuad","Custom/Glowing","Custom/GlowingInstancedHD","Custom/GlowingInstancedLW","Custom/Mirror", "Custom/ObstacleCoreLW","Custom/OpaqueNeonLight","Custom/ParametricBoxFakeGlow","Custom/ParametricBoxFrameHD","Custom/ParametricBoxFrameLW","Custom/Spectrogram","Custom/UnlitSpectrogram"
  33.             uniform float4x4    _VertexTransformMatrix;  // From : "Custom/BloomPrePassLine"
  34.             uniform float4x4    _InverseProjectionMatrix;  // From : "Hidden/SkyGradient","Hidden/SkyGradient"
  35.             uniform float4x4    _CameraToWorldMatrix;  // From : "Hidden/SkyGradient","Hidden/SkyGradient"
  36.             uniform float2      _TextureScrolling;  // From : "Custom/Mirror"
  37.             uniform float4      _NormalTex_ST;  // From : "Custom/Mirror"
  38.             uniform float4x4    _SpawnRotation;  // From : "Custom/Beatmap Editor/BeatmapObject","Custom/NoteHD","Custom/NoteLW"
  39.             uniform float4      _DitherTex_ST;  // From : "Custom/Beatmap Editor/BeatmapObject","Custom/Beatmap Editor/DurationObject","Custom/Beatmap Editor/ObstacleCore"
  40.             uniform float       _CapUVSize;  // From : "Custom/Parametric3SliceSprite"
  41.             uniform float       _AngleDisappearParam;  // From : "Custom/ParametricBoxFakeGlow"
  42.             uniform float       _LightRimScale;  // From : "Custom/SaberBlade"
  43.             uniform float       _LightRimOffset;  // From : "Custom/SaberBlade"
  44.             uniform float3      _RimPerpendicularAxis;  // From : "Custom/SaberBlade"
  45.             uniform float       _NoiseSmallScale;  // From :  "Custom/SimpleLightning"
  46.             uniform float       _NoiseSpeedScale;  // From : "Unlit/HologramRays"
  47.             uniform float       _NoiseOffsetScale;  // From : "Unlit/HologramRays"
  48.             uniform float       _SmallScaleNoiseStrength;  // From : "Custom/SimpleLightning"
  49.             uniform float       _SmallScaleNoiseScrollingSpeed;  // From : "Custom/SimpleLightning"
  50.             uniform float       _NoiseBigScale;  // From : "Custom/SimpleLightning"
  51.             uniform float       _BigScaleNoiseStrength;  // From : "Custom/SimpleLightning"
  52.             uniform float       _BigScaleNoiseScrollingSpeed  // From : "Custom/SimpleLightning"
  53.             uniform float       _Extrude;  // From : "Custom/SimpleLightning"
  54.             uniform float       _EdgeFadeStrength;  // From : "Custom/SimpleLightning"
  55.             uniform float       _XNoiseOffsetStrength;  // From : "Custom/SimpleLightning"
  56.             uniform float       _TrackLaneYPosition;  // From : "Custom/SliderNoteCrossedStrips"
  57.             uniform float       _AttractorFadeLength;  // From : "Custom/SliderNoteCrossedStrips"
  58.             uniform float       _AttractorFadeOffset;  // From : "Custom/SliderNoteCrossedStrips"
  59.             uniform float       _Width;  // From : "Custom/SliderNoteCrossedStrips"
  60.             uniform float       _AttractorAttack;  // From : "Custom/SliderNoteCrossedStrips"
  61.             uniform float3      _PeakOffset;  // From : "Custom/Spectrogram"
  62.             uniform float       _SpectrogramData[64];  // From : "Custom/Spectrogram"
  63.             uniform float4      _Offset;  // From : "Hidden/HM/KawaseBlur"
  64.             uniform float       _AlphaNoiseStrength;  // From : "Unlit/HologramRays"
  65.             uniform float       _AlphaNoiseScale;  // From : "Unlit/HologramRays"
  66.             uniform float       _AlphaNoiseSpeed;  // From : "Unlit/HologramRays"
  67.             uniform float       _AvatarScaleInverse;  // From : "Unlit/HologramRays"
  68.             uniform float2      _WidthStartEnd;  // From : "Unlit/HologramRays"
  69.  
  70.  
  71. // $Globals ConstantBuffers for Fragment Shader
  72.             uniform float   _GlobalRandomValue;  // From : "Hidden/MainEffect"
  73.             uniform float2  _GlobalBlueNoiseParams;  // From : "Hidden/MainEffect"
  74.             uniform float4  _Color;  // From : "ClearBackground",
  75.             uniform float4  _FinalColorMul;  // From : "Custom/Beatmap Editor/BeatmapObject"
  76.             uniform float4  _MainTex_ST;  // From : "Custom/SaberBlade", "Custom/StarText","Custom/UISVColorPicker"
  77.             uniform float4  _MainTex_TexelSize;  // From : "Hidden/PostProcessing/Bloom"
  78.             uniform float2  _MainTexSpeed;  // From : "Custom/SaberBlade"
  79.             uniform float   _Brightness;  // From : "Custom/SaberBlade"
  80.             uniform float   _CustomFogAttenuation;  // From :
  81.             uniform float   _CustomFogOffset;  // From :
  82.             uniform float   _FogStartOffset;  // From :
  83.             uniform float   _FogScale;  // From :
  84.             uniform float   _CustomFogHeightFogStartY;  // From : "Custom/ParametricBoxFakeGlow","Custom/ParametricBoxFrameHD","Custom/Spectrogram"
  85.             uniform float   _CustomFogHeightFogHeight;  // From : "Custom/ParametricBoxFakeGlow","Custom/ParametricBoxFrameHD","Custom/Spectrogram"
  86.             uniform float   _FogHeightScale;  // From : "Custom/ParametricBoxFrameHD"
  87.             uniform float   _FogHeightOffset;  // From : "Custom/ParametricBoxFrameHD"
  88.             uniform float   _BaseColorBoost;  // From : "Custom/GlowingInstancedHD","Custom/GlowingInstancedLW","Custom/OpaqueNeonLight","Custom/TransparentNeonLight","Hidden/MainEffect"
  89.             uniform float   _BaseColorBoostThreshold;  // From : "Custom/GlowingInstancedHD","Custom/GlowingInstancedLW","Custom/OpaqueNeonLight","Custom/TransparentNeonLight","Hidden/MainEffect"
  90.             uniform float   _BloomIntensity;  // From : "Hidden/MainEffect"
  91.             uniform float   _AdditiveAlpha;  // From : "Hidden/HM/KawaseBlur"
  92.             uniform float   _Boost;  // From : "Hidden/HM/KawaseBlur"
  93.             uniform float   _ColorBoost;  // From :
  94.             uniform float   _WhiteBoost;  // From :
  95.             uniform float   _BloomIntensity;  // From :
  96.             uniform float   _Intensity;  // From : "Custom/CustomParticles", "Custom/Rain","Custom/SliderNoteCrossedStrips"
  97.             uniform float   _Progress;  // From : "Custom/StarText"
  98.             uniform float   _Alpha;  // From : "Custom/StarText","Hidden/BlitAdd","Unlit/HologramRays"
  99.             uniform float   _AlphaMultiplier;  // From : "Custom/CustomParticles","Custom/Rain","Custom/SliderNoteCrossedStrips"
  100.             uniform float   _AlphaWeights;  // From : "Hidden/PostProcessing/Bloom"
  101.             uniform float4  _TextureSampleAdd;  // From : "Custom/CustomUI"
  102.             uniform float4  _ClipRect;  // From : "Custom/CustomUI"
  103.             uniform float   _FadeOutStrength;  // From : "Custom/FadeOutTexture"
  104.             uniform float   _FadeStartNormalizedDistance;  // From : "Custom/Glowing Pointer"
  105.             uniform float   _BumpIntensity;  // From : "Custom/Mirror"
  106.             uniform float   _Smoothness;  // From : "Custom/Beatmap Editor/BeatmapObject"
  107.             uniform float   _ReflectionIntensity;  // From : "Custom/Mirror"
  108.             uniform float   _FinalColorMul;  // From : "Custom/NoteHD", "Custom/NoteLW"
  109.             uniform float4  _SimpleColor;  // From : "Custom/NoteHD", "Custom/NoteLW"
  110.             uniform float4  _TintColor;  // From : "Custom/Beatmap Editor/ObstacleCore","Custom/ObstacleCoreLW","Custom/SaberBlade","Custom/ScreenDisplacementHD","Hidden/BlitTint"
  111.             uniform float4  _AddColor;  // From : "Custom/Beatmap Editor/ObstacleCore","Custom/ObstacleCoreLW","Custom/ScreenDisplacementHD"
  112.             uniform float   _TintColorAlpha;  // From : "Custom/Beatmap Editor/ObstacleCore","Custom/ObstacleCoreLW"
  113.             uniform float3  _Size;  // From : "Custom/Beatmap Editor/ObstacleCore",
  114.             uniform float   _DisplacementStrength;  // From : "Custom/ScreenDisplacementHD"
  115.             uniform float   _DisplacementAlphaMul;  // From : "Custom/ScreenDisplacementHD"
  116.             uniform float4  _TextureSampleAdd;  // From : "Custom/UISVColorPicker"
  117.             uniform float4  _ClipRect;  // From : "Custom/UISVColorPicker"
  118.             uniform float   _SpectrogramScale;  // From : "Custom/UnlitSpectrogram"
  119.             uniform float   _SpectrogramData[64];  // From : "Custom/UnlitSpectrogram"
  120.             uniform float4  _DitherMult;  // From : "Custom/Beatmap Editor/BeatmapObject","Custom/Beatmap Editor/DurationObject"
  121.  
  122.  
  123. // Global Textures
  124.             uniform sampler2D   _GlobalBlueNoiseTex;
  125.             uniform sampler2D   _GlobalBlueNoiseTex;
  126.             uniform sampler2D   _GlobalIntensityTex;
  127.             uniform sampler2D   _BloomPrePassTexture;
  128.  
  129.  
  130. // Texture params for Vertex Shader
  131.             sampler2D   _TimingTex;  // From : "Custom/SimpleLightning","Custom/SimpleLightning"
  132.             sampler2D   _NoiseTex;  // From : "Custom/SimpleLightning","Custom/SimpleLightning"
  133.  
  134.  
  135. // Texture params for Fragment Shader
  136.             sampler2D   _MainTex;  // From : "Custom/BloomPrePassLine","Custom/ParametricBoxFakeGlow","Custom/Rain","Custom/SaberBlade","Custom/SimpleLightning","Custom/SliderNoteCrossedStrips","Custom/StarText","Custom/UISVColorPicker","Hidden/BlitAdd","Hidden/BlitTint","Hidden/MainEffect","Hidden/PostProcessing/Bloom"
  137.             sampler2D   _BloomTex;  // From :  "Hidden/MainEffect"
  138.             sampler2D   _NormalTex;  // From : "Custom/Mirror"
  139.             sampler2D   _ReflectionTex;  // From : "Custom/Mirror"
  140.             sampler2D   _GradientTex;  // From : "Hidden/SkyGradient","Hidden/SkyGradient"
  141.             sampler2D   _GlobalBlueNoiseTex;  // From : "Custom/BloomSkyboxQuad","Custom/Mirror","Custom/Spectrogram", "Hidden/MainEffect"
  142.             sampler2D   _GrabTexture1;  // From : "Custom/ScreenDisplacementHD"
  143.             samplerCUBE _EnvironmentReflectionCube;  // From : "Custom/Beatmap Editor/BeatmapObject"
  144.             sampler2D   _DitherTex;  // From : "Custom/Beatmap Editor/BeatmapObject","Custom/Beatmap Editor/DurationObject,"Custom/Beatmap Editor/ObstacleCore"
  145.  
  146.  
  147.  
  148.  
  149. // GrabPass: -----------------------------------------------------------------------------------
  150.  
  151.  
  152. GrabPass {
  153.          "_GrabTexture1"
  154.          }
  155.  
  156. // help it took me way too long to realize they're all the same so I just kept going :'(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement