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

[Feature] Color support? #7

Closed
richrd opened this issue Oct 28, 2019 · 7 comments
Closed

[Feature] Color support? #7

richrd opened this issue Oct 28, 2019 · 7 comments
Labels

Comments

@richrd
Copy link

richrd commented Oct 28, 2019

The current demo is amazing and crazy enough in itself. Frankly looking at it, I have this certain disbelief that I'm looking at an actual terminal window with 3D graphics.
That said, is there any chance to push it even further with colors? Really just wondering, awesome work already!

@loganzartman
Copy link

You mentioned in #5 that terminals have limited support for truecolor. While it is more challenging to detect , many of them (including Windows console in Windows 10 when ENABLE_VIRTUAL_TERMINAL_PROCESSING is set) actually do support it . Alternatively, almost any terminal will support 256 color mode, and it is fairly easy to do a rough conversion from RGB.

Sorry, I can't remember which reference I used for the color palette.

@sinclairzx81
Copy link
Owner

Hi, thanks for the suggestion.

I may actually take another look at this when I next get a bit of free time. It should be possible to implement ANSI true color and just have it enabled behind a --color flag. I did run a couple of tests on this and note that performance does degrade quite a bit with the color (its a lot more buffer throughput written to the terminal), but still could be interesting for terminals that support it.

@sinclairzx81
Copy link
Owner

@richrd @loganzartman

I've put a rough implementation of true color in the feature/true-color branch. It needs testing and a few more optimizations. Initial tests on windows/cygwin (without TTY) and a Linux Mint terminal seem to work alright, but there is likely room to improve performance. Running true color on Windows CMD / Powershell are completely broken by default which is expected. The GIF below is running out of a VirtualBox linux instance, framerate is about on par with the GIF (with fontsize dropped to 2)

output

I don't own a OSX device so cannot test there. Open to any feedback if either of you own a Mac. Can run out of the feature/true-color branch with the following.

# clone the project
$ git checkout feature/true-color
$ npm install
$ npm run build
$ node index --color

@sinclairzx81
Copy link
Owner

Have pushed a release to npm zero-demo@0.8.5. The color support is fairly experimental, so your mileage may vary depending on the capabilities of your terminal. Can test it out with..

$ npx zero-demo@latest --color

Have fun!

@richrd
Copy link
Author

richrd commented Nov 4, 2019

Wow thanks! That's amazing! Works great on my Linux machine. I might be able to test on OSX at work.
You sir are a legend :)

@liamdon
Copy link

liamdon commented Nov 23, 2022

Greetings from 2022! I love this project.

I thought you might like to see how well true color runs these days. This is on a Mac M1 Max, in iTerm 3.0.

ZeroRenderer_5.mp4

@sinclairzx81
Copy link
Owner

@liamdon Hey thanks for sharing :D That looks like it runs pretty great!

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

No branches or pull requests

4 participants