render params

This commit is contained in:
Evert Prants 2023-08-14 21:51:14 +03:00
parent 53e27ce186
commit b340f675bf
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@freeblox/engine",
"version": "0.0.3",
"version": "0.0.4",
"description": "Freeblox Engine",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@ -10,7 +10,9 @@
"dev": "tsc --watch",
"prepare": "npm run build"
},
"files": ["dist"],
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/index.js",

View File

@ -3,10 +3,11 @@ import {
Scene,
Vector2,
WebGLRenderer as ThreeWebGLRenderer,
WebGLRendererParameters,
} from 'three';
export class WebGLRenderer {
public renderer = new ThreeWebGLRenderer();
public renderer = new ThreeWebGLRenderer(this.params);
public camera = new PerspectiveCamera(
75,
this.resolution.x / this.resolution.y,
@ -17,7 +18,8 @@ export class WebGLRenderer {
constructor(
public viewport: HTMLElement,
public resolution = new Vector2(1080, 720)
public resolution = new Vector2(1080, 720),
private params?: WebGLRendererParameters
) {
this.renderer.setSize(resolution.x, resolution.y);
viewport.appendChild(this.renderer.domElement);