A downloadable asset pack

Download NowName your own price

Godot Compositor - 3D Pixel Art

The demo project demonstrates how to create 3D Pixel Art with an Edge Detection Post Processing effect using Godot's new Compositor.

You can easily copy the script and GLSL shader to use in another project. 

Video tutorial: 

StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(3 total ratings)
AuthorPixelageGames
Tagsdemo, Godot, Pixel Art, Tutorial

Download

Download NowName your own price

Click download now to get access to the following files:

3DPixelArt_Tutorial.7z 161 kB

Comments

Log in with itch.io to leave a comment.

(10 edits)

TLDR

Anyway if anyone downloads this project make sure to go into edge_detection_compositor.gd script and add 

Line 123  rd.free_rid(texture_sampler)

to make the project not crash and also double check to enable "needs normal roughness" box within the inspector 

the worldenvironment  
-> Compositor  
-> Array[CompositorEffect]  
-> EdgeDectionCompositor  
-> [✓] Needs Normal Roughness


Hi, firstly thanks for this example project. It has been helping me find the visual style for my game.

However I think I've run into a similar bug to Kog_Works. I enabled "needs normal roughness" box within the worldenvironment -> compositor -> so on. 

For a while the project runs great, but after some time all of a sudden I end up getting this error that spams the console and makes the engine unusable since it makes everything lag.

 ERROR: Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline.
 ERROR: ./core/templates/rid_owner.h:294 - Parameter "mem" is null.
 ERROR: SamplerTexture (binding: 2) should provide two IDs referencing a sampler and then a texture (IDs provided: 1).
 ERROR: servers/rendering/renderer_rd/uniform_set_cache_rd.h:120 - Condition "rid.is_null()" is true. Returning: rid
 ERROR: servers/rendering/rendering_device.cpp:5221 - Parameter "uniform_set" is null.
 ERROR: Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline.
 ERROR: Element limit reached.

I haven't learnt compositing effects from scratch yet but any help or directions is appreciated. 👍

edit: I'm using Godot 4.5 and after running a fresh version of the project for almost 10 minutes got the same error as above.

edit - 2: I tried a fresh version of the project in a fresh install of Godot 4.4 like in ur video and got a slightly different error from myself previously and Kog_works. This time it happened after running the scene for 14 minutes and 50 seconds.


ERROR: Element limit reached.   
ERROR: ./core/templates/rid_owner.h:296 - Parameter "mem" is null.   
ERROR: servers/rendering/renderer_rd/uniform_set_cache_rd.h:131 - Condition "rid.is_null()" is true. Returning: rid   
ERROR: servers/rendering/rendering_device.cpp:5153 - Parameter "uniform_set" is null.   
ERROR: Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline.
ERROR: Element limit reached.   
ERROR: ./core/templates/rid_owner.h:296 - Parameter "mem" is null.   
ERROR: Failed to create uniform set for batch.


edit - 3: I think I found the problem, before I got too many errors and the whole engine becomes unusable, I went to the debugger and clicked on the first error which took me to the edge_detection_compositor.gd script, line 78. The error causing this issue has something to do with 

texture_sampler = rd.sampler_create(texture_sampler) 

having its element limit reached. When using 

sampler_create() 

The documentation says to make sure to use 

free_rid()

Once ur finished using your RID.


I think var texture_sampler was constantly getting larger and eventually caused a memory leak, making the outline disappear from the game and making the engine super slow and unresponsive.


I did fix the issue by putting 

rd.free_rid(texture_sampler)

on line 123 of edge_detection_compositor.gd and then was able to see memory usage in task manager wasn't slowly climbing anymore when running the project. I also ran the project for an hour afterwards and it was completely fine, memory usage actually went down to around ~200MB, probably something to do with godot in the background doing stuff with shader optimisation.


I also notice that line 120 in edge_detection_compositor.gd was commented out, is there a reason for that?


Hey my man
This is amazing Event send you some moneys too! That's super useful

I try to use the edge detection and some times I get this error spamming:

Any idea what it might be ?

  ERROR: Element limit reached.

  ERROR: ./core/templates/rid_owner.h:296 - Parameter "mem" is null.

  ERROR: SamplerTexture (binding: 2) should provide two IDs referencing a sampler and then a texture (IDs provided: 1).

  ERROR: servers/rendering/renderer_rd/uniform_set_cache_rd.h:131 - Condition "rid.is_null()" is true. Returning: rid

  ERROR: servers/rendering/rendering_device.cpp:5155 - Parameter "uniform_set" is null.

  ERROR: Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline.

  ERROR: Element limit reached.

Hey, sorry for the delay to answer. 

I was having these errors when I didn't check the "needs normal roughness" in the compositor.
You can find it by selecting the WorldEnvironment, then in the inspector expand the compositor array and click on the compositor effect, it should be there.

Let me know if it fixes the problem, and thank you for the donation!

Muito legal cara! Parabéns!

This looks incredible. I'm downloading it and 5*-ing it right away, in good faith. 

I am betting this technique could be used to make some sprite sheets, too!