I'm working on an endless game so i designed it so that the lights are created when the player is near and deleted when not. However I've noticed that when the player comes into contact with any light for the first time it stutters when creating the light. If they leave and come back, even though the light was deleted and needs to be created again it doesnt stutter.
Example, i have a section with 28 lights. Only 8 are actually existing at most at any time. If I create 4 of that section in a row, after going through the whole first section with stutters the next 3 don't stutter.
I don't know the cause of this or fix. I'm just ignoring it happens and putting it on the back burner for now.
This issue occurs due to shader compilation and GPU resource allocation that happen the first time a specific light configuration (type and number of lights) is used. Since three.js internally caches compiled shaders, removing lights does not cause them to be recompiled when the same types and number of lights are created again.
The best solution is to avoid creating and destroying lights during gameplay. At the beginning of the game scene, create only the minimum number of lights that will be used simultaneously during gameplay, and place them somewhere outside the camera view. After that, instead of adding or removing lights during gameplay, reuse them by updating their position and intensity.
For those who have shadows that don't work, it's the box. Light isn't being passed through because your model (box or glb) reacts to it and doesn't let the light pass. In the properties, turn off lighting completely, and then there will be light. PANDAKO, please write this in the behavior description, because this problem is easy to encounter
I can't believe this actually works! This is exactly the extension i have been waiting for for so long! It would be cool if the shadows had smooth edges(the kind of blurry edges you often see in 3d games), that would be amazing. Thanks for the extension!
Thank you for the contribution. Very good for point lights, but unusable for creating general illumination of a very large scene because the higher the light source, the more we have to adjust the range to draw shadow and the more degraded and ugly the shadows are.
Hey, a really cool tool, would be an honor for us if you'd consider joining us as, we're looking for talented indie creators for games, tools, assets, zines, books, ect for a massive a co-op bundle, where we want to include 300 items at least.. If you would like to join us it would be awesome! https://itch.io/jam/ultimate-300-bundle-submissions best regards & peace <3
← Return to tool
Comments
Log in with itch.io to leave a comment.
I'm working on an endless game so i designed it so that the lights are created when the player is near and deleted when not. However I've noticed that when the player comes into contact with any light for the first time it stutters when creating the light. If they leave and come back, even though the light was deleted and needs to be created again it doesnt stutter.
Example, i have a section with 28 lights. Only 8 are actually existing at most at any time. If I create 4 of that section in a row, after going through the whole first section with stutters the next 3 don't stutter.
I don't know the cause of this or fix. I'm just ignoring it happens and putting it on the back burner for now.
This issue occurs due to shader compilation and GPU resource allocation that happen the first time a specific light configuration (type and number of lights) is used.
Since three.js internally caches compiled shaders, removing lights does not cause them to be recompiled when the same types and number of lights are created again.
The best solution is to avoid creating and destroying lights during gameplay.
At the beginning of the game scene, create only the minimum number of lights that will be used simultaneously during gameplay, and place them somewhere outside the camera view.
After that, instead of adding or removing lights during gameplay, reuse them by updating their position and intensity.
Additional notes about using lights have been added to the WithThreeJS Extension page.
Please also refer to the “Notes on Using Lights” section at the following URL:
https://pandako.itch.io/with-threejs-extension-for-gdevelop
For those who have shadows that don't work, it's the box. Light isn't being passed through because your model (box or glb) reacts to it and doesn't let the light pass. In the properties, turn off lighting completely, and then there will be light. PANDAKO, please write this in the behavior description, because this problem is easy to encounter
hey can you add colour tinting?
It would be so awesome
can you make 3d text cuz the og 3d text its buggy :(
I can't believe this actually works! This is exactly the extension i have been waiting for for so long! It would be cool if the shadows had smooth edges (the kind of blurry edges you often see in 3d games), that would be amazing. Thanks for the extension!
Hey! Thank you for this! This is exactly what I've been waiting for! I sent you a bit of money. Thanks again!
Just tested it out. I'm not sure if I'm missing something, but its not working.
It would be really good to be able to change the color of the light inside events.
イベント内のライトの色を変更できれば本当に良いと思います。
How many simultaneous light objects can this handle?
同時にいくつのライトオブジェクトを処理できますか?
Oh tried it out, and it seems that 15 simultanetous lights are valid and the 16th crashes the engine.
Can you please make an update that will allow to change the light intensity with events?
will there be updates/improvements for this extension in the future?
bruh!
this is gonna allow me to make some pretty cool shit
Hey, a really cool tool, would be an honor for us if you'd consider joining us as, we're looking for talented indie creators for games, tools, assets, zines, books, ect for a massive a co-op bundle, where we want to include 300 items at least.. If you would like to join us it would be awesome! https://itch.io/jam/ultimate-300-bundle-submissions best regards & peace <3
Wow you are a wizard! Amazing!
The extension is amazing but it could be even more so if you could change the opacity of each 3D object separately
Yo, this is sick!
Thank you, PANDAKO. Your contribution to the community will always be remembered!