Ethans Graphics Kit
Collection of graphics effects for the game engine Unity3D(version 5.3.1 specifically).
|
ProceduralScene, generate mesh from ProceduralSceneFunction. More...
Inherits MonoBehaviour.
Public Member Functions | |
void | UpdateMesh () |
Begin updating mesh. More... | |
bool | IsGenerating () |
Vector3 | SampleDistanceDerivative (float x, float y, float z) |
Sample distance derivative from scene function. More... | |
void | ResizeView () |
Resize. More... | |
void | OnDrawGizmosSelected () |
Static Public Member Functions | |
static float | smax (float a, float b, float k) |
Exponential smooth max. More... | |
static float | smin (float a, float b, float k) |
Polynomial smooth min. More... | |
static float | drawVoronoiCell (float x, float y, float z) |
static float | voronoi (float x, float y, float z) |
Fast cellular voronoi. More... | |
static float | hash (float i) |
Pseudo-random hash from seed 'i'. More... | |
static void | rotate2D (ref float x, ref float y, float a) |
Rotate x,y by radians 'a' More... | |
static float | sdBox (float x, float y, float z, float w, float h, float l) |
Box signed distance function. More... | |
static float | sdTorus (float x, float y, float z, float r1, float r2) |
Torus signed distance function. More... | |
static float | sdSphere (float x, float y, float z, float r) |
Sphere signed distance function. More... | |
static float | sdCone (float x, float y, float z, float cx, float cy) |
Cone signed distance function, cx,cy must be normalized. More... | |
static float | sdHexPrism (float x, float y, float z, float r1, float r2) |
Hex prism signed distance function. More... | |
static float | sdTriPrism (float x, float y, float z, float r1, float r2) |
Triangular prism signed distance function. More... | |
static float | sdCappedCylinder (float x, float y, float z, float r1, float r2) |
Capped cylinder signed distance function. More... | |
static SceneFunctionSample | EmptyScene (float x, float y, float z) |
Empty scene function. More... | |
Public Attributes | |
const int | CHUNK_SIZE = 8 |
GameObject | meshDestination |
Target mesh destination. More... | |
Material[] | materials |
Material used. More... | |
float | voxelSize = 1.0f |
Voxel size, smaller is higher resolution. More... | |
float | nettingDistance = 1.0f |
Voxel netting distance. More... | |
float | normalEpsilon = 1.0f |
Epsilon when calculating normals, lower is sharper. More... | |
bool | generateColliders = false |
Generate MeshCollider's for generated meshes. More... | |
PhysicMaterial | colliderMaterial |
PhysicsMaterial for generated MeshCollider. More... | |
int | generationDelay = 0 |
Delay in MS when generating mesh. More... | |
bool | recalculateNormals = false |
Should it recalculate mesh normals? More... | |
float | recalculateNormalsSmoothingAngle = 60.0f |
Smoothing angle when recalculating mesh normals. More... | |
bool | tangents = true |
Calculate mesh tangents? More... | |
ProceduralSceneFunction | sceneFunction = EmptyScene |
ProceduralSceneFunction that defines your procedural scene. More... | |
ProceduralScene, generate mesh from ProceduralSceneFunction.
|
static |
|
static |
Empty scene function.
x | |
y | |
z |
|
static |
Pseudo-random hash from seed 'i'.
i |
bool EthansGraphicsKit.ProceduralMesh.ProceduralScene.IsGenerating | ( | ) |
void EthansGraphicsKit.ProceduralMesh.ProceduralScene.OnDrawGizmosSelected | ( | ) |
void EthansGraphicsKit.ProceduralMesh.ProceduralScene.ResizeView | ( | ) |
Resize.
|
static |
Rotate x,y by radians 'a'
x | |
y | |
a |
Vector3 EthansGraphicsKit.ProceduralMesh.ProceduralScene.SampleDistanceDerivative | ( | float | x, |
float | y, | ||
float | z | ||
) |
Sample distance derivative from scene function.
x | |
y | |
z |
|
static |
Box signed distance function.
x | |
y | |
z | |
w | |
h | |
l |
|
static |
Capped cylinder signed distance function.
x | |
y | |
z | |
r1 | |
r2 |
|
static |
Cone signed distance function, cx,cy must be normalized.
x | |
y | |
z | |
cx | |
cy |
|
static |
Hex prism signed distance function.
x | |
y | |
z | |
r1 | |
r2 |
|
static |
Sphere signed distance function.
x | |
y | |
z | |
r |
|
static |
Torus signed distance function.
x | |
y | |
z | |
r1 | |
r2 |
|
static |
Triangular prism signed distance function.
x | |
y | |
z | |
r1 | |
r2 |
|
static |
Exponential smooth max.
a | |
b | |
k |
|
static |
Polynomial smooth min.
a | |
b | |
k |
void EthansGraphicsKit.ProceduralMesh.ProceduralScene.UpdateMesh | ( | ) |
Begin updating mesh.
|
static |
Fast cellular voronoi.
x | |
y | |
z |
const int EthansGraphicsKit.ProceduralMesh.ProceduralScene.CHUNK_SIZE = 8 |
PhysicMaterial EthansGraphicsKit.ProceduralMesh.ProceduralScene.colliderMaterial |
PhysicsMaterial for generated MeshCollider.
bool EthansGraphicsKit.ProceduralMesh.ProceduralScene.generateColliders = false |
Generate MeshCollider's for generated meshes.
int EthansGraphicsKit.ProceduralMesh.ProceduralScene.generationDelay = 0 |
Delay in MS when generating mesh.
Material [] EthansGraphicsKit.ProceduralMesh.ProceduralScene.materials |
Material used.
GameObject EthansGraphicsKit.ProceduralMesh.ProceduralScene.meshDestination |
Target mesh destination.
float EthansGraphicsKit.ProceduralMesh.ProceduralScene.nettingDistance = 1.0f |
Voxel netting distance.
float EthansGraphicsKit.ProceduralMesh.ProceduralScene.normalEpsilon = 1.0f |
Epsilon when calculating normals, lower is sharper.
bool EthansGraphicsKit.ProceduralMesh.ProceduralScene.recalculateNormals = false |
Should it recalculate mesh normals?
float EthansGraphicsKit.ProceduralMesh.ProceduralScene.recalculateNormalsSmoothingAngle = 60.0f |
Smoothing angle when recalculating mesh normals.
ProceduralSceneFunction EthansGraphicsKit.ProceduralMesh.ProceduralScene.sceneFunction = EmptyScene |
ProceduralSceneFunction that defines your procedural scene.
bool EthansGraphicsKit.ProceduralMesh.ProceduralScene.tangents = true |
Calculate mesh tangents?
float EthansGraphicsKit.ProceduralMesh.ProceduralScene.voxelSize = 1.0f |
Voxel size, smaller is higher resolution.