added Materials and pipelines to scene JSON

Co-Authored-By: Robear Selwans <mo7sen@users.noreply.github.com>
This commit is contained in:
J3oss
2021-06-14 02:36:17 +02:00
parent 000e9ecb59
commit a68d31f319
4 changed files with 117 additions and 4 deletions

View File

@@ -6,7 +6,7 @@
"components": [
{
"type": "TransformComponent",
"position": [0.0, 0.0, 5.0],
"position": [0.0, -2.0, -11.0],
"rotation": [0.0, 0.0, 0.0],
"scale": [1.0, 1.0, 1.0]
},
@@ -243,5 +243,43 @@
]
}
],
"materials": [
{
"id": "GreenMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [0.0, 1.0, 0.0, 1.0]
},
{
"id": "RedMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [1.0, 0.0, 0.0, 1.0]
},
{
"id": "BlueMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [0.0, 0.0, 1.0, 1.0]
},
{
"id": "WhiteMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [1.0, 1.0, 0.0, 1.0]
},
],
"pipelines": [
{
"id": "DefaultPipeline",
"shaderStages": [
{
"type": "Vertex",
"shaderPath": "shaders://default.vert"
},
{
"type": "Fragment",
"shaderPath": "shaders://default.frag"
}
]
}
],
"activeCamera": "Camera.RotationHelper"
}

View File

@@ -128,5 +128,43 @@
]
}
],
"materials": [
{
"id": "GreenMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [0.0, 1.0, 0.0, 1.0]
},
{
"id": "RedMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [1.0, 0.0, 0.0, 1.0]
},
{
"id": "BlueMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [0.0, 0.0, 1.0, 1.0]
},
{
"id": "WhiteMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [1.0, 1.0, 0.0, 1.0]
},
],
"pipelines": [
{
"id": "DefaultPipeline",
"shaderStages": [
{
"type": "Vertex",
"shaderPath": "shaders://default.vert"
},
{
"type": "Fragment",
"shaderPath": "shaders://default.frag"
}
]
}
],
"activeCamera": "Camera"
}

View File

@@ -1459,5 +1459,43 @@
]
}
],
"materials": [
{
"id": "GreenMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [0.0, 1.0, 0.0, 1.0]
},
{
"id": "RedMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [1.0, 0.0, 0.0, 1.0]
},
{
"id": "BlueMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [0.0, 0.0, 1.0, 1.0]
},
{
"id": "WhiteMaterial",
"pipeline": "DefaultPipeline",
"baseColor": [1.0, 1.0, 0.0, 1.0]
},
],
"pipelines": [
{
"id": "DefaultPipeline",
"shaderStages": [
{
"type": "Vertex",
"shaderPath": "shaders://default.vert"
},
{
"type": "Fragment",
"shaderPath": "shaders://default.frag"
}
]
}
],
"activeCamera": "CameraTransformOverride.Camera.RotationHelper",
}

View File

@@ -181,6 +181,7 @@ load_project()
evstring_free(path_id);
}
Renderer->setWindow((GenericHandle)State.window);
// Loading Scenes
double scene_count = evjs_get(project_desc.json_data, "scenes.len")->as_num;
@@ -205,17 +206,15 @@ load_project()
}
evstring_free(project_dir);
Renderer->setWindow((GenericHandle)State.window);
}
void
unload_project()
{
evol_unloadmodule(State.renderer_mod);
evol_unloadmodule(State.game_mod);
evol_unloadmodule(State.input_mod);
evol_unloadmodule(State.window_mod);
evol_unloadmodule(State.renderer_mod);
}
int main(int argc, char **argv)