Skip to content

Instantly share code, notes, and snippets.

@wtekteam
wtekteam / radarEffect.cs
Created January 31, 2016 11:54
Unity's radar effect: renders object which are just detected and then disable the renderer (out of the radar field of view).
// Author: Fabien ROUALDES
// Date: 31/01/2016
//
//
// Render objects which are in the radar field of view.
// The radar is rotating around a camera
//
using UnityEngine;
using System.Collections;
@wtekteam
wtekteam / WireFrame.cs
Created January 25, 2016 11:32
A robust GL wireframe
/*
wireframe update benjamin kiesewetter 2013
faster
normals
vertex extensions
*/
using UnityEngine;
using System.Collections;
@wtekteam
wtekteam / MatteShadow.shader
Last active March 6, 2020 16:16
Shader that set invisible the object but receive shadows (= Matte Shadow effect from 3DSMax). Source: http://forum.unity3d.com/threads/matte-shadow.14438/.
Shader "FX/Matte Shadow" {
Properties {
_Color ("Shadow Color", Color) = (1,1,1,1)
_ShadowInt ("Shadow Intensity", Range(0,1)) = 1.0
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {
@wtekteam
wtekteam / wireframe.cs
Created November 27, 2015 17:11
An easy implementation for a Wireframe render (to use with the specifical shader).
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Wireframe : MonoBehaviour
{
public Color lineColor;
public Material lineMaterial;
private MeshFilter filter;
@wtekteam
wtekteam / HeadTracker.cs
Last active May 20, 2021 21:09
Gyroscope Head Tracking for Unity
using UnityEngine;
using System.Collections;
// Activate head tracking using the gyroscope
// The script must be linked to the main camera
public class HeadTracking : MonoBehaviour
{
// The initials orientation
private int initialOrientationX;
private int initialOrientationY;
@wtekteam
wtekteam / VertexColorSize.shader
Created October 28, 2015 10:51
A vertex / fragment shader permitting to display vertex color and change its size (OpenGL).
Shader "VertexColorSize" {
SubShader {
Pass {
GLSLPROGRAM
#ifdef VERTEX
varying vec4 v_color;
void main()
{
gl_PointSize = 10.0;
@wtekteam
wtekteam / VertexColor.shader
Last active October 27, 2015 14:17
A simple vertex color shader using CG.
Shader "VertexColour"
{
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"