Archived
1
Fork 0

Add proper material preview

This commit is contained in:
Joshua Goins 2018-12-25 07:51:18 -05:00
parent b0fbb6764e
commit c110ee96a3
5 changed files with 2058 additions and 11 deletions

View file

@ -124,6 +124,8 @@ add_data(Graph
data/test.world
data/test.material
data/empty.world
data/player.obj)
data/player.obj
data/sphere.obj
data/matpreview.world)
add_subdirectory(tools)

49
data/matpreview.world Normal file
View file

@ -0,0 +1,49 @@
{
"entities": [
{
"name": "sun",
"components": [
{
"type": "Transform",
"position": "66,56,25"
},
{
"type": "Light",
"kind": 1,
"color": "1,1,1"
}
]
},
{
"name": "preview sphere",
"components": [
{
"type": "Transform",
"position": "0,0,0"
},
{
"type": "Mesh",
"path": "sphere.obj",
"material": "test.material"
}
]
},
{
"name": "preview camera",
"components": [
{
"type": "Transform",
"position": "0,0,2"
},
{
"type": "Camera",
"fov": 75
}
]
}
],
"environment": {
"color": "0,0,0"
}
}

10
data/sphere.mtl Normal file
View file

@ -0,0 +1,10 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2

1994
data/sphere.obj Normal file

File diff suppressed because it is too large Load diff

View file

@ -25,16 +25,8 @@ int main(int argc, char* argv[]) {
assetManager.setRenderer(context.renderer);
worldManager.loadWorld("test.world");
worldManager.switchWorld("test.world");
EntityID entity = ECS::createEntity(worldManager.getCurrentWorld());
auto cameraTransform = ECS::addComponent<TransformComponent>(entity);
cameraTransform->position = glm::vec3(5, 5, 5);
auto cameraComponent = ECS::addComponent<CameraComponent>(entity);
cameraComponent->fov = 70.0f;
worldManager.loadWorld("matpreview.world");
worldManager.switchWorld("matpreview.world");
MainWindow window(context);
window.show();