Skip to content

Instantly share code, notes, and snippets.

Jonathan Sandusky JSandusky

  • Ohio, United States
Block or report user

Report or block JSandusky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ImmediateRenderer.cpp
#include "ImmediateRender.h"
#include "../Core/Context.h"
#include "../Graphics/VertexBuffer.h"
#include "../Graphics/Camera.h"
#include "../Graphics/Graphics.h"
#include "../Scene/Node.h"
#include "../Input/Input.h"
#include "../Graphics/View.h"
#include "../Graphics/Viewport.h"
@JSandusky
JSandusky / StructArray.cs
Created May 26, 2019
Crude swap+pop container
View StructArray.cs
// Swap to pop array of structs
public class StructArray<T> where T : struct
{
public T[] items_;
public int Count { get; private set; }
public int Capacity { get; private set; }
public StructArray(int capacity)
{
Resize(capacity);
View dead.cs
[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 / MotionWheel.cpp
Created Feb 22, 2019
Motion Wheel ... WTFPL
View MotionWheel.cpp
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 / AnimProc.cpp
Created Feb 20, 2019
Keyframe extraction
View AnimProc.cpp
#include "AnimProc.h"
#include "../Graphics/Animation.h"
#include "../IO/Log.h"
namespace Urho3D
{
/// Pulls out an interpolated keyframe from a track based on time.
/// The time value of the key will be set to the given time value, overwrite if undesired.
@JSandusky
JSandusky / MaterialGraph.xml
Created Feb 6, 2019
Material graph node definition XML
View MaterialGraph.xml
<graph name="Material" candebug="false" color="orange">
<!--
<in /> = designates an input socket
<out /> = designates an output socket
<metadata></metadata> = can be attached to sockets or nodes themselves
List of Metadata: [NAME], [valid targets] = [purpose/effect]
@JSandusky
JSandusky / Toon.hlsl
Created Feb 6, 2019
HLSL Toon Shader
View Toon.hlsl
//==========================================================
// 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 / DEGFX.lua
Created Jan 22, 2019
DiligentEngine Premake
View DEGFX.lua
--[[
Usage:
// setup the paths and build options
DEGFX_InitPaths(...)
DEGFX_InitRenderers(...)
// add the projects to build
DEGFX_IncludeProjects()
@JSandusky
JSandusky / 27_Urho2DPhysics.as
Created Dec 16, 2018
Repro for Physics 2d raycast bug
View 27_Urho2DPhysics.as
// Urho2D physics sample.
// This sample demonstrates:
// - Creating both static and moving 2D physics objects to a scene
// - Displaying physics debug geometry
#include "Scripts/Utilities/Sample.as"
void Start()
{
// Execute the common startup for samples
@JSandusky
JSandusky / asPEEK.cpp
Last active Dec 13, 2018
asPEEK debugger: add `friend class asPEEK` as needed for access to `Script`' and `ScriptFile` internals
View asPEEK.cpp
/*
Copyright (c) 2012 Muhammed Ikbal Akpaca
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
You can’t perform that action at this time.