Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glowing Text #6

Open
ghost opened this issue Mar 28, 2021 · 9 comments
Open

Glowing Text #6

ghost opened this issue Mar 28, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Mar 28, 2021

Would it be possible to mix this with the Experimental Retro Effects that come preinstalled with windows terminal?

@Hammster
Copy link
Owner

Hammster commented Mar 28, 2021

I was playing around with it, but I did not manage to get it working properly, it's definitely something I want to add though. This is how far I got in my initial try, by just copying and pasting the retro shader code.

WindowsTerminal_PsBm6RpzYj

@Hammster Hammster added the enhancement New feature or request label Mar 28, 2021
@ghost
Copy link
Author

ghost commented Mar 28, 2021

Sorry if i'm not formatting these correctly, I haven't used Github much, but where would I be able to find the code for the Retro Terminal code? I can't seem to find the file location.

@Hammster
Copy link
Owner

It's inside the Windows terminal repository, the Blur function is the one responsible for the glow effect 🙂

https://github.com/microsoft/terminal/blob/main/samples/PixelShaders/Retro.hlsl

I think the issue was that the scale was not properly applied. But I could be mistaken since this is basically the first time that I have written any shader that's more than just a color tint 😄

rbeesley added a commit to rbeesley/windows-terminal-shaders that referenced this issue Apr 2, 2021
@rbeesley
Copy link
Contributor

rbeesley commented Apr 2, 2021

I merged Retro.hlsl with crt.hlsl. I made a couple tweaks so that it didn't over-bloom the colors and fixed the ENABLE_NOISE / ENABLE_GAIN. At the same time I used the scanline routine from Retro.hlsl so that the moiré wasn't quite so strong and addresses the fix comment you have.

There's probably a lot of refinement before I'd commit this to release and you'd have to see how the license for Retro.hlsl fits, but it is at least a first step to resolving this.

image

@rbeesley
Copy link
Contributor

rbeesley commented Apr 9, 2021

@Hammster, check out the crt.hlsl I have in my crt.hlsl with retro.hlsl branch.

image

I've replaced the blur routine with my "bloom" routine. This gives a slightly brighter leading edge of the electron beam and personally I think it helps define foreground/background better for text. Blur is pretty computationally expensive and I couldn't come up with a better version which played well with Windows Terminal. I could implement it in SHADERed, but curve with blur "wouldn't compile," yet they each worked fine with any other combination of options. I actually like this result better.

I implemented a blur which doesn't cause compile problems, and it can be used with all options turned on including bloom. I still think it needs work and I still prefer the effect of bloom, but it's an available option.

This is a screen capture with everything turned on:
image

The only thing still hanging on from retro.hlsl is the scanlines. There isn't much to what is provided from retro.hlsl and I can't think of a better way to write how it works. If you want to take a stab at that, it should be the last thing.

@erjadi
Copy link

erjadi commented Apr 9, 2021

Hey guys, I did my own shader based on the original crt.hlsl and I added the glow and rgb misalignment. I didn't see @rbeesley 's edit yet, that might be a better implementation. The rgb misalignment I hadn't seen before, but I thought it gives the image another nice retro touch. By scaling the RGB images by slightly different ratios, we can get that ghosting effect where edges of pure white boxes become red on one side and blue on the other. Both effects together

In addition I added slight displacement on the scanline, and in my version turned down the warping a bit.

image

Let me know how this looks, I can do a PR.

@rbeesley
Copy link
Contributor

rbeesley commented Apr 9, 2021

@erjadi, looks like an alignment and convergence modifier? If you want to maybe replace the scanline routine on my pr and add this as another option it would probably be easier to merge. Can you control the focus of each electron beam on its own? Definitely a modifier for color CRTs.

@TheOld
Copy link

TheOld commented Jan 4, 2022

Hey @erjadi , I know this is somewhat old, so sorry for necroing this, but do you mind sharing your configuration (specifically the RGB shift one) if you still have it? Thanks!

@DanielBrittainJr
Copy link

just +1 here @erjadi to see if you could share the config you posted above, it looks awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants