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
float2 WorldToScreenPos(float3 pos){ | |
pos = normalize(pos - _WorldSpaceCameraPos)*(_ProjectionParams.y + (_ProjectionParams.z - _ProjectionParams.y))+_WorldSpaceCameraPos; | |
float2 uv =0; | |
float3 toCam = mul(unity_WorldToCamera, pos); | |
float camPosZ = toCam.z; | |
float height = 2 * camPosZ / unity_CameraProjection._m11; | |
float width = _ScreenParams.x / _ScreenParams.y * height; | |
uv.x = (toCam.x + width / 2)/width; | |
uv.y = (toCam.y + height / 2)/width; | |
return uv; |
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
// Quick try at doing a "print value" node for Unity ShaderGraph. | |
// Tested on Unity 2019.2.17 with ShaderGraph 6.9.2. | |
// | |
// Use with CustomFunction node, with two inputs: | |
// - Vector1 Value, the value to display, | |
// - Vector2 UV, the UVs of area to display at. | |
// And one output: | |
// - Vector4 Color, the color. | |
// Function name is DoDebug. |
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 UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Rendering.LWRP; | |
// Inheriting from `ScriptableRendererFeature` will add it to the | |
// `Renderer Features` list of the custom LWRP renderer data asset. | |
public class RenderMyCustomPass : ScriptableRendererFeature | |
{ | |
private class MyCustomPass : ScriptableRenderPass | |
{ |
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
#!/bin/bash | |
project_name= com.jenkyncorp.bestapp | |
reinstall= | |
# Takes the most recent .apk and .obb (If you have multiple files) | |
OBB=$(ls -t *.obb | head -n1) | |
APK=$(ls -t *.apk | head -n1) | |
while [ "$1" != "" ]; do |
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 "Unlit/InfiniteSky" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
SubShader | |
{ | |
// make this render super early inside transparencies | |
Tags { "RenderType"="Transparent-400" } |
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 UnityEngine; | |
using UnityEditor; | |
public class SaveRenderTextureToFile { | |
[MenuItem("Assets/Save RenderTexture to file")] | |
public static void SaveRTToFile() | |
{ | |
RenderTexture rt = Selection.activeObject as RenderTexture; | |
RenderTexture.active = rt; |