RenderingModule

WHS.app.RenderingModule

const app = new WHS.App([
  new WHS.app.ElementModule(),
  new WHS.app.SceneModule(),
  new WHS.app.CameraModule({
    position: new THREE.Vector3(0, 6, 18),
    far: 10000
  }),
  new WHS.app.RenderingModule({
    bgColor: 0x162129,

    renderer: {
      antialias: true,
      shadowmap: {
        type: THREE.PCFSoftShadowMap
      }
    }
  }, {shadow: true})
]);

Parameters

NameDescriptionDefault value
widthRendertarget widthwindow.innerWidth
heightRendertarget heightwindow.innerHeight
resolutionRelative resolution:
1 - normal
2 - 2x times more pixels
...and go on
new Vector2(1, 1)
bgColorHEX color of background0x000000
bgOpacityBackground opacity [0 - 1]1
rendererAdditional WebGLRenderer parameters{}

❗️

Required dependencies

This module requires some dependencies:

  • element
  • scene
  • camera

.setSize(width, height)

Update rendertarget width and height.

Exported dependencies

NameDescription
rendererTHREE.WebGLRenderer instance