Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
✅
‏‏‎

mika unitycoder

✅
‏‏‎
View GitHub Profile
@unitycoder
unitycoder / scroll-image-ui.shader
Created December 27, 2018 07:36
Scrolling UI Image
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// unitycoder.com: added simple scrolling UV
Shader "UI/Default-Scroll"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
@unitycoder
unitycoder / playfromhere.cs
Created December 21, 2018 07:31
small script that allows you to start the PlayMode from a specific point in the scene simply by right-clicking
// https://old.reddit.com/r/Unity3D/comments/a82vcm/stop_wasting_time_while_testing_and_play_from/
using UnityEngine;
using UnityEditor;
[CreateAssetMenu(fileName = "PlayFromHereData")]
public class PlayFromHereInitData : ScriptableObject
{
public GameObject[] m_arOriginPrefabs;
public GameObject[] m_arPositionPrefabs;
@unitycoder
unitycoder / marching-ants-outline.shader
Created December 19, 2018 18:55
Unity Marching Ants Sprite Outline Shader
// original source: https://github.com/wlgys8/Sprites-Outline
Shader "Sprites/Outline (Marching Ants)"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
@unitycoder
unitycoder / circle.shader
Created December 18, 2018 10:39
Unity Antialiased Circle Shader
// https://forum.unity.com/threads/antialiasing-circle-shader.432119/#post-2796401
Shader "Unlit/Circle"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
}
SubShader
{
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
@unitycoder
unitycoder / TerrainShaderTessellationDiffuse.shader
Created December 14, 2018 19:33
Terrain Shader Tesselation Diffuse
// Author: Przemyslaw Zaworski
// Modified version of original:
// https://github.com/przemyslawzaworski/Unity3D-CG-programming/blob/master/terrain_shader_tessellation_diffuse.shader
// Shader supports maximum four splat textures (Splat and Normal maps) with triangle tessellation.
// Works seamlessly with built-in Terrain Component. Lambert light model (directional) with shadow casting and receiving.
// https://forum.unity.com/threads/how-to-dynamically-tessellate-a-mesh.597469/#post-3997999
Shader "Terrain Shader Tessellation Diffuse"
{
Properties
@unitycoder
unitycoder / 0DepthOnly.shader
Last active February 11, 2025 17:23
Write To Depth from Frag Shader (outDepth : SV_Depth)
// https://forum.unity.com/threads/depth-texture-on-objects-materials.1439071/
Shader "Unlit/ZDepthOnly"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
@unitycoder
unitycoder / realsense-librealsense.txt
Created December 7, 2018 09:19
RealSense LibRealSense Compiling And Unity Wrappers
// https://github.com/IntelRealSense/librealsense/tree/master/wrappers/unity
// ERROR:
$ cmake .. -DBUILD_CSHARP_BINDINGS=ON -DBUILD_UNITY_BINDINGS=ON -DBUILD_SHARED_LIBS=ON -DDOTNET_VERSION_LIBRARY=3.5 -DCMAKE_GENERATOR_PLATFORM=x64
CMake Error at CMakeLists.txt:3 (project):
Generator
NMake Makefiles
does not support platform specification, but platform
@unitycoder
unitycoder / unity-multiprojector-setup-eyefinity-surround.txt
Last active January 20, 2019 12:47
Unity Multiple Monitor Projector Setup AMD EyeFinity Nvidia Surround Camera
if your are using AMD EyeFinity to combine 3 screens (1280x800 each) into 1 screen (3840x800):
can use shortcut with parameters to match combined screen size
"your.exe" -adapter 1 -popupwindow -screen-width 3840 -screen-height 800
// from unity build settings
[x] default is full screen
[x] default is native resolution
[ ] capture single screen
[ ] resolution dialog
@unitycoder
unitycoder / nuitrack.txt
Created December 3, 2018 10:10
Nuitrack Notes Unity
- install runtime 64bit: http://download.3divi.com/Nuitrack/doc/Installation_page.html#install_windows_sec
- follow instructions on that page
download unity package
- from main page download for unity, or http://download.3divi.com/Nuitrack/NuitrackSDK.zip
- unzip, import unitypackage to your project
-