Comments (16)
I've had luck with cl-fond, though it uses a c library (also written by hafner, and available through quicklisp) to do the layout.
Specifically, I've used cl-fond:compute-text
, which returns a vertex array buffer, and an element count which can be used with %gl:draw-elements
from the cl-opengl
system.
from kons-9.
Thought I'd try a quick hack. https://imgur.com/a/k0VCYFH
TIL old GL is slow as molasses drawing pixels. Totally useless.
Think I'll work on my font atlas.
from kons-9.
What did you use for the text rendering?
I would be keen to get an example of a clickable button up in our UI soon.
Not sure if we should try cl-fond, or something more substantial such as Imgui which @awolven mentions in this discussion: #29
Or should we wait for glop first? Not sure how all the pieces fit together.
from kons-9.
I just used my font stuff to get cl-vector paths for the string, and then used a small render abstraction over cl-vectors to plot it a pixel at a time using gl:draw-pixels. I didn't think it would slow everything down to 1 fps or less though, since it's able to do this over CLX which is way more pixels than in that text. https://www.youtube.com/shorts/-FlYBFlgc9Y . I might have been doing something wrong though, because sbcl would complain after a while of too many open files if I tried to add more text to the loop. Not sure if that's a cl-opengl thing or a cl-glfw thing, either way, not a good a thing.
btw, it works on windows as long as the ~'s before newlines are removed in strings and the glfw3.dll is placed in the windows path or same directory as sbcl.exe Though removing lines in the viewport actually removed some lines in windows file manager.
As for glop there was a problem with smooth scrolling (there was none) so 3b implemented xinput2, but I'm not sure if it's completed or maybe the maintainer didn't want different behaviours on different platforms. It has a note saying mac is experimental but no idea what that means as I have no mac. But if you want to try it's minimal code change, I can do that tomorrow with a special to control it if you want.
from kons-9.
from kons-9.
You just get an outline. Which is really useful in 3d, not so useful for reading :) I can't remember what discussion it was in, but i did exactly that, https://imgur.com/gallery/YvPt3RK . Well, actually I cheated and didn't do beziers, transformed the path into only lines first and convert that to polygon.
To get a flat shape you'd need faces and a boolean operator to cut out inner shapes.
from kons-9.
This is probably a better view, https://imgur.com/a/pTzC9aV .
And it's actually quite readable when not showing the points. Curves decimated to 100 lines.
from kons-9.
from kons-9.
actually, it sort of does. But what are you going to do, group it with the camera so it's always facing the user? Because they're just polygons added to the scene.
from kons-9.
For a prototype GUI, I'm wondering if we can create an ortho OpenGL view on top of the perspective one and do widgets and text rendering there.
from kons-9.
That's my thinking. I'm experimenting with writing a gl backend for my 2d draw system to test how fast/slow it is. Could probably also use it to draw text if we remove antialiasing.
Should be serviceable if you don't mind flat square buttons, oh wait, thank you material design!
from kons-9.
Kaveh wants me to share an idea with the team on the subject of text engines.
I've been experimenting with Bart Botta's (3b's) text engine 3b-bmfont, which is native lisp, and much more mature than the one we have come up with so far. It uses the same font library we are using, which was written by Zach Beane (zpb-pdf).
It has the ability to cache font atlases and font metadata for quick loading of kons-9, which is one of the requirements Kaveh wanted out of our text engine. It has the ability to do font discovery, which can pick a system font for you based on the qualities you suggest. There is code available for the layout of text based on font-metrics, which we were otherwise going to have to implement on our own.
It's currently under final development by Bart according to Shinmera, and I have managed to get it built and running in a vanilla sbcl. Currently it is running opengl 3.3, but could be modified to support vulkan and metal. It offloads the support to a certain extent to Bart, who with Shinmera is using it for Kandria.
I could make a new text engine branch with 3d-bmfont if folks are interested.
from kons-9.
If this is a more mature system and can run on MacOS, then it sounds like a good idea.
A text engine is a high priority, so we can work on a GUI.
from kons-9.
lol that's why I mentioned a while ago why didn't you just use Shinmera's Trial which uses the (m)sdf font generation from 3b! and then you don't have to reinvent the gui wheel and work with one of the best Lisper's out there who already uses the stuff in production.
from kons-9.
Last I heard, Trial did not support MacOS. Has that changed?
from kons-9.
Done by @awolven. Will revisit the issue once we move to Vulkan.
from kons-9.
Related Issues (20)
- Error on loading testsuite: "COMPILE-FILE-ERROR" HOT 28
- Very impressive work! HOT 3
- stable kons-9 commit HOT 27
- Error for GLSL 4.10 not supported HOT 9
- Detailed installation instructions for all platforms -- volunteers needed HOT 37
- Failed to build on ECL HOT 2
- add tests to make sure kons-9 can run in modes suitable for scientific and engineering computing HOT 10
- Undocumented build-time requirement on *READ-DEFAULT-FLOAT-FORMAT* HOT 12
- another scientific and engineering issue: z-up vs. y-up HOT 2
- Add test coverage to the test suite
- Make test suite run faster in GitHub Actions
- vulkan port merge HOT 47
- Steam Deck Compatibility HOT 1
- Graphics windows flashes and closes on Portacle/SBCL on Win11 x64 HOT 1
- Idea for optimization HOT 9
- (question): What is the full list of licences used in KONS-9? HOT 1
- Links to PAX documentation broken in README.md
- `(run)` does not dispatch a new thread HOT 4
- color - alpha transparency not working HOT 1
- UI Menus have no text or text is blank HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kons-9.