I want to use ambient occlusion in my gdevelop game. I know that that isnt a feature right now, but is there a way to implement it with javascript instead, or no?
I haven’t seen anything like that.
And since it’s not possible to add effects via extensions, and extensions don’t handle layers either, that’s partly why it doesn’t exist.
However, with JavaScript events, I imagine there might be a way to hack the Three.js renderer, but that’s theoretical. In any case, it’s definitely not just a simple option to enable.
In short, technically you need JavaScript and you’ll have to figure out what to add to the engine, but you’ll have to look into that yourselves; it’s uncharted territory.
i think you might be making it sound more complicated than it is…yes, you actually can add effects via extensions, just not visibly in the editor. I once made my own pixi.js displacement shader, because gdevelop’s wasnt advanced enough for what i needed. all of the apis from everything gdevelop uses is accessible in javascript. Electron, Pixi.js, Three.js, etc. So basically, youd just be programming a Three.js webapp like how youre supposed to. I mean, i know personally that ive implemented tonemapping into a very simple extension, and that interacts with three.js.
using code like this:
![]()
also, Advanced 3D Features exists, which obviously interacts with Three.js…a lot. i just see more functionality in those rather than extensions that actually expand graphics capabilities
Effects within objects and layer effects in the interface cannot be edited or added.
You can modify everything if you tinker with JavaScript, but you won’t be able to create a new type of effect in the object/layer interface via extensions. Think of it like the object list: you can create new object types/prefab, which is doable with extensions, but that’s not the case for effects.
Anyway, in any case, you will need a JavaScript event in your project for ambient occlusion to actually modify the renderer as you did previously.
It’s up to you to look into AO, as I don’t know much about it.
It seems you already know how to edit the renderer; what you’re asking for is documentation on AO. Nothing exists for GDevelop. You need to look at what’s done for ThreeJS and adapt it for GDevelop.
i know, but the reason i asked was because i got stuck, and there is smart people here. i tried implementing LUTs into gdevelop, but i ran into the wall of javascript imports not working.