Skip to content

Instantly share code, notes, and snippets.

View JonRurka's full-sized avatar

jon Rurka JonRurka

View GitHub Profile
@JonRurka
JonRurka / test.cs
Last active November 3, 2015 21:13
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace loopBenchmark
{
class Program
/* Procedural Terrain Generation
* Peter Taylor (EmersonT1)
* Created: 29th November 2015
* A C# implementation of http://www.stuffwithstuff.com/robot-frog/3d/hills/index.html
*/
using System;
namespace Test1
{
class TerrainGen
Shader "GUI/3D Text Shader" {
Properties
{
_MainTex("Font Texture", 2D) = "white" {}
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
public TileLocation[] GetTouchingTiles(float distance) {
TileLocation thisTile = GetTileLocation();
List<TileLocation> touchingTiles = new List<TileLocation>();
// +1,-1
if (Distance(new LatLng(thisTile.Latitude + 1, thisTile.Longitude)) <= distance)
touchingTiles.Add(thisTile + new TileLocation(1, -1));
// +1,0
if (Distance(new LatLng(thisTile.Latitude + 1, Longitude)) <= distance)
@JonRurka
JonRurka / ArbitraryMatrix.cs
Last active January 23, 2018 20:30
An arbitrary size matrix with addition, subtraction and multiplication.
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
public class Matrix {
private float[,] data;
public int Rows { get; private set; }
public int Columns { get; private set; }
Shader "Custom/PlantShader"
{
Properties
{
_MainTex ("Texture", 2D) = "gray" {}
_Ambience("Ambience", Float) = 1
}
SubShader
{
//Tags { "Queue" = "AlphaTest" "RenderType" = "Transparent" }