Closed michalbe closed 7 years ago
Right now material constructor looks more/less like this:
const textured_phong_material = new PhongMaterial({ requires: [ Render, Transform ], texture: '../textures/4.png', normal_map: '../textures/uv4.png' });
Texture is fetched & built in core/material::build_texture.
core/material::build_texture
This way we cannot set dynamic texture rendered for instance on canvas. image_loader should be used instead, for example like that:
image_loader
const textured_phong_material = new PhongMaterial({ requires: [ Render, Transform ], texture: image_loader('../textures/4.png'), normal_map: image_loader('../textures/uv4.png') });
and materials should operate on promises/images, not `urls.
promises
images
Right now material constructor looks more/less like this:
Texture is fetched & built in
core/material::build_texture
.This way we cannot set dynamic texture rendered for instance on canvas.
image_loader
should be used instead, for example like that:and materials should operate on
promises
/images
, not `urls.