Jump to content

Subpixel rendering?


RobiNERD
 Share

Recommended Posts

Hey so I wanted to know how to decide a resolution to render to and then downscale the render; specifically get the user's screen width, *3 and then scale it down to /3 to get a subpixel effect, using 3 times more available pixels (also if probably causing artifacts). I don't even know if this method works so i would really know how to do this/a working method. 

Link to comment
Share on other sites

There is engine.setHarwaresScalingLevel(0.333);
But. the anti-aliasing quality does not worth it (still looks bad).
The rendering cost is so high, If I switch this on with my UHD screen, it even hangs windows 10, no other program can do this :D 

If any post-processing is switched on, the default built-in MSAA in the browser switches off.
(It only works if rendering directly to the frame buffer)
This looks awful.

The best would be somehow implement TAA (Temporal Anti Aliasing)
 https://threejs.org/examples/webgl_postprocessing_taa.html
Three.js does it and looks really good with very little cost.
I tried, but failed, I really don't know (yet) how to render the camera jittering by subpixels.

 

Link to comment
Share on other sites

It is possible to implement TAA with BabylonJs. I did it already. You can see it here: https://box.pcon-solutions.com/
For the jittering you have to generate your own camera projection matrix.
I can't give you the source code of my implementation because this is a commercial project.

Rendering a higher resolution and downsample it is very easy.
Here is a playground: http://www.babylonjs-playground.com/#1DEDHH#0
In line 30 i create a postprocess which renders 4 times bigger.
The other 2 postprocesses are used to downsample it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...