Skip to content

Instantly share code, notes, and snippets.

View smkplus's full-sized avatar
😍
Curios

Seyed Morteza Kamali smkplus

😍
Curios
View GitHub Profile
// Because this framework is supposed to work with the legacy render pipelines AND scriptable render
// pipelines we can't use Unity's shader libraries (some scriptable pipelines come with their own
// shader lib). So here goes a minimal shader lib only used for post-processing to ensure good
// compatibility with all pipelines.
#ifndef UNITY_POSTFX_STDLIB
#define UNITY_POSTFX_STDLIB
// -----------------------------------------------------------------------------
// API macros
@smkplus
smkplus / Screen Indicators.md
Last active July 17, 2018 03:48
Positioning On-Screen Indicators to Point to Off-Screen Targets

http://www.vcskicks.com/regular-polygon.php

private Vector3[] CalculateVertices(int sides, int radius, int startingAngle, Vector3 center)
{
    if (sides < 3)
        throw new ArgumentException("Polygon must have 3 sides or more.");

    List<Vector3> points = new List<Vector3>();
 float step = 360.0f / sides;
@smkplus
smkplus / Shader Errors
Last active August 6, 2018 13:05
Shaderlab_Errors_Solution_Unity.md
Shader error in 'Example': Too many texture interpolators would be used for ForwardBase pass (11 out of max 10) at line 9
solution: use #pragma target 3.5 or greater
@smkplus
smkplus / CountDown Unity
Created August 19, 2018 06:44
CountDown Unity.md
````
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CountDown : MonoBehaviour {
public Text timerText;
public int timer;
void Start ()
{
private void OnDrawGizmos() {
Gizmos.color = Color.yellow;
float theta = 0;
float Radius = transform.localScale.magnitude;
float x = Radius*Mathf.Cos(theta);
float y = Radius*Mathf.Sin(theta);
Vector3 pos = transform.position+new Vector3(x,0,y);
Vector3 newPos = pos;
Vector3 lastPos = pos;
for(theta = 0.1f;theta<Mathf.PI*2;theta+=0.1f){
````
void vert (inout appdata_full v, out Input o){
UNITY_INITIALIZE_OUTPUT(Input,o);
}
````
@smkplus
smkplus / VHS Noise
Created November 14, 2018 10:40
VHS Noise
//https://www.shadertoy.com/view/XtBXDt
Shader "Hidden/Shader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
// No culling or depth
@smkplus
smkplus / Right to Left Github
Created November 25, 2018 17:50
فارسی نویسی در گیت هاب
<div dir="rtl"> &#9679; گرافیک سه بعدی </div>
<div dir="rtl"> &#9675; نور ها </div>
<div dir="rtl"> &#9675; نرمال مپ </div>
<div dir="rtl"> &#9675; Bump Map </div>
<div dir="rtl"> &#9675; Ray marching </div>
<div dir="rtl"> &#9675; مپ های محیطی (کروی و مکعبی) </div>
<div dir="rtl"> &#9675; بازتاب و شکست نور </div>