From 56d8a752d84e984afab20de5980edf10fe6c06f5 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 10 Aug 2018 22:21:44 -0700 Subject: Improve model-viewer support for lights (#626) * Improve model-viewer support for lights The main visible change here is that the model-viewer example supports multiple light sources, with a basic UI for adding new light sources to the scene, and for manipulating the ones that are there. Along the way I also refactored the `IMaterial` decomposition to be a bit less naive, while still only including a completely naive Blinn-Phong implementation. I also went ahead and spruced up the `cube.obj` file so that it has multiple materials, although it is still a completely uninteresting asset. * Fixup: Windows SDK version --- examples/model-viewer/cube.mtl | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'examples/model-viewer/cube.mtl') diff --git a/examples/model-viewer/cube.mtl b/examples/model-viewer/cube.mtl index 6634af823..6c8eeb10b 100644 --- a/examples/model-viewer/cube.mtl +++ b/examples/model-viewer/cube.mtl @@ -1,8 +1,35 @@ -newmtl Material -Ns 96.078431 +newmtl Red +Ns 95 Ka 0.000000 0.000000 0.000000 -Kd 0.640000 0.640000 0.640000 -Ks 0.500000 0.500000 0.500000 +Kd 0.640000 0.30000 0.30000 +Ks 0.500000 0.200000 0.200000 +Ni 1.000000 +d 1.000000 +illum 2 + +newmtl Green +Ns 20 +Ka 0.000000 0.000000 0.000000 +Kd 0.20000 0.640000 0.20000 +Ks 0.100000 0.500000 0.100000 +Ni 1.000000 +d 1.000000 +illum 2 + +newmtl Blue +Ns 200 +Ka 0.000000 0.000000 0.000000 +Kd 0.10000 0.10000 0.20000 +Ks 0.200000 0.200000 0.700000 +Ni 1.000000 +d 1.000000 +illum 2 + +newmtl Ground +Ns 10 +Ka 0.000000 0.000000 0.000000 +Kd 0.25 0.25 0.25 +Ks 0.1 0.1 0.1 Ni 1.000000 d 1.000000 illum 2 -- cgit v1.2.3