Skip to content

Commit

Permalink
Merge branch 'documentation'
Browse files Browse the repository at this point in the history
  • Loading branch information
mholtkamp committed Dec 17, 2024
2 parents de6e577 + 99a77cf commit e0ad886
Show file tree
Hide file tree
Showing 77 changed files with 6,064 additions and 76 deletions.
18 changes: 18 additions & 0 deletions Documentation/Info/Assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Assets

## Hierarchy

* Font
* Material
* MaterialBase
* MaterialInstance
* MaterialLite
* ParticleSystem
* ParticleSystemInstance
* Scene
* SkeletalMesh
* SoundWave
* StaticMesh
* Texture


Empty file added Documentation/Info/Editor.md
Empty file.
36 changes: 36 additions & 0 deletions Documentation/Info/Nodes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Nodes

## Hierarchy

* Node
* Node3D
* Audio3D
* Camera3D
* Light3D
* DirectionalLight3D
* PointLight3D
* Primitive3D
* Box3D
* Capsule3D
* Mesh3D
* SkeletalMesh3D
* StaticMesh3D
* InstancedMesh3D
* ShadowMesh3D
* TextMesh3D
* Particle3D
* Sphere3D
* Widget
* ArrayWidget
* Poly
* PolyRect
* Quad
* Text







37 changes: 37 additions & 0 deletions Documentation/Lua/Assets/Asset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Asset

Base class for any assets that can be loaded into memory from file. Most assets are created by importing source files in the editor (like a Texture by importing a .png file).

Assets can only be unloaded from memory once nothing else references them. To unload all unreferenced assets, call AssetManager.RefSweep(). In the future, options for incremental asset cleanup will be implemented.

---
### GetName
Get this asset's name.

Sig: `name = Asset:GetName()`
- Ret: `string name` Asset name
---
### GetRefCount
Get the number of references that are pointing to this asset. These references include variables in both C++ and Lua code.

Sig: `count = Asset:GetRefCount()`
- Ret: `integer count` Reference count
---
### GetTypeName
Get the asset's type as a string. For instance "Texture".

Sig: `typeName = Asset:GetTypeName()`
- Ret: `string typeName` Asset type name
---
### IsTransient
Check if this asset is transient. A transient asset is not stored in the asset registry and cannot be saved to a file. Common transient assets may be LiteMaterial, MaterialInstance, and ParticleSystemInstance.

Sig: `transient = Asset:IsTransient()`
- Ret: `boolean transient` Is a transient asset
---
### IsLoaded
Check if the asset is loaded. This is useful for checking if an asset is loaded after initiating an asynchronous load with AssetManager.AsyncLoadAsset().

Sig: `loaded = Asset:IsLoaded()`
- Ret: `boolean loaded` Is asset loaded
---
29 changes: 29 additions & 0 deletions Documentation/Lua/Assets/Font.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Font

Fonts can be loaded from .ttf files. The engine only supports ASCII characters.

---
### GetSize
Get the font size.

Sig: `size = Font:GetSize()`
- Ret: `integer size` Font size
---
### GetTexture
Get the font texture.

Sig: `texture = Font:GetTexture()`
- Ret: `Texture texture` Font texture
---
### IsBold
Check if the font is bold.

Sig: `bold = Font:IsBold()`
- Ret: `boolean bold` Is font bold
---
### IsItalic
Check if the font is italic.

Sig: `italic = Font:IsItalic()`
- Ret: `boolean italic` Is font italic
---
109 changes: 109 additions & 0 deletions Documentation/Lua/Assets/Material.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Material

Material assets are created in the Editor and cannot be imported from a source file.

There are 2 different material systems in Octave.
- MaterialLite: Can be used on ALL platforms. The downside is that they only support a limited number of features.
- MaterialBase / MaterialInstance: These are only supported on Vulkan platforms. MaterialBase allows you to provide a custom Vertex / Fragment shader in a GLSL file. MaterialInstance allows you to make a new instance of the base material with different parameter values.

---
### IsBase
Check if this material is a MaterialBase.

Sig: `base = Material:IsBase()`
- Ret: `boolean base` Is base material
---
### IsInstance
Check if this material is a MaterialInstance.

Sig: `instance = Material:IsInstance()`
- Ret: `boolean instance` Is instance material
---
### IsLite
Check if this material is a MaterialLite.

