Skip to content

Instantly share code, notes, and snippets.

View danamuise's full-sized avatar

Dana Muise danamuise

View GitHub Profile
@danamuise
danamuise / sparkARscript.js
Created December 9, 2021 06:14
Javascript for Spark AR
/**
*
* By Dana Muise 12/8
* generate n number of objects within a circle
* Have another object animate to each and remove it
*/
// Load in the required modules
const Scene = require('Scene');
@danamuise
danamuise / Basic Custom Shaders
Last active October 20, 2021 06:05
My basic HLSL Shaders written from scratch
Shader "custom/StandardSpecularPBR"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MetallicTex ("Metallic (R)", 2D) = "white" {}
_SpecColor ("Specular Color", Color) = (1, 1, 1, 1)
}
SubShader
{
@danamuise
danamuise / Earthquake frag shader
Created December 28, 2018 19:38
This is a GLSL post processor frag shader used in AR Spark (Facebook Messenger AR effects). It creates a random UV shaking effect.
varying vec2 hdConformedUV;
varying vec2 uv;
uniform sampler2D inputImage;
uniform int passIndex;
uniform vec2 uRenderSize;
uniform float uTime;
float random (in vec2 st)
{
return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);
@danamuise
danamuise / Gameboy preprocessor frag shader
Created December 28, 2018 19:33
This is 3-pass GLSL preprocess fragment shader used in AR Spark (Facebook messenger AR effects)
varying vec2 hdConformedUV;
varying vec2 uv;
uniform sampler2D inputImage;
uniform int passIndex;
uniform vec2 uRenderSize;
uniform float uTime;
uniform float uPixelRes; // For UI parameters
uniform sampler2D pixelate; //pass 0
uniform sampler2D colorize; //pass 1
uniform sampler2D grid; //pass2
@danamuise
danamuise / Classic Snake game in JS
Last active October 20, 2021 04:50
the classic snake game in javascript
<html>
<head>
<title>Snake Game</title>
<style>
canvas{
display: block;
margin: 0 auto;
}
</style>
</head>
@danamuise
danamuise / InstanceAdd.cs
Last active May 5, 2018 19:08
Unity C# instantiates a child object at run time based on frequency or usage. This improves performance, as it can be used to instantiates particle effects only when they are needed, also reduced particle emissions when frame rate drops below a specified amount.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace ProjectKing {
/**
//Add this script to a gameobject that you would like to instantiate a particle effect object
//Also optimizes particle emmisions based on frame rate drop
//
**/
@danamuise
danamuise / Glass.shader
Last active January 10, 2017 23:03
Custom Unity Shaders
Shader "PACKT/Glass" {
// Custom glass shader by Dana Muise
// Mutli pass functions provide transparent effects on both sides of geometry.
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
@danamuise
danamuise / MyPokerGame.java
Created January 10, 2017 22:59
Console based poker game in Java
package PJ4;
import java.util.*;
/* A Console based poker game by Dana Muise (SFSU 913048115) 6/2016
* This is the main poker game class.
* It uses Decks and Card objects to implement poker game.
*/
public class MyPokerGame {
using UnityEngine;
using System.Collections;
/*
This script controls generic non-player characters that follow another character.
*/
public class Follow_NonPlayer : MonoBehaviour {
Animator anim;
NavMeshAgent agent;
using UnityEngine;
using System.Collections;
/*
This script controls generic non-player characters with NavAgent component that walk around the
envronment, visiting waypoints and avoiding collisions.
*/
public class Generic_NonPlayer : MonoBehaviour {
private GameObject[] wayPoints;