Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
[HideInInspector] _MainTex2("Hide Texture", 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
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME! | |
// However, if you want to author shaders in shading language you can use this teamplate as a base. | |
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader. | |
// This shader works with URP 7.1.x and above | |
Shader "Universal Render Pipeline/Custom/Physically Based Example" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0 |
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
/* | |
Branchless shader logic made sane with macros; | |
usage; | |
if (depth>pointdepth){ | |
col=tex2D(_CameraColorTextureP,o.uv); | |
}else{ | |
col=tex2D(_MainTex,o.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
using System.Collections.Generic; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEditor.IMGUI.Controls; | |
using UnityEditorInternal; | |
using UnityEngine.SceneManagement; | |
public static class EditorCollapseAll | |
{ | |
private const BindingFlags INSTANCE_FLAGS = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; |
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
/* This is taken from this blog post: | |
* http://loyc-etc.blogspot.ca/2014/05/2d-convex-hull-in-c-45-lines-of-code.html | |
* | |
* All I have done is renamed "DList" to "CircularList" and then wrote a wrapper for the generic C# list. | |
* The structure that is supposed to be used is *much* more efficient, but this works for my purposes. | |
* | |
* This can be dropped right into your Unity project and will work without any adjustments. | |
*/ | |
using System.Collections.Generic; | |
using UnityEngine; |
BEGINNER'S GUIDE - ALL CONTROLS + TIPS (Escape from Tarkov)
- Hold Shift when zoomed in with Mouse Right Click to hold breath and steady aim
- Press B to switch between firing modes 🔥 (You will always start a raid in single fire mode)
- The animation when switching to 🔥 🔥 🔥 fire is an ⬆️ flick
- The animation when switching to 🔥 fire is an ⬇️ flick
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 “Custom/CurvedWorld” { | |
Properties { | |
// Diffuse texture | |
_MainTex (“Base (RGB)”, 2D) = “white” {} | |
// Degree of curvature | |
_Curvature (“Curvature”, Float) = 0.001 | |
// Axis Around which the curvature is required | |
_Axis (“Axis”, int ) = 2 | |
} |
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; | |
using UnityEngine.UI; | |
using TMPro; | |
using TMPro.EditorUtilities; | |
public class UGuiTextToTextMeshPro : Editor | |
{ | |
[MenuItem("GameObject/UI/Convert To Text Mesh Pro", false, 4000)] | |
static void DoIt() |
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
#!/usr/bin/env python3 | |
import http.client | |
import json | |
connection = http.client.HTTPConnection('localhost', port=5000) | |
headers = {'Content-type': 'application/json'} | |
connection.request('GET', '/set/foo?value=474', headers=headers) | |
response = connection.getresponse().read() |
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
"The common wisdom of "don't use conditionals in shaders" is one of my biggest frustrations with how shaders are taught. | |
step(y, x) _is_ a conditional! It compiles to identical code as: | |
float val = (x >= y ? 1.0 : 0.0) | |
or | |
float val = 0.0; | |
if (x >= y) val = 1.0;" | |
https://twitter.com/bgolus/status/1235254923819802626 | |
// Performing shader divisions without diving *rcp = approximation of 1/x | |
float myDividedVal = myValToDivide * rcp(myDivider); |