Skip to content

Instantly share code, notes, and snippets.

@QuadStorm
QuadStorm / PCSS5_frag.glsl
Created June 3, 2018 02:07
A highly configurable shader file for Blockland with several fancy features including PCSS.
#version 120
#extension GL_EXT_texture_array : require
#extension GL_EXT_texture_array : enable
#extension GL_EXT_gpu_shader4 : require
#extension GL_EXT_gpu_shader4 : enable
// Port's Poisson Disc (Optimized) Soft Shadow Shader (2015), modified by Stealth Commander/QuadStorm
// Includes an ultra graphics version, a Percentage-Closer Soft Shadows (PCSS) implementation, and other smaller configuration variables
@QuadStorm
QuadStorm / Blockland Rot-N Function.cs
Last active June 3, 2018 02:07
Shift characters in a string like rot-13
// made on 12/24/2017
// rotNString 'string', shift # (postive or negative work), %m for whether to allow nonletters to pass through
function shiftCharS(%c, %offset, %mode)
{
%letters = "abcdefghijklmnopqrstuvwxyz";
if (%offset !$= (%offset | 0)) // first %offse
return "offset isn't a number";
if (strLen(%c) != 1)
return "one character only";
@QuadStorm
QuadStorm / FontChanger.cs
Last active June 21, 2018 00:12
Change the fonts around in Blockland.
// potentially useful guis list
// PlayGui_ShapeNameHud - shape names
// ISSUES (old)
// changing text size on options is broken - no longer the case?
$fontChange::primaryFont = "Segoe UI";
$fontChange::fontSizeScale = 1;
function fontToggle(%bool)
@QuadStorm
QuadStorm / PCSS_frag.glsl
Last active August 2, 2018 06:12
PCSS6 + specular power = PCSS7; should be more consistent across settings and cleaner code
#version 120
#extension GL_EXT_texture_array : require
#extension GL_EXT_texture_array : enable
//#extension GL_EXT_gpu_shader4 : require
//#extension GL_EXT_gpu_shader4 : enable
// Port's Poisson Disc (Optimized) Soft Shadow Shader (2015), modified by Stealth Commander/QuadStorm
// Includes an ultra graphics version, a Percentage-Closer Soft Shadows (PCSS) implementation, and other configuration variables
@QuadStorm
QuadStorm / renderCSMPCSS_frag.glsl
Last active August 3, 2018 19:14
An attempt to make PCSS better
#version 120
#extension GL_EXT_texture_array : require
#extension GL_EXT_texture_array : enable
//#extension GL_EXT_gpu_shader4 : require
//#extension GL_EXT_gpu_shader4 : enable
// Port's Poisson Disc (Optimized) Soft Shadow Shader (2015), modified by Stealth Commander/QuadStorm
// Includes an ultra graphics version, a Percentage-Closer Soft Shadows (PCSS) implementation, and other configuration variables
@QuadStorm
QuadStorm / BlocklandQuickBatchImgurLinks.cs
Last active August 17, 2018 23:04
Make gallery posts using a list of imgur links using TorqueScript; assumes PNG images and will have the images tiled by two at 1080p.
@QuadStorm
QuadStorm / PCSS8_frag.glsl
Last active August 21, 2018 23:06
PCSS for Blockland redone, hopefully more faithful to original implementation.
#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 an ultra graphics version, a Percentage-Closer/Perceptually-Correct Soft Shadows (PCSS) implementation, and other configuration variables
// 8th version
// Configuration: For the adventurous!
@QuadStorm
QuadStorm / pmmod
Last active September 30, 2018 05:13
PM Mod
$Server::PMDelay = 3;
$Server::PMColor = 4;
function serverCmdPM(%client, %target, %a, %b, %c, %d, %e, %f, %g, %h, %i, %j, %k, %l, %m, %n, %o, %p, %q, %r, %s, %t, %u, %v, %w, %x, %y, %z, %ab, %ac, %ad)
{
if ($pmBans_[%client.getBL_ID()])
{
messageClient(%client, '', "You are banned from sending PMs.");
return;
}
@QuadStorm
QuadStorm / misc.cs
Last active October 13, 2018 15:43
miscellaneous scripts
function scroll(%text)
{
%charcount = getCharCount(%text);
for (%i; %i < %charcount; %i++)
{
}
}
@QuadStorm
QuadStorm / BrickifyTerrain.cs
Last active December 10, 2018 20:50
Originally made by Treynolds416. Safety checks removed -- Don't use on a public server. Samples terrain heights around each point and averages them for smoother terrain.
//BrickifyTerrain
//Turns map terrain into a 4x4 cubescape (I couldn't think of a better name)
%cubes = forceRequiredAddOn("Brick_Large_Cubes");
if(%cubes == $Error::AddOn_NotFound)
return;
$dbSelect = brick16xCubeData; // For use in Brickadia, Replace the UI name in resulting BLS files with with 4x4x200f
$dbSp = 8;
$factor = 3;
$factor2 = 2;