Skip to content

Instantly share code, notes, and snippets.

@QuadStorm
QuadStorm / CHSS_frag.glsl
Last active February 6, 2022 06:46
Contact-Hardening Soft Shadows for Blockland - Soft shadows that realistically soften or harden based on distance (NVIDIA version)
#version 120
#extension GL_EXT_texture_array : require
#extension GL_EXT_texture_array : enable
// Originally Port's Poisson Disc (Optimized) Soft Shadow Shader (2015), modified by Stealth Commander/QuadStorm
// Includes a Contact-Hardening/Percentage-Closer/Perceptually-Correct Soft Shadows (CHSS/PCSS) implementation, and other many configurable variables
// 10th version
// Configuration: For the adventurous!
@QuadStorm
QuadStorm / CHSS_frag.glsl
Last active January 10, 2021 06:28
CHSS Shader for Blockland, version 460
#version 460
// Stealth Commander/QuadStorm's Ulimate Shader (2021-01-10)
// Built from Port's Poisson Disc (Optimized) Soft Shadow Shader (2015)
// Includes a Contact-Hardening/Percentage-Closer/Perceptually-Correct Soft Shadows (CHSS/PCSS) implementation
/* Relevant Files
CSM
https://developer.download.nvidia.com/SDK/10.5/opengl/src/cascaded_shadow_maps/doc/cascaded_shadow_maps.pdf
CHSS/PCSS
@QuadStorm
QuadStorm / rendercsm_vert.glsl
Created September 27, 2018 18:06
Curved world vertex shader for Blockland
#version 120
#extension GL_EXT_texture_array : require
#extension GL_EXT_texture_array : enable
//curved world feature/effect; https://forum.blockland.us/index.php?topic=77967.msg7787623#msg7787623
bool curveTheWorld = true;
bool curveDirectionDown = true;
//adjust the effect
float curvePower = 2.0f; //exponential curve
float curveScale = 0.02f; //'fisheye factor', note that high values make lights higher than their real position
@QuadStorm
QuadStorm / timer.cs
Created January 1, 2020 06:17
2020-01-01 00:00:00
function ISOTimeStampFormat(%dateTime)
{
%pDT = strReplace(%dateTime, "/", " ");
return "20" @ getWord(%pDT, 2) @ "-" @ getWord(%pDT, 0) @ "-" @ getWord(%pDT, 1) SPC getWord(%pDT, 3);
}
function timeBottomPrint()
{
if (isEventPending($timeBottomPrint))
@QuadStorm
QuadStorm / brickadiaserver.ahk
Last active November 20, 2019 02:24
autosave, autorestart on close, autorefresh(restart) every ~9 days - made for lot build + cheeseville
#Persistent
#SingleInstance Force
SetTitleMatchMode 2
serverWindow = BrickadiaServer-Win64-Shipping.exe
EnvGet, LocalAppData, LocalAppData
buildsFolder = %LocalAppData%\Brickadia\Saved\Builds
SetKeyDelay, 5, 10
InputBox, BrickadiaDirectory, Input Brickadia Directory, Input the directory of your game (should end with "Brickadia_Alpha4_Patch1_CL3642_Win64")
@QuadStorm
QuadStorm / Blockland QuickSave Bricks.cs
Last active July 22, 2019 06:58
Save the current server's bricks in one keypress
// QuickSaver - Save the builds you come across in one keypress
// Won't work first time around for an unknown reason
// Host Name (by Visolater)
function visolatorGetHostName()
{
%s = $ServerInfo::Name;
%a = strPos(%s, "'s");
@QuadStorm
QuadStorm / CHSS_frag.glsl
Created June 16, 2019 01:06
CHSS for Blockland (AMD version)
#version 120
#extension GL_EXT_texture_array : require
#extension GL_EXT_texture_array : enable
// Originally Port's Poisson Disc (Optimized) Soft Shadow Shader (2015), modified by Stealth Commander/QuadStorm
// Includes a Contact-Hardening/Percentage-Closer/Perceptually-Correct Soft Shadows (CHSS/PCSS) implementation, and other many configurable variables
// 10th version
// Configuration: For the adventurous!
@QuadStorm
QuadStorm / CHSS_vert.glsl
Created June 8, 2019 16:15
Blockland Vertex Shader + Curved World, version 460
#version 460
// curved world feature/effect; https://forum.blockland.us/index.php?topic=77967.msg7787623#msg7787623
bool curveTheWorld = false;
bool curveDirectionDown = true;
// adjust the effect
// exponential curve power
@QuadStorm
QuadStorm / renderCsm_frag.glsl
Last active June 8, 2019 16:14
Default Blockland Fragment Shader using version 460
#version 460
// Varying.
in vec4 vPos;
in vec3 worldNormal;
in vec3 worldPos;
// Global directional light uniforms.
uniform vec4 dirLightDir;
uniform vec4 dirLightColor;
@QuadStorm
QuadStorm / renderCsm_vert.glsl
Created June 8, 2019 16:14
Default Blockland Vertex Shader using version 460
#version 460
// Varying.
out vec4 vPos;
out vec3 worldNormal;
out vec3 worldPos;
// 460
uniform mat4 gl_ProjectionMatrix;
in vec4 gl_Vertex;