ngx-three icon indicating copy to clipboard operation
ngx-three copied to clipboard

How to enable antialias?

Open niccolofanton opened this issue 3 years ago • 4 comments

I can pass Partial<WebGLRenderer> to the ThCanvas but I can't figure out how to toggle the antialias flag. Is it possible in some way? Is there a way to get the renderer instance in a component?

niccolofanton avatar Jan 26 '22 10:01 niccolofanton

A bit of context about this question: the render was a bit blurry and I was looking for the possible problem. After some research, I've discovered that it was caused by the pixelRatio property passed inside rendererParameters (it's not applied to the renderer apparently)

niccolofanton avatar Jan 26 '22 11:01 niccolofanton

You are right. PixelRatio is missing. There is a setter on the Renderer and this one is not called.

I will add the possibility to set it by means of the configuration object.

In the meantime you can get the renderer by means of injecting the ThEngineService. It has a getter renderer and can be accessed in onInit or later

demike avatar Jan 26 '22 18:01 demike

I will implement automatic device pixelratio setting. This will be done before rendering a frame, if the device pixel ratio changed ( imagine moving the window from one screen to a different screen ).

This should solve your problem. The above mentioned problem of a multi monitor setup with different ratios can't be solved with a static pixel ratio.

demike avatar Feb 26 '22 15:02 demike

automatic pixel ratio adjustment is implemented in v0.16.0.

demike avatar Jun 23 '22 14:06 demike