Skip to content

Instantly share code, notes, and snippets.

@hzhou17
hzhou17 / Water_Shader.shader
Created November 23, 2022 23:29
A water shader that works with Unity standard rendering pipeline
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Unlit/Water_Shader"
{
Properties
{
//_MainTex ("Texture", 2D) = "white" {}
_SurfaceNoise("Surface Noise", 2D) = "white" {}
_SurfaceDistortion("Surface Noise Distortion", 2D) = "white" {}
_ReflectionTex("Reflection Tex", 2D) = "white" {}
group = pm.group(name='iteration1')
random_list = []
final = []
for i in range(3): #take this part out of the main range(25) loop. better performance
negaPosi = random.sample([1, -1], 1)
random_list.append(negaPosi) #returns of a list of lists. [[-1], [1], [1]]
function Building00(noise_index)
{
//----------------------------------------------------------------------------------------------------------------
this.x = noise(noise_index * .8) * width/5;
this.y = noise(noise_index * .8 + 100) * height;
//----------------------------------------------------------------------------------------------------------------
this.ratio = this.y / this.x;
@hzhou17
hzhou17 / myVSwindowsSetting.vssettings
Created March 7, 2020 09:03
Unity Visual Studio Mac Monokai for Windows
<UserSettings><ApplicationIdentity version="16.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"><ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package"><PropertyValue name="ShowMiscFilesProject">false</PropertyValue><PropertyValue name="AutoloadExternalChanges">true</PropertyValue><PropertyValue name="CheckForConsistentLineEndings">true</PropertyValue><PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue><PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue><PropertyValue name="ReuseSavedActiveDocWindow">false</PropertyValue><PropertyValue name="DetectFileChangesOutsideIDE">true</PropertyValue><PropertyValue name="DontShowGlobalUndoChangeLossDialog">true</PropertyValue><PropertyValue name="AllowEditingReadOnlyFiles">true</PropertyValue><PropertyValue name="DocumentDockPreference">0</PropertyValue><PropertyValue name="MiscFilesProjectSavesLastNItems">0</PropertyValue>
import pymel.core as pm
win_width = 200
def gui():
global box1, box2, slider
win = pm.window(w=win_width, title='Split Joint')
# By Heran Zhou, 2019.
'''
import reScale
reload (reScale)
reScale.gui()
'''
import pymel.core as pm
win_width = 150
import pymel.core as pm
import random
win_width = 150
length = 4
width = 4
def random_size():
import pymel.core as pm
#select an object to measure
object = pm.ls(sl=True)
#select all vertices on the object
for i in object:
'''
import renamer
reload (renamer)
renamer.gui()
'''
import pymel.core as pm
#import sys
win_width = 200
import pymel.core as pm
selected = pm.ls(sl=True)
driver = selected[0]
driven = selected[1]
new_name = selected[0].replace('bind', 'proxy')