Skip to content

Instantly share code, notes, and snippets.

View JSandusky's full-sized avatar

Jonathan Sandusky JSandusky

  • Ohio, United States
View GitHub Profile
@JSandusky
JSandusky / Disp.inc
Created September 23, 2018 19:49
Monogame PBR Effect w/ POM
// Performs parallax
float HeightFieldRaycast(float2 dp, float2 ds)
{
const int linearSteps = 20;
const int binarySteps = 10;
float size = 1.0 / float(linearSteps);
float depth = 0.0;
for (int i = 0; i < linearSteps; i++)
@JSandusky
JSandusky / Notes.md
Last active July 11, 2020 03:19
Urho3D OpenVR

Stuff you have to fix to use it

  • I only scanned the first language in reading the JSON action manifest for names
    • you probably want all the names keyed on language
  • You probably need to remove the singlePass (not the same as singleTexture) code from it
  • Add SetElements to VertexBuffer, just set the elements and then call UpdateOffsets()
@JSandusky
JSandusky / asPEEK.cpp
Last active April 9, 2020 05:26
asPEEK debugger: add `friend class asPEEK` as needed for access to `Script`' and `ScriptFile` internals
/*
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:
@JSandusky
JSandusky / IMWidget.cpp
Created May 19, 2017 02:41
Nuklear in QT
#include "IMWidget.h"
#include <QAction>
#include <QApplication>
#include <QClipboard>
#include <QComboBox>
#include <QImage>
#include <QItemDelegate>
#include <QListWidget>
#include <QPainter>
@JSandusky
JSandusky / DecalMesh.cs
Created December 8, 2019 18:18
MonoGame Decal Mesh
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace DelveLib
{
public class DecalMesh : IDisposable
{
@JSandusky
JSandusky / ImGuiBindings.cpp
Last active November 19, 2019 19:45
Urho3D DearImGui
#include "../Precompiled.h"
#include "../AngelScript/Addons.h"
#include "../AngelScript/Script.h"
#include "../Math/Color.h"
#include "../Math/Vector2.h"
#include "../Math/Vector3.h"
#include "../Math/Vector4.h"
#include <AngelScript\angelscript.h>
#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 01:48
Crude swap+pop container
// 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);
@JSandusky
JSandusky / AnimProc.cpp
Created February 20, 2019 01:42
Keyframe extraction
#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 February 6, 2019 11:28
Material graph node definition 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]