Skip to content

Instantly share code, notes, and snippets.

# Adding Mesh Function
#################################################
import bpy
def add_mesh(name, verts, faces, edges=None, col_name="Collection"):
if edges is None:
edges = []
mesh = bpy.data.meshes.new(name)
obj = bpy.data.objects.new(mesh.name, mesh)
col = bpy.data.collections.get(col_name)
@partybusiness
partybusiness / Stereo180Panorama_SideBySide.shader
Last active May 26, 2020 04:00
Stereoscopic shaders in Unity
Shader "Stereoscopic/Stereo180Panorama_SideBySide"
{
Properties{
[NoScaleOffset] _MainTex("Texture", 2D) = "white" {}
}
SubShader{
Pass{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
Shader "Unlit/BorderedDepthCube"
{
Properties
{
_Color("Colour", Color) = (1,1,1,1)
_BorderWidth("Border Width", float) = 0.03
_BorderStrength("Border Strength", float) = 0.3
}
SubShader
{
@partybusiness
partybusiness / WorldSpaceTextures.shader
Last active April 7, 2020 13:56
Shader that uses world-space coordinates to sample textures
Shader "Unlit/WorldSpaceTextures"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Shader that changes width of every second pixel by shifting UVs.