Skip to content

Instantly share code, notes, and snippets.

@hiko9lock
hiko9lock / SFX_hqCustomCodeTest
Last active August 29, 2015 14:00
ShaderFX Custom Code sample for Maya 2015, maya LT
struct CustomCode1245Output
{
float3 color;
};
CustomCode1245Output CustomCode1245Func( float2 UV )
{
CustomCode1245Output OUT;
float3 output= float3(0.0, 0.0, 0.0);
float dist= 0.004;
@hiko9lock
hiko9lock / customSample
Created March 26, 2014 09:55
HLSL code for UDK Custom
float3 output;
for( int i= -1*radius; i< radius; i++ ) {
for( int j= -1*radius; j< radius; j++ ) {
output+= tex2D( SceneColorTexture,ScreenAlignedUV(uv+ float2(i*dist, j*dist)));
}
}
return (output / ((radius+1)*(radius+1)));
@hiko9lock
hiko9lock / hq_ikHandle.mel
Created November 26, 2013 15:27
Maya Mel script that instead of ikHandle command for MayaLT.
// file hq_ikHandle.mel
// Create ikHandle tool for MayaLT
// author Masahiko.Ishii <esuna.dev@gmail.com>
// date 2013/11/27
global proc hq_ikHandle()
{
string $sels[]= `ls -sl`;
string $ik= `createNode "ikHandle"`;
string $ef= `createNode "ikEffector"`;
@hiko9lock
hiko9lock / customTextureSample
Created August 28, 2013 02:37
HLSL code for UDK Custom texture.
float3 output= float3(0.0, 0.0, 0.0);
float steps= 10.0f;
for( int i=0; i< steps; i++)
{
output+= (1.0/steps)*tex2D(tex,uv+(float2((1.0/steps)*i, (1.0/steps)*i) ) );
}
return output;
@hiko9lock
hiko9lock / hq_convertCameraAttribute.mel
Created August 16, 2013 13:23
Maya MEL script that transfer camera attribute to locator for unity.
// file hq_convertCameraAttribute
// CameraDataConvert for unity.
// author Masahiko.Ishii <esuna.dev@gmail.com>
// date 2013/8/16
global proc hq_convertCameraAttribute()
{
string $sels[]= `ls -sl`;
string $node[]= `listRelatives -shapes $sels[0]`;
print $node;
@hiko9lock
hiko9lock / TouchCamera.cs
Last active April 1, 2023 08:43
[Unity 3D] Testing camera pan,zoom, orbit for iOS. Setting camera target after you have attached this camera script to camera object.
using UnityEngine;
using System.Collections;
public class TouchCamera : MonoBehaviour {
public Transform target;
Vector3 f0Dir= Vector3.zero;
float zoomDistance= 5;
float theta= 0.0F;
float fai= 0.0F;
float dx= 0.0F;
@hiko9lock
hiko9lock / AimCamera.cs
Created February 12, 2013 04:05
[Unity 3D] Testing camera pan,zoom, orbit for using mouse button. Setting camera rarget after you have attached this camera script to camera object. ・Hold left mouse button orbit ・Hold middle mouse button pan ・Hold ALT with right mouse button zoom
using UnityEngine;
using System.Collections;
public class AimCamera : MonoBehaviour {
public Transform target;
Vector3 f0Dir= Vector3.zero;
Vector3 upVal= Vector3.zero;
float zoomDistance= 5;
float theta= 0.0F;
float fai= 0.0F;