简体   繁体   English

以较低的分辨率渲染场景(three.js)

[英]Render scene at lower resolution (three.js)

How can i decrease my rendered canvas resolution(just like i can do on blender camera resolution)? 如何降低渲染的画布分辨率(就像我在搅拌机相机分辨率上所做的一样)? I've seen another question saying that i need to use 我看到另一个问题说我需要使用

renderer.setDevicePixelRatio(window.devicePixelRatio)

The problem is that the object either gets black or nothing shows on canvas, so i don't really know if this is it solves my problem. 问题是对象要么变黑,要么在画布上什么都没有显示,所以我真的不知道这是否解决了我的问题。

I also tried to use 我也尝试使用

renderer.setSize()

and

renderer.setViewport()

together and separately, but it only changed the canvas size to a very small one(i need a high size preview of the canvas), and even though the viewport got on the size i wanted, it seems that the objects are rendered only on the smaller size, so i can't see all of it, so it doesn't do the trick. 一起并分开,但是它只将画布的尺寸更改为很小的尺寸(我需要对画布进行大尺寸预览),即使视口达到了我想要的尺寸,似乎对象也仅在较小的尺寸,所以我看不到所有内容,因此无法解决问题。

Also, if possible, is there a way to do that by manually changing the image buffer to a lower resolution one, and displaying it? 另外,如果可能,是否有办法通过手动将图像缓冲区更改为较低的分辨率并显示它来实现?

The thing i needed was the setPixelRatio function on therenderer. 我需要的是渲染器上的setPixelRatio函数。 no setDevicePixelRatio. 没有setDevicePixelRatio。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM