Skip to content

Instantly share code, notes, and snippets.

View JSandusky's full-sized avatar

Jonathan Sandusky JSandusky

  • Ohio, United States
View GitHub Profile
std::vector<String> excludedExtensions = {
".exe",
".dll",
".bat",
".ini",
".layout",
".ilk",
".lib",
".pdb",
};
@JSandusky
JSandusky / imgui_bitfield.cpp
Created March 26, 2018 05:56
ImGui Bitfield Checkbox Matrix
bool BitField(const char* label, unsigned* bits, unsigned* hoverIndex)
{
unsigned val = *bits;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
unsigned oldFlags = window->Flags;
ImGuiContext* g = ImGui::GetCurrentContext();
@JSandusky
JSandusky / dead.cs
Created March 23, 2019 01:48
Ubernoise
[Description("Uses noise derivatives to produce an extremely versatile noise")]
[PropertyData.PropertyIgnore("Interpolation")]
public partial class UberNoise : NoiseGenerator
{
float lacunarity_ = 2.0f;
int octaves_ = 3;
float gain_ = 0.5f;
float perturbFeatures_ = 0.2f;
float sharpness_ = 0.7f;
float amplify_ = 0.7f;
@JSandusky
JSandusky / LightShadow.cpp
Last active June 27, 2022 21:44
ShadowAtlas / Clustering file
//****************************************************************************
//
// File: LightShadow.cpp
// License: MIT
// Project: GLVU
//
//****************************************************************************
#include "LightShadow.h"
@JSandusky
JSandusky / MotionWheel.cpp
Created February 22, 2019 00:45
Motion Wheel ... WTFPL
MotionWheel::MotionWheel(Context* ctx) : Component(ctx),
traveledDistance_(0.0f),
lastPosition_(Vector3(M_INFINITY, M_INFINITY, M_INFINITY))
{
SubscribeToEvent(E_SCENEPOSTUPDATE, URHO3D_HANDLER(MotionWheel, OnUpdate));
}
MotionWheel::~MotionWheel()
{
@JSandusky
JSandusky / VEZRenderScript.cpp
Created February 6, 2020 01:57
VEZ Renderer
#include "RenderScript.h"
#include "Buffer.h"
#include "Material.h"
#include "GraphicsDevice.h"
#include "Effect.h"
#include "LightShadow.h"
#include "Packing.h"
#include "Renderables.h"
#include "Renderer.h"
@JSandusky
JSandusky / Toon.hlsl
Created February 6, 2019 01:51
HLSL Toon Shader
//==========================================================
// Toon Shader
//==========================================================
// Features:
// - artist supplied *tone* ramp
// - Control map to force shadow/highlight
// - model-space vertical 1px shade control (hat shadows, etc)
// - MSDF *linework* map
// - rimlight glow
// - geometry-shader outlines
@JSandusky
JSandusky / IOCLite.cs
Last active February 11, 2022 19:27
Singleton access manager
/// <summary>
/// While null it will automatically check to seek out
/// </summary>
/// <typeparam name="T">Type of the object we we to acquire</typeparam>
public class IOCDependency<T> where T : class
{
public delegate void DependencyResolved(IOCDependency<T> self);
public event DependencyResolved DependencyResolvedHandler = delegate { };
@JSandusky
JSandusky / Effects\WaterGS.hlsl
Created May 13, 2018 03:31
DX11 Geometry Shader in Monogame
cbuffer ShaderData : register(b0)
{
matrix WorldViewProjection;
float3 LightDirection;
float3 LightColor;
};
struct VertexShaderOutput
{
@JSandusky
JSandusky / TileCache.cpp
Created October 29, 2020 03:02
Shadowmap Caching
//****************************************************************************
//
// File: LightShadow.cpp
// License: MIT
// Project: GLVU
//
//****************************************************************************
#include "LightShadow.h"