Biweekly update #10: Huge changes, internally


We're a bit late again this time but here we go.
This update doesn't bring many new things for the user experience, but this is actually a pretty big update especially for the internal part.

What's new

  • New, revamped SBL file format
  • Open recent files
  • Separated Save and Save As
  • Improved syntax highlighting
  • Autocompletion tweak
  • Proper modulate
  • A little bit of optimization


Bug fixes and changes

  • Color and Modulate are now saved
  • The value of <value>  is now saved on float params, UV Transform block, and Choose block
  • Fixed the spacing of time loop checkbox on the Input block


New SBL Format
We've completely revamped our custom SBL file format. Now it's based on JSON, which will make it easier for us to maintain and extend it (e.g. adding more properties). But the main reason why we chose JSON is property nesting. On the old format, a property is not defined as key:value. Instead, every line is a property, for example the first line is file version, and the second line is the original file path. It is hard to read and extending it wouldn't be easy. JSON on the other hand, not only that it has proper property, it can also assign a group of properties to a property. We also avoided using comma as vector separator because that would mess up with user-written code. Now since vector components are stored as string, we don't have to worry about parse error anymore.
This is the biggest part of this update because we have to partially rewrite every single block just for this, but it definitely was worth it.


Open Recent File
Now you can open recently saved/opened files from File > Open Recent. They only display their filename but they will show you the full path when you hover on them.


Separated Save and Save As
Previously, the Save button will always ask you where to save your file. But now it will remember the file path and won't ask you anymore unless if the file has never been saved yet. And of course, there's Save As if you want to save it as a different file.


Improved Syntax Highlighting
Numbers are now highlighted and colored as light blue to make it easier to distinguish from other characters. Component references (<x>, <y>, <z>) are now also colored the same color as <value>. We also changed the selection color from white to semi transparent blue.


Autocompletion Tweak
We made the autocompletion less annoying. Just like before, the autocompletion will show up when you click a param that has no $variable on it, except that now it will disappear once you start typing. So if you don't want autocompletion, you won't have to press escape anymore. 


Proper Modulate
Changing the Modulate color will modulate every block previews, this is problematic because the block previews you see would be affected by modulate color which would not be their true output. But if we don't modulate those blocks, then you wouldn't be able to see the value of "MODULATE" variable in the previews.
But there's a thing, Godot won't modulate an object if "MODULATE" variable is used somewhere in the shader. So the trick is we don't modulate the block previews if you don't use the "MODULATE" variable or input in your shader because you don't need it anyway, but if you use that variable, it is safe to modulate those block previews since Godot won't modulate their color.

Old behavior where block previews are affected by modulate color


Optimization
We did some optimizations, one of them is the Input Block. Now the "UV Repeat" param is a static param, meaning that it will regenerate the shader code everytime you toggle it. Previously it uses a boolean uniform and a conditional, if true then the shader will repeat the UV. With this we don't have to regenerate the shader when we toggle it, but since using a conditional could slow down the shader performance, we decided to make it static instead.


Color and Modulate are now saved
Thanks to JSON, we can safely add these properties to the save file without creating chaos in our codebase.


The value of <value>  is now saved on float params, UV Transform block, and Choose block
This is actually something we forgot to implement on the previous release, but again thanks JSON because implementing this is much easier than it would. The float param is now saved as a dictionary that contains user-written expression and the actual value (float).
For those two blocks, they used a special, custom property to store their array but since JSON has built-in array, they don't have to be custom property anymore and they're now saved as regular param.


Fixed the spacing of time loop checkbox on the Input block
It was too close.


WARNING: THIS VERSION IS NOT COMPATIBLE WITH FILE VERSION 8 OR OLDER
Since we've completely changed our file format, of course this version wouldn't be compatible with the old format anymore.
However, this version can open SBL file version 9 which is saved from Shaderblocks Biweekly #9 build. This is done by internally converting them to the new format. For now the converter only support SBL version 9, it can't convert older version yet because the SBL format constantly changes from version to version. But don't worry they will be supported on the next release.
So if you want to open your file but it's older than version 9, you can open and resave it on the Shaderblocks Biweekly #9 build, this will upgrade the file format to version 9 so you will be able to open it in this new version.

Files

Shaderblocks_Windows_BW10.zip 15 MB
Mar 12, 2023
Shaderblocks_Linux_BW10.zip 19 MB
Mar 12, 2023

Get Shaderblocks

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.