mirror of
https://github.com/storytold/spark.git
synced 2026-10-12 23:49:01 +00:00
Make metal default for rubber duck
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Forge • Environment Mapping</title>
|
||||
<style>
|
||||
body {
|
||||
@@ -28,7 +27,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<label><input type="checkbox" onchange="toggleMetal(this)" autocomplete="off"> Metal</label>
|
||||
<label><input type="checkbox" onchange="toggleMetal(this)" autocomplete="off"> Plastic</label>
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
@@ -107,8 +106,8 @@
|
||||
// Set some reflectivity in the materials of the duck
|
||||
obj.material.envMap = envMap;
|
||||
obj.material.original_color = obj.material.color.clone();
|
||||
obj.material.metalness = 0.0;
|
||||
obj.material.roughness = 0.2;
|
||||
obj.material.metalness = 1.0;
|
||||
obj.material.roughness = 0.02;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -118,8 +117,8 @@
|
||||
window.toggleMetal = function toggleMetal(el) {
|
||||
const metal = el.checked;
|
||||
for (let obj of duck.children) {
|
||||
obj.material.metalness = metal ? 1.0 : 0.0;
|
||||
obj.material.roughness = metal ? 0.02 : 0.2;
|
||||
obj.material.metalness = metal ? 0.0 : 1.0;
|
||||
obj.material.roughness = metal ? 0.2 : 0.02;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user