Hi Giderians,
Newest Gideros is here, this time with nice (IMHO) new features.
TextFields used with cached TTFont (internally known as TTBMFont, the fastest way to draw texts on Gideros), can now be automatically made oblique, underlined or even striked through, by using the new escape sequences below:
- \e[i]Some text\e[!i] for oblique text
- \e[u]Some text\e[!u] for underlined text
- \e[s]Some text\e[!s] for striked through text
Each of these sequences accept an optional parameter, the inclination angle for oblique text, and the line thickness for [u] and [s]. There is also a [l] escape sequence to specify both line placement and line thickness.
Along with existing [color] and [font] tags, this allow showing text with richer formatting more easily.
Second nice new feature is the ability to attach a render target to a viewport. When done so, the Viewport will not be rendered on screen, but on the render target, which can be used later in the scene. This allow shadow maps or any other use case to be computed by Gideros automatically, without needing to do it in lua in each frame.
Third addition, useful for 3D scenes, is the ability to tell Gideros to perform a depth sort of Sprite children in order to render them from the farthest to the nearest, allowing correct translucency effects. This is demonstrated in the updated 3D cube demo.
Have a nice coding!
Full change log:
New features[export/quest] Implement Scene API
[core/sprite] Add Sprite:setAutoSort(bool) that tells Gideros to depth sort sprite children on draw
[core/viewport] Add Viewport:setTarget(rt) to allow viewports too be rendered automatically to rts
[core/textlayout] Support oblique,underlined and strikethrough styles
Improvements[backend/gl] Improve buffer management
[core/matrix] Improve API, allow passing vectors on some calls
[core/sprite] Allow passing vectors on some calls
[export/quest] Report menu button press
[export/html5] Better handle WebGL context loss
[examples/cube3d] Use new autosort feature
Fixes[ios] Clear touches table when a view is dismissed
[plugin/share] Use main lua context for events
[lua/compat] require now assumes dots are path separators
[core/compositefont] Fix space size determination
[core/fontlayout] Tinker with wrappable text layouts handling
Download it from here:http://giderosmobile.com/download
Comments
Thank you very much for always taking the time to maintain and update the wonderful features for Gideros! Your passion in your work is always an inspiration to me. Thank you and I wish you lots of health and joy!
Likes: pie, hgy29, MoKaLux, EricCarr
May I ask you how to pass the optional parameter in
- \e[i]Some text\e[!i] for oblique text
- \e[u]Some text\e[!u] for underlined text
- \e[s]Some text\e[!s] for striked through text
?
updated wiki https://wiki.gideros.rocks/index.php/TextField
Likes: MoKaLux, pie
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Fragmenter - animated loop machine and IKONOMIKON - the memory game
https://wiki.gideros.rocks/index.php/Sprite:setEffectStack
here i see only one shader, so can you give an example with multiple shaders?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
I am not sure if I found a bug?
Viva Gideros
https://www.lua.org/extras/5.2/strict.lua
In release 2023.5 it still works.
Likes: Xman, MoKaLux
Likes: MoKaLux
See effectStack setup at line 139 of effect.lua.
Likes: keszegh
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh
Likes: MoKaLux
"Second nice new feature is the ability to attach a render target to a viewport. When done so, the Viewport will not be rendered on screen, but on the render target, which can be used later in the scene. This allow shadow maps or any other use case to be computed by Gideros automatically, without needing to do it in lua in each frame."
@hgy29 explain this please, as I understand if my shadow map is dynamic, I should redraw it any way, isnt?
Now Im doint following:
1) Draw to shader map on temporary RT
2) Apply shade shader
3) Draw to resulting RT
4) Repeat for each light source
Do we have now any performance effort now it this way of drawing?
And one more question, if a want use same feaure with Sprite, do I should create Viewport any way to achieve autodraw?
What I expect is that RT is automatically tooks Viewport as current frame, without needing of using draw. If so does it performs faster, as I have some performance loss in 2024.2 compared to 2024.1 tied with RT draw (details in slack)?
- Done without lua intervention, so slightly faster CPU-wise
- Possibly the RT is computed more closely to its usage, so it could be left in GPU cache and accessed faster by the GPU when rendering
- The RT could be reused several times during the same frame
To use it, assign the Sprite you want to draw on your render target as the content of your viewport (setContent), and sets your render target as the target of the viewport (setTarget). Then add the viewport to your scene in a way that it is drawn before and as close as possible to the Sprite reading in the RT. It won't render anything on screen though.
Likes: Yan
I can start it and add anyone of you guys as admins. What do you think?
How should I call it?
- Gideros
- Gideros Mobile
- Gideros Studio
- ???
Thank you!
Likes: MoKaLux
Here's a hook drawn that way to two RenderTargets. Ignore the green antenna sticking forward. That's unrelated.
Likes: PaulH
Likes: MoKaLux
This has been one of those baffling issues. There's more going on here than just the version of the libraries I was using. With Gideros 2023-2 and its libraries I was still getting displaced geometry in an animated mesh, and not just drawing to a RenderTarget. The distortion of the hook (messed up location of the bones in the animated mesh) only occurs if the scene containing the animated mesh also contains another mesh that's using instancing. What made that really hard to pin down was that it also only happens if there's nothing else to render on the stage, or in the case of drawing to a RenderTarget, if there's nothing else to render in the sprite being drawn to it. If there's even a fully transparent TextField also present, the distortion doesn't happen.
There's one other issue that's still present in Gideros 2024-4, however:
If the code includes (mesh):setInstanceCount() for some mesh but doesn't call setInstanceMatrix() or doesn't call updateInstances(), the player will crash without any error messages to the output window.
Likes: hgy29
Likes: PaulH
Thanks for adding the check for that scenario. It's pretty rare to find a lua error that will crash the player, and I really appreciate that. Debugging would be a lot harder if there were many issues that could crash the player.