-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
124 lines (90 loc) · 4.24 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
QML GLSL Coder
v1.2.0
project URL:
https://github.com/neolit123/qml-glsl-coder
--------------------------------------------------------------------------------
INFORMATION
"QML GLSL Coder" is a live editor of GLSL fragment shaders based on Qt / QML.
the project is inspired by the following tools:
- ShaderToy (by IQ)
- Quint (by Andrew Baldwin)
- GLSL-Sandbox (by various contributors)
a couple of years ago i saw that easy, on-the-spot GLSL shader compilation was
possible with Qt / QML in the Quint project, but it had some issues and was
not very usable. in the meantime, i was playing with writing some effects in
the other listed tools which are WebGL based.
this project is not a port of Quint but rather a written from scratch, fully
functional editor that i started writing a while back.
public domain license - see the file LICENSE!
--------------------------------------------------------------------------------
SCREENSHOTS
https://tinyurl.com/ycl39h8p
https://tinyurl.com/y8d7rf6j
https://tinyurl.com/y9j9hlc8
https://tinyurl.com/y6vfpc42
--------------------------------------------------------------------------------
WHAT WORKS
only tested on Win32 desktop!
press F1 for the help screen and a list of keyboard shortcuts.
*) has a pretty usable text editor
- the editor is defined in qml/Editor.qml
- the editor can be toggled with F4
- everything that QML's TextEdit has, this editor has as well
- mouse wheel and page up/down support
- shows the current line and compilation errors
- has a syntax highlighter defined in cpp/highlighter.cpp/.h
*) loading/saving .glsl files
- F7/F8 open the file load/save dialogs
*) loading of a single image that can be used as a texture
- controlled with F6
- see shaders/greyscaleTexture.glsl for an example
*) dynamic quality and interpolation
- controlled with F9, F10, F11
*) toggleable FPS counter and mouse cursor
- controlled with F2, F3
*) fullscreen support
- controlled with F12
--------------------------------------------------------------------------------
WHAT DOESN'T WORK (THAT WELL)
here are some issues which are caused by Qt / QML bugs or missing features:
*) Qt 5.5 has some sort of a bug in QQuickShaderEffect that prevents on-the-spot
changes of the .fragmentShader property. this forced me to write a custom
QQuickItem named ShaderItem which is a stripped down QQuickShaderEffect
replacement.
*) auto-compile-on-edit actually works quite well on the ShaderItem side,
but the onTextChanged() signal from TextEdit is a bit sporadic.
therefore, i have disabled auto-compile-on-edit and you have to press F5 to
recompile. at some point this could become an option.
*) on Win32 the file open/save dialogs don't show in fullscreen unless the UI
is clicked. to solve the issue the file dialogs are opened in window-mode
and when closed, the original mode (e.g. fullscreen) is restored.
*) for some reason, when the application window is open it makes certain
tools on Win32 sluggish, while the CPU remains almost IDLE.
*) lines with bold text have more height than lines without bold text, which
breaks the estimation to fit exactly N lines of text in the editor visible
area and the last line may be cut. QML's TextEdit has no easy means to set
a fixed line height which is not very convenient.
--------------------------------------------------------------------------------
QMAKE VS CMAKE
cmake is more potent, while qmake is easier for a fast project setup. period.
this project is qmake based.
hopefully qmake will not be deprecated soon.
--------------------------------------------------------------------------------
DEPLOYMENT SIZE
40MB on Win32 is a bit too much but that's how Qt works.
if i wrote the same in SDL and some sort of a simplified widgets toolkit
it could have been in the lines of 10MB but it might have taken more time.
--------------------------------------------------------------------------------
BUILDING
install the latest Qt version
cd <path-where-the-coder-source-is>
qmake
make
--------------------------------------------------------------------------------
PRE-BUILD BINARIES
qml-glsl-coder-1.0.0-win32-qt5.5.0.zip:
https://tinyurl.com/y8h5c22h
qml-glsl-coder-1.2.0-win32-qt5.5.1.zip:
https://tinyurl.com/y9om8f6b
--------------------------------------------------------------------------------
EOF