ngx-three
ngx-three copied to clipboard
How to enable antialias?
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?
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)
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
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.
automatic pixel ratio adjustment is implemented in v0.16.0.