2021-08-17 19:11:44 -06:00
// & declares a key pointing to object instantiated by that declaration (in this case, we're using integers in hex)
// keys are NOT indices - ultimately they should be ingested as keys to a dictionary containing each object in the Neutrino file
// * gets a reference to a key's object (Neutrino will try to preserve this reference in the target software whenever possible)
2021-08-17 19:33:24 -06:00
// # gets a copy from a cached object's key (Neutrino will simply replace this reference with a copy of its value - this is simply to consolidate repetitive data in-exchange)
2021-08-17 19:11:44 -06:00
2021-08-17 19:33:24 -06:00
// overall structure:
/*
meta = {},
graph = {
scene = {},
assets = {}
2021-08-17 19:11:44 -06:00
},
2021-08-17 19:33:24 -06:00
cache = {}
*/
2021-08-17 19:11:44 -06:00
2021-08-17 19:33:24 -06:00
meta = {
//
},
graph = {
// note - "scene" and "assets" are essentially namespaces
// the scene itself
scene = {
&0: object = {
name: string = "SM_LargeWindow_A",
mesh: mesh = *2,
transform: trans = {
position: vec3 = #8,
rotation: vec3 = #8,
scale: vec3 = #9,
}
},
&1: object = {
name: string = "SM_LargeWindow_A2",
mesh: mesh = *2,
transform: trans = *3
2021-08-17 19:11:44 -06:00
}
},
2021-08-17 19:33:24 -06:00
// assets used by the scene
assets {
&2: mesh {
source: path = "/Assets/Props/LargeWindowA.obj",
materials: [mat] = [*4]
},
&3: trans {
position: vec3 = #8,
rotation: vec3 = #8,
scale: vec3 = #9
},
&4: mat {
name: string = "Simple Glass",
parent: shader = *7,
// "shader.props" is a subtype of the "shader" type, which is just a namespace that keeps it from being mixed up with other "props" subtypes (like "mesh.props", etc.)
parameters: shader.props = {
albedo: tex = *6,
roughness: float = 0.15,
normal: vec4 = #a
}
},
&5: mat {
name: string = "Blockout Grey",
parent: shader = *7,
parameters: shader.props = {
albedo: vec4 = (0.5, 0.5, 0.5, 1.0),
roughness: float = 0.85,
normal: vec4 = #a
}
},
&6: tex {
source: path = "/Assets/Textures/T_WindowGrime.png"
},
&7: shader {
source: path = "/Assets/Shaders/PBRBasic.wgsl"
2021-08-17 19:11:44 -06:00
}
},
2021-08-17 19:33:24 -06:00
},
// anonymous objects shared by multiple other objects
cache {
2021-08-17 19:11:44 -06:00
// this vector is common as a position or rotation value
&8: vec3 = (0.0, 0.0, 0.0),
// this vector is common as a scale value
&9: vec3 = (1.0, 1.0, 1.0),
// this vector is common as a normal value
&a: vec4 = (0.5, 0.5, 1.0, 1.0)
}