Fusion Compute

An asset by _SmallConfusion
The page banner background of a mountain and forest
Fusion Compute hero image

Quick Information

0 ratings
Fusion Compute icon image
_SmallConfusion
Fusion Compute

An addon to make writing compute shaders less painful. Supports Godot 4.0+, tested up to version 4.4dev2

Supported Engine Version
4.0
Version String
1.1.0
License Version
MIT
Support Level
community
Modified Date
14 days ago
Git URL
Issue URL

Fusion Compute

This is an addon for Godot designed to make using compute shader less painful. Supports Godot 4.0 - 4.4dev2 and probably future releases.

When using compute shaders normally, you have to write many lines of boilerplate just to make a basic "hello world" program. I wrote this addon to fix that.

For example, the godot docs tutorial for compute shaders, which multiplies an array by two, uses around ~20 lines of gdscript. This plugin reduces it to much less:

func _ready() -> void:
    var compute := Compute.create("res://shader.glsl", 1, 1, 1)

    var data := PackedFloat32Array(range(16))
    compute.create_data(data.to_byte_array())
    
    compute.submit()
    compute.sync()

    var result := compute.get_data(0).to_float32_array())

More examples can be found in the examples folder.

There are only a few ways to interact with compute shaders. This plugin supports data buffers, images, and push constants. In addition, this plugin also supports multiple pipelines using the same buffers. Anything more than that (eg. recreating this example project with swapping RIDs through uniform sets) is not supported. I potentially want to add support for more things like that in the future, but the first priortiy of this plugin is to make interacting with compute shaders as simple as possible, rather than abstracting everything you could want to do with a compute shader.

Shaders themselves are not changed by this plugin, they are written exactly the same, only the gdscript boilerplate is abstracted away.

Documentation

Documentation of functions and usage can be found by reading the generated documentation of the Compute class in the Godot engine. Reading the multiply_arrays and generate_image will be helpful too. The slime example is a more complex example.

An addon to make writing compute shaders less painful. Supports Godot 4.0+, tested up to version 4.4dev2

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Fusion Compute icon image
_SmallConfusion
Fusion Compute

An addon to make writing compute shaders less painful. Supports Godot 4.0+, tested up to version 4.4dev2

Supported Engine Version
4.0
Version String
1.1.0
License Version
MIT
Support Level
community
Modified Date
14 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers