Weekly update #4: Up to 3 times faster!


This update is mainly about performance, nothing so new. Other than that, there are some minor improvements.

What's in this update

  • Faster performance (both realtime performance and code generation)
  • New inputs
  • Minor improvements


Faster performance
The performance is now up to 3 times faster. Here, we're adding and removing blocks on the Aura example then calculate the time it takes to generate shader which is displayed on the top left of viewport. To test this we used a pretty old laptop.

Before:

After:

The previous version takes 38-42 ms to generate the shader, while on the new version it takes 11-21 ms to generate. So in this test the new version is 2-3 times faster.
That's because in previous versions, it generates not only for the canvas but also for each individual blocks, and they're all unique materials.
You can see this by right-clicking a block preview.
But now it's different, now it generates only one shader and that will be used for everyone. This is done by using an array of previews and indexed by block id through the color attribute (because it is unique to every Godot CanvasItem), and the canvas id is the last element of array which is the main image.
That's for the code generation, for the realtime performance, it should be faster too because there's only one material and not unique.

New inputs
We implemented new inputs:

  • Color
  • Modulate Color
  • Texture Resolution
  • Screen Resolution

The color input is already there since the beginning, it's just not properly implemented because color is a unique attribute and it would need to be changed for each block, but thanks to the new preview logic, we now have to use a uniform for color and that's shared to all blocks.


Minor improvements

  • Export dialog: Syntax highlighting for built-in variables
  • Search: Group will not be shown if none of its member is in search result
  • Middle mouse button now move the view
  • Unimportant UI Fixes


What's next
On the next weekly update I will (hopefully) complete all unimplemented blocks and add some new blocks, and fix an issue where default variable names breaks your shader when loaded

Files

Shaderblocks-Windows.zip 15 MB
Nov 04, 2022
Shaderblocks-Linux.zip 19 MB
Nov 04, 2022

Get Shaderblocks

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.