Files
filament/samples/web/suzanne.html
Philip Rideout cc61e4649b Add ETC support to mipgen / imageio / suzanne.
This shrinks file size as follows, although it seems to darken the
rendered result.

```
  1398209 Oct  2 16:22 ao.ktx
   699172 Oct  2 16:20 ao_etc.ktx
  1398209 Oct  2 16:22 metallic.ktx
   699172 Oct  2 16:19 metallic_etc.ktx
  1398209 Oct  2 16:22 roughness.ktx
   699172 Oct  2 16:20 roughness_etc.ktx
```
2018-10-02 21:57:22 -07:00

44 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Suzanne</title>
<link href="favicon.png" rel="icon" type="image/x-icon"/>
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">
<style>
body {
margin: 0;
overflow: hidden;
}
#filament-canvas {
touch-action: none;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<canvas id="filament-canvas"></canvas>
<script src="suzanne.js"></script>
<script src="filaweb.js"></script>
<script>
function load_etcfile(basename) {
return use_etc ? load_rawfile(basename + "_etc.ktx") : load_rawfile(basename + ".ktx");
}
load({
'albedo': (use_s3tc ? load_rawfile('monkey/albedo_s3tc.ktx') :
(use_astc ? load_rawfile('monkey/albedo_astc.ktx') :
load_rawfile('monkey/albedo.ktx'))),
'metallic': load_etcfile('monkey/metallic'),
'roughness': load_etcfile('monkey/roughness'),
'normal': load_rawfile('monkey/normal.ktx'),
'ao': load_etcfile('monkey/ao'),
'mesh': load_rawfile('monkey/mesh.filamesh'),
'syferfontein_18d_clear_2k': load_cubemap('syferfontein_18d_clear_2k', '.ktx')
});
</script>
</body>
</html>