Skip to content

Commit cdd2580

Browse files
committed
custom widget materials
1 parent ce36708 commit cdd2580

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

drafts/2025-02-04-fyrox-game-engine-1.0.0-rc.1.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ works ok, it is quite messy and has lots of bugs. This release isolated OpenGL i
167167
exposed public API for a graphics server that will be used in the future releases to transition to
168168
modern GAPIs.
169169

170-
# Scene (TODO)
170+
# Scene
171171

172+
Game scene and its nodes have quite a lot of improvements in this release.
172173

173174
## Flipping for Sprite/Rectangle Nodes
174175

@@ -181,6 +182,8 @@ ruin some hierarchies where flipping shouldn't affect descendant nodes. For exam
181182
above it, flipping it by negative scaling will result in flipped text, while `Flip X/Y` options will flip only the
182183
sprite/rectangle.
183184

185+
## Reflection Probe (TODO)
186+
184187
# Input (TODO)
185188

186189
Simplified interaction with keyboard and mouse.
@@ -190,7 +193,7 @@ Simplified way of getting input state
190193

191194
- Joint motors
192195

193-
# User Interface (TODO)
196+
# User Interface
194197

195198
The user interface system has gotten tons of useful improvements and fixes in this release.
196199

@@ -218,9 +221,31 @@ the description of items may use runs to highlight damage, armor, level, etc.
218221
Each run is defined by a pair of indices of letters in the text and a bunch of properties. The ranges can overlap, the
219222
last one on the overlapping set has the top priority.
220223

221-
## Widget Materials (TODO)
224+
## Widget Materials
222225

223-
- Ability to specify custom shaders for widgets
226+
![widget material](widget_material.gif)
227+
228+
For a long time, UI widgets didn't have an ability to assign custom materials and shaders, in this release this limitation
229+
is finally dropped. UI shaders have a built-in property group (`fyrox_widgetData`) that contains all useful properties that can be used
230+
for rendering:
231+
232+
| Name | Type | Description |
233+
|---------------------|-------------|------------------------------------------------------------|
234+
| worldViewProjection | `mat4` | World-to-clip-space transformation matrix. |
235+
| solidColor | `vec4` | RGBA color. |
236+
| gradientColors | `vec4[16]` | A set of gradient colors. |
237+
| gradientStops | `float[16]` | A set of normalized (0.0-1.0) stops along the axis. |
238+
| gradientOrigin | `vec2` | Origin position of the gradient (local coordinates). |
239+
| gradientEnd | `vec2` | End position of the gradient (local coordinates). |
240+
| gradientPointCount | `int` | Total number of gradient points. |
241+
| resolution | `vec2` | Frame buffer size to which the widget is drawn to. |
242+
| boundsMin | `vec2` | Top-left point of the screen space bounding rectangle. |
243+
| boundsMax | `vec2` | Right-bottom point of the screen space bounding rectangle. |
244+
| isFont | `bool` | `true` if the widget is a text, `false` - otherwise. |
245+
| opacity | `float` | Opacity (0.0-1.0 range). |
246+
| brushType | `int` | Brush type (0 solid, 1-linear gradient, 2-radial gradient |
247+
248+
As usual, any additional data can be passed via custom property group and a custom material.
224249

225250
## Improved Docking
226251

@@ -229,7 +254,9 @@ last one on the overlapping set has the top priority.
229254
Docking manager now supports any number of windows in a tile, this means that you can now put multiple windows in a
230255
tile and switch between them. It is also possible to rearrange them by dragging.
231256

232-
# Editor (TODO)
257+
# Editor
258+
259+
FyroxEd is an important part of the engine, it has gotten a lot of improvements and new features as well.
233260

234261
## Async scene loading
235262

@@ -282,10 +309,6 @@ and now it is much more convenient:
282309
This selector has searching functionality and loads only the assets that are currently in the view, so there's no
283310
lagging during the search.
284311

285-
## Settings (TODO)
286-
287-
- Added a setting to modify editor camera's mouse sensitivity
288-
289312
## 2D Grid
290313

291314
![2d grid](2d_grid.png)

drafts/widget_material.gif

260 KB
Loading

0 commit comments

Comments
 (0)