using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScreenIndicator : MonoBehaviour {
public Transform targetPosOnScreen;
public Transform Indicator;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
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;
https://forum.unity.com/threads/accessing-depth-buffer-from-a-surface-shader.404380/
https://gamedev.stackexchange.com/questions/158243/surface-depth-intersection-shader#
Surface Shader:
Shader "Intersection/SimpleSurface" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```` | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class CountDown : MonoBehaviour { | |
public Text timerText; | |
public int timer; | |
void Start () | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```` | |
void vert (inout appdata_full v, out Input o){ | |
UNITY_INITIALIZE_OUTPUT(Input,o); | |
} | |
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.shadertoy.com/view/XtBXDt | |
Shader "Hidden/Shader" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
SubShader | |
{ | |
// No culling or depth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div dir="rtl"> ● گرافیک سه بعدی </div> | |
<div dir="rtl"> ○ نور ها </div> | |
<div dir="rtl"> ○ نرمال مپ </div> | |
<div dir="rtl"> ○ Bump Map </div> | |
<div dir="rtl"> ○ Ray marching </div> | |
<div dir="rtl"> ○ مپ های محیطی (کروی و مکعبی) </div> | |
<div dir="rtl"> ○ بازتاب و شکست نور </div> |