Add proper material preview
This commit is contained in:
parent
b0fbb6764e
commit
c110ee96a3
5 changed files with 2058 additions and 11 deletions
|
@ -124,6 +124,8 @@ add_data(Graph
|
||||||
data/test.world
|
data/test.world
|
||||||
data/test.material
|
data/test.material
|
||||||
data/empty.world
|
data/empty.world
|
||||||
data/player.obj)
|
data/player.obj
|
||||||
|
data/sphere.obj
|
||||||
|
data/matpreview.world)
|
||||||
|
|
||||||
add_subdirectory(tools)
|
add_subdirectory(tools)
|
||||||
|
|
49
data/matpreview.world
Normal file
49
data/matpreview.world
Normal 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
10
data/sphere.mtl
Normal 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
1994
data/sphere.obj
Normal file
File diff suppressed because it is too large
Load diff
|
@ -25,16 +25,8 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
assetManager.setRenderer(context.renderer);
|
assetManager.setRenderer(context.renderer);
|
||||||
|
|
||||||
worldManager.loadWorld("test.world");
|
worldManager.loadWorld("matpreview.world");
|
||||||
worldManager.switchWorld("test.world");
|
worldManager.switchWorld("matpreview.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;
|
|
||||||
|
|
||||||
MainWindow window(context);
|
MainWindow window(context);
|
||||||
window.show();
|
window.show();
|
||||||
|
|
Reference in a new issue