Hull shader constant function, in triangle domain:
HSConstData HS_FlatConstant(InputPatch<InterpData, 3> I)
{
float3 f;
// factors computed per vertex
f.x = I[0].fact;
f.y = I[1].fact;
f.z = I[2].fact;
// in our case, | |
const float kRGBMMaxRange = 8.0f; | |
const float kOneOverRGBMMaxRange = 1.0f / kRGBMMaxRange; | |
// encode to RGBM, c = ARGB colors in 0..1 floats | |
float r = c[1] * kOneOverRGBMMaxRange; | |
float g = c[2] * kOneOverRGBMMaxRange; | |
float b = c[3] * kOneOverRGBMMaxRange; |
#define DEBUG_CONSOLE | |
#define DEBUG_LEVEL_LOG | |
#define DEBUG_LEVEL_WARN | |
#define DEBUG_LEVEL_ERROR | |
#if (UNITY_EDITOR || DEVELOPMENT_BUILD) | |
#define DEBUG | |
#endif | |
#if (UNITY_IOS || UNITY_ANDROID) |
// THIS IS ONLY A PORTION OF THE FILE | |
// WILL NOT COMPILE OUT OF THE BOX! | |
void OrthogonalizeTangent (TangentInfo& tangentInfo, Vector3f normalf, Vector4f& outputTangent) | |
{ | |
TangentInfo::Vector3d normal = { normalf.x, normalf.y, normalf.z }; | |
TangentInfo::Vector3d tangent = tangentInfo.tangent; | |
TangentInfo::Vector3d binormal = tangentInfo.binormal; |
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class EditorWindowExample : EditorWindow | |
{ | |
List<Node> nodes = new List<Node> (); |
Hull shader constant function, in triangle domain:
HSConstData HS_FlatConstant(InputPatch<InterpData, 3> I)
{
float3 f;
// factors computed per vertex
f.x = I[0].fact;
f.y = I[1].fact;
f.z = I[2].fact;
using UnityEngine; | |
using System.Collections; | |
public class NaturalOrientation : MonoBehaviour { | |
public static int ORIENTATION_UNDEFINED = 0x00000000; | |
public static int ORIENTATION_PORTRAIT = 0x00000001; | |
public static int ORIENTATION_LANDSCAPE = 0x00000002; | |
public static int ROTATION_0 = 0x00000000; |
using UnityEngine; | |
using System.Collections; | |
/* | |
Runtime use: | |
To be available, AirPlay needs to be switched on for the device either via a native AirPlay UI component or | |
via the global AirPlay mirroring setting. Your options are: | |
A: Modify your Xcode project to layer a native AirPlay Cocoa control somewhere over your Unity content. |
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
public class DragAndDropTest : EditorWindow | |
{ | |
// Add menu item to the Window menu |
// Wizard to convert a cubemap to an equirectangular cubemap. | |
// Put this into an /Editor folder | |
// Run it from Tools > Cubemap to Equirectangular Map | |
using UnityEditor; | |
using UnityEngine; | |
using System.IO; | |
class CubemapToEquirectangularWizard : ScriptableWizard { |
using System; | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
//Unity 4.1.5 | |
public class UnityTextures : EditorWindow | |
{ |