Skip to content

Instantly share code, notes, and snippets.

@ya7gisa0
ya7gisa0 / Gem_CameraSpace.shader
Created May 4, 2018
Experiment with "_WorldSpaceCameraPos" in Unity3D
View Gem_CameraSpace.shader
// based on this shader (https://assetstore.unity.com/packages/vfx/shaders/gem-shader-3)
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "FX/Gem_CameraSpace"
{
Properties {
[HDR] _Color ("Color", Color) = (1,1,1,1)
_ReflectionStrength ("Reflection Strength", Range(0.0,2.0)) = 1.0
_EnvironmentLight ("Environment Light", Range(0.0,2.0)) = 1.0
@ya7gisa0
ya7gisa0 / Architecture_Base_Unlit.shader
Created May 2, 2018
Experiment with "_WorldSpaceCameraPos"
View Architecture_Base_Unlit.shader
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "Unlit/Architecture_Base_Unlit"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,1)
_Luminosity("Luminosity", Float) = 10
_ArchitectureScale("Arch Scale", Float) = 30
@ya7gisa0
ya7gisa0 / CustomColorGrading.shader
Last active Apr 17, 2018
Saturation Filter for Unity3D
View CustomColorGrading.shader
// This shader is hugely based on "saturation" by megaloler (https://www.shadertoy.com/view/XttGWB)
Shader "Hidden/CustomColorGrading"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_saturation("saturation value", Float) = 0.3
}
SubShader
@ya7gisa0
ya7gisa0 / Dispersion.shader
Created Dec 11, 2017
Shadertoy to Unity | Displacement with Dispersion, The shader code is converted to use in Unity3D from "Displacement with Dispersion" created by cornusammonis on Shadertoy(https://www.shadertoy.com/view/4ldGDB)
View Dispersion.shader
// The shader code is converted to use in Unity3D from
// "Displacement with Dispersion" created by cornusammonis on Shadertoy(https://www.shadertoy.com/view/4ldGDB)
Shader "Custom/Dispersion" {
Properties {
iChannel1("Albedo (RGB)", 2D) = "white" {}
iChannel2("Albedo (RGB)", 2D) = "white" {}
}
SubShader{
Tags { "RenderType" = "Opaque" }
@ya7gisa0
ya7gisa0 / Lightning.shader
Last active Dec 8, 2017
Unity3D | Another lightning shader for Unity, added "_CustomTime" property, which enables you to render many lightnings that would look different individually based on how many materials you would create by attaching this shader.
View Lightning.shader
//Code is converted to use in Unity(ShaderLab) from
//Lightining by asti
//on Shadertoy(https://www.shadertoy.com/view/Xds3Rj)
Shader "Custom/Lightning"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_CustomTime("TimeDiff", Float) = 0.5
@ya7gisa0
ya7gisa0 / AnimationController.cs
Last active Dec 5, 2017
Unity3D | Swarm-like Animation
View AnimationController.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AnimationController : MonoBehaviour {
private float speed;
private Vector3 destination = new Vector3(10, 20, 1);
private Vector3 initialTargetPosition;
private bool isInitialMotion = true;
@ya7gisa0
ya7gisa0 / Controller.cs
Created Dec 4, 2017
Unity3D | Rotate around objects
View Controller.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Controller : MonoBehaviour {
public Transform prefab;
// Use this for initialization
void Start () {
for (int i = 0; i < 300; i++)
@ya7gisa0
ya7gisa0 / Lightning.shader
Created Nov 30, 2017
Another Lightning Shader for Unity3D. Added alpha channel and gradient
View Lightning.shader
//Code is converted to use in Unity(ShaderLab) from
//Lightining by asti
//on Shadertoy(https://www.shadertoy.com/view/Xds3Rj)
Shader "Custom/Lightning"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
@ya7gisa0
ya7gisa0 / Lightning.shader
Last active Nov 28, 2017
Unity3D | Lightning Shader
View Lightning.shader
//Code is converted to use in Unity(ShaderLab) from
//Lightining by asti
//on Shadertoy(https://www.shadertoy.com/view/Xds3Rj)
Shader "Custom/Lightning"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
@ya7gisa0
ya7gisa0 / CurlNoise.compute
Last active Feb 5, 2020
Unity3D | Curl Noise x Compute Shader
View CurlNoise.compute
// https://github.com/keijiro/NoiseShader
#include "HLSL/SimplexNoise3D.hlsl"
#pragma kernel CSParticle
// Particle's data
struct Particle
{
float3 position;
float3 velocity;
You can’t perform that action at this time.