[SOLVED] How to viewport of camera (splitscreen)

I try to set the viewport parameter


var OrigCam = pc.createScript('origCam');

// initialize code called once per entity
OrigCam.prototype.initialize = function() {
    var cameraComponent = entity.camera;
    cameraComponent.viewport = new pc.CameraComponent().viewMatrix.set ...(?)

{with help from https://developer.playcanvas.com/en/api/pc.CameraComponent.html}

You need this:


So, this would give you the default, fullscreen viewport:

    this.entity.camera.rect = new pc.Vec4(0, 0, 1, 1);

This would restrict rendering to the lower left of the screen:

    this.entity.camera.rect = new pc.Vec4(0, 0, 0.5, 0.5);

thanks Will, … it works