Sig: `lite = Material:IsLite()`
- Ret: `boolean lite` Is lite material
---
### SetScalarParameter
Set a scalar parameter on the material. Only used by MaterialBase and MaterialInstance.

Sig: `Material:SetScalarParameter(name, value)`
- Arg: `string name` Parameter name
- Arg: `number value` Parameter value
---
### SetVectorParameter
Set a vector parameter on the material. Only used by MaterialBase and MaterialInstance.

Sig: `Material:SetVectorParameter(name, value)`
- Arg: `string name` Parameter name
- Arg: `Vector value` Parameter value
---
### SetTextureParameter
Set a texture parameter on the material. Only used by MaterialBase and MaterialInstance.

Sig: `Material:SetTextureParameter(name, value)`
- Arg: `string name` Parameter name
- Arg: `Texture value` Parameter value
---
### GetScalarParameter
Get a scalar parameter on the material. Only used by MaterialBase and MaterialInstance.

Sig: `value = Material:GetScalarParameter(name)`
- Arg: `string name` Parameter name
- Ret: `number value` Parameter value
---
### GetVectorParameter
Get a vector parameter on the material. Only used by MaterialBase and MaterialInstance.

Sig: `value = Material:GetVectorParameter(name)`
- Arg: `string name` Parameter name
- Ret: `Vector value` Parameter value
---
### GetTextureParameter
Get a texture parameter on the material. Only used by MaterialBase and MaterialInstance.

Sig: `value = Material:GetTextureParameter(name)`
- Arg: `string name` Parameter name
- Ret: `Texture value` Parameter value
---
### GetBlendMode
Get the material's blend mode.

See [BlendMode](../Misc/Enums.md#blendmode)

Sig: `blendMode = Material:GetBlendMode()`
- Ret: `BlendMode(integer) blendMode` Material blending mode
---
### GetMaskCutoff
Get the material's alpha mask cutoff. Shaded fragments will be discarded if their alpha value is below this threshold.

Sig: `cutoff = Material:GetMaskCutoff()`
- Ret: `number cutoff` Alpha discard threshold (0 to 1)
---
### GetSortPriority
Get the material's sort priority. This is used mainly by translucent rendering. Objects will be sorted by distance from the camera if their priorities are the same.

Sig: `priority = Material:GetSortPriority()`
- Ret: `integer priority` Sort priority
---
### IsDepthTestDisabled
Check if depth testing is disabled for this material. TODO: This should probably be changed to "IsDepthTestingEnabled()".

Sig: `disabled = Material:IsDepthTestDisabled()`
- Ret: `boolean disabled` True if depth testing is DISABLED
---
### ShouldApplyFog
Check if fog should be applied to the resulting shaded fragment.

Sig: `applyFog = Material:ShouldApplyFog()`
- Ret: `boolean applyFog` Should apply fog
---
### GetCullMode
Get the cull mode.

See [CullMode](../Misc/Enums.md#cullmode)

Sig: `cullMode = Material:GetCullMode()`
- Ret: `CullMode(integer) cullMode` Triangle cull mode
---
5 changes: 5 additions & 0 deletions Documentation/Lua/Assets/MaterialBase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MaterialBase

A material built from a custom vertex and fragment shader. MaterialBase is only supported on Vulkan platforms. Check out Engine/Shaders/GLSL/mat/DebugNormal.glsl for an example material shader.

---
24 changes: 24 additions & 0 deletions Documentation/Lua/Assets/MaterialInstance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# MaterialInstance

A material instance can override default parameters on a base material. MaterialInstances do not have unique shaders compiled for them, instead they reference the MaterialBase compiled shader. MaterialInstance is only supported on Vulkan platforms.

---
### MaterialInstance.Create(srcMat)
Create a new material instance from a given source material. The source material can be either a MaterialBase or another MaterialInstance.

Sig: `inst = MaterialInstance.Create(srcMat)`
- Arg: `Material srcMat` MaterialBase or MaterialInstance source material
- Ret: `MaterialInstance inst` Newly created MaterialInstance
---
### GetBaseMaterial
Get the base material used by this instance.

Sig: `base = MaterialInstance:GetBaseMaterial()`
- Ret: `MaterialBase base` Referenced base material
---
### SetBaseMaterial
Set the base material used by this instance.

Sig: `MaterialInstance:SetBaseMaterial(base)`
- Arg: `MaterialBase base` Base material to reference
---
Loading

0 comments on commit e0ad886

Please sign in to comment.