Git Product home page Git Product logo

Comments (16)

loskool avatar loskool commented on June 4, 2024

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.

JMC-design avatar JMC-design commented on June 4, 2024

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.

kaveh808 avatar kaveh808 commented on June 4, 2024

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.

JMC-design avatar JMC-design commented on June 4, 2024

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.

awolven avatar awolven commented on June 4, 2024

from kons-9.

JMC-design avatar JMC-design commented on June 4, 2024

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.

JMC-design avatar JMC-design commented on June 4, 2024

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.

awolven avatar awolven commented on June 4, 2024

from kons-9.

JMC-design avatar JMC-design commented on June 4, 2024

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.

kaveh808 avatar kaveh808 commented on June 4, 2024

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.

JMC-design avatar JMC-design commented on June 4, 2024

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.

awolven avatar awolven commented on June 4, 2024

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.

kaveh808 avatar kaveh808 commented on June 4, 2024

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.

JMC-design avatar JMC-design commented on June 4, 2024

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.

kaveh808 avatar kaveh808 commented on June 4, 2024

Last I heard, Trial did not support MacOS. Has that changed?

from kons-9.

kaveh808 avatar kaveh808 commented on June 4, 2024

Done by @awolven. Will revisit the issue once we move to Vulkan.

from kons-9.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.