hyper-postprocessing icon indicating copy to clipboard operation
hyper-postprocessing copied to clipboard

Blury Text after an EffectPass

Open changbowen opened this issue 4 years ago • 9 comments

Hi, When at least one EffectPass is applied, the text on screen seems to have "inconsistent sharpness"... Here is a comparison. I used the quick-start.js as entry file. The first image is how it looks when 0 passes are returned. The second one is with only one new pp.EffectPass(null, new pp.BrightnessContrastEffect()) returned. A small font size is used so the artifact is more visible. (Also disable scaling of this webpage for a clearer idea.) image

Feels like the rendered content is getting stretched somehow and it is not 1:1.

changbowen avatar Oct 15 '19 08:10 changbowen

Doesn't happen on my mac; might be windows only. Do you see this problem using other passes from postprocessing? Just to make sure it isn't an issue with Effects, what happens if you export this from the entry file? For me this shows the same as no plugin at all.

module.exports = `
	void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor) {
		outputColor = inputColor;
	}
`;

slammayjammay avatar Oct 16 '19 17:10 slammayjammay

Plugin disabled (crystal clear): image Exporting only void mainImage as you suggested (similar blurry text): image

I also tested on linux and the results looked the same. This is on a manjaro with plugin disabled: manjaro good And with plugin enabled: manjaro bad

You might not see the small artifacts with the retina display on your mac fixing it for you :) I guess it could be hard for an image processing plugin to produce clear text.. but this is a console and is meant for display text 😜

changbowen avatar Oct 17 '19 04:10 changbowen

Looks fine on a non-retina screen for me too (on macOS). I'll do some testing on windows, something I obviously haven't done in a while :)

slammayjammay avatar Oct 21 '19 18:10 slammayjammay

(Haven't forgotten about this) for what it's worth I have the same problem on windows 8.1. No idea why it's happening; postprocessing handles most rendering-related stuff.

slammayjammay avatar Nov 08 '19 20:11 slammayjammay

Strangely enough it happens on linux too... And if you notice the text when resizing the window, the blurriness changes "focus". That's why I felt it was like a result of the output getting stretched.

changbowen avatar Nov 10 '19 14:11 changbowen

I can confirm this.

If you resize the window vertically with hyper-postprocessing running, the text will be stretched/squished vertically, instead of just the window frame being resized. (Sometimes it'll snap to an integer scaling and everything will look proper).

This happens even with no effects active, if retro/index.js is modified to just

const { readFileSync } = require('fs');
const { resolve } = require('path');
const THREE = require('three');
const POSTPROCESSING = require('postprocessing');

module.exports = ({ hyperTerm, xTerm }) => {

const saveTarget = new THREE.WebGLRenderTarget(window.innerWidth, window.innerHeight, { format: THREE.RGBAFormat, stencilBuffer: false })
const savePass = new POSTPROCESSING.SavePass(saveTarget)
return { 
	passes: [
		savePass,
	],

};
};

The distortion still happens, see a demonstration at https://imgur.com/a/tDXmnzI

Things get worse if I add

css: '.hyper-postprocessing { height: 100% !important; }',

to .hyper.js to get rid of the annoying black padding that happens below the canvas even with padding set to 0.

devlinb avatar Nov 16 '19 23:11 devlinb

d2c5e5a4fca7aeaa941475b22deec64be45b0589

Duh, the canvas size was just being set wrong, that took way too long to figure out....Try downloading version 2.3.1. @devlinb that resizing issue in the gif seems to have gone away as well.

Things get worse if I add css: '.hyper-postprocessing { height: 100% !important; }',

Best to use the underlying xterm API to set the terminal size. Theoretically once the xterm terminal is resized, the hyper-postprocessing canvas will match its dimensions and placement.

get rid of the annoying black padding that happens below the canvas

I was able to remove a bit of that black bar at the bottom by resizing the window height. I think xterm aligns the terminal height to a grid so that there's an integer number of rows.

slammayjammay avatar Nov 19 '19 06:11 slammayjammay

I did some tests. There are definitely improvements. However under 125% DPI scaling I can still see some blurriness with small fonts (10 pt) while resizing the window horizontally. image

changbowen avatar Nov 20 '19 06:11 changbowen

Maybe this is an aliasing issue? Have you tried passing multisampling: 8 to the postprocessing options?

image

https://vanruesc.github.io/postprocessing/public/docs/class/src/core/EffectComposer.js~EffectComposer.html

marcofugaro avatar Jun 19 '20 14:06 marcofugaro