โš ๏ธ If you receive a black screen or a warning when using the WithThreeJS extension in GDevelop v5.3 or later, please see this page.
About the warning "Please add an Enable WithThreeJS object to a scene."

๐ŸŽ‰ WithThreeJs is now on the GDevelop Community Extensions!

Distribution of the latest version may take some time. The version currently distributed by the community is 2.0.2. (latest ๐Ÿ˜„)

WithThreeJS Extension for GDevelop

Extension for GDevelop to create simple 3D scenes.
This extension is intended for easy and simple 3D rendering. It does not currently aim for realistic 3D rendering.

๐Ÿ’Ž Feature

3D FeaturesWithThreeJSBuilt-in 3D
Editor integrationโ›…๐ŸŒž
3D Collision detection
๐ŸŒž๐ŸŒž (Extension)
3D Raycast๐ŸŒž๐ŸŒž (Extension)
3D Light๐ŸŒžโ›…
3D Shadow๐ŸŒžโ˜”
3D Sound๐ŸŒžโ˜”
3D Background image๐ŸŒž๐ŸŒž (My extension)
3D Sprite animation๐ŸŒž๐ŸŒž (Extension)
3D Particlesโ˜”๐ŸŒž (Extension)
3D Physics engineโ˜”โ˜”
Multiple 3D cameras๐ŸŒžโ˜”
Grouping 3D Objects๐ŸŒžโ˜”
Parent-child structure๐ŸŒžโ˜”
3D Helpers๐ŸŒžโ˜”
Post effectโ˜”โ›…
Supported 3D formatsGLB, OBJGLB

๐Ÿ“– How to use

Import the downloaded "WithThreeJS0.0.0.json" file into your project.

There is no manual at this time. Please refer to the following video.

โ„น๏ธ For more information about Behaviors, see "About Behaviors" below.

๐Ÿ“บ Please subscribe to my YouTube channel.

There are more videos on my YouTube channel.

Difference between GDevelop axes and 3D Scene axes

Difference between GDevelop units and 3D scene units.

GDevelop units are pixels and 3D scene units are meters.

Camera shooting direction

The camera shoots in the local negative Z axis direction.

About Behaviors.

This extension comes with very powerful behaviors.

The various projection behaviors project 2D objects onto 3D objects. When you create or move a 2D object, the 3D object changes in the same way.

  • 3D Sprite Projection Behavior
  • 3D Board Projection Behavior
  • 3D Plane Projection from Tiled Sprite Behavior
  • 3D Box Projection from Tiled Sprite Behavior
  • Linked 3D Camera Behavior
  • Linked 3D Light Behavior

The features supported by behaviors vary. Please also check the summary below.

โ„น๏ธ Many various 3D actions have no effect on objects using behaviors. Because the 2D object values take precedence.
โ„น๏ธ Do not add more than one of these behaviors to an object.

Please refer to the following video.

About 3D Custom Objects

This extension comes with custom objects.
Custom Objects are similar to Projection Behaviors, but support different features.

  • 3D Box Custom Object
  • Enable WithThreeJS Custom Object

Please also check the summary below.

About using GLB Model [UPDATE! 2.0.2]

๐Ÿ‘ฃ Where did the "Create 3D Model From Built-In 3D Model" action go?

With an updated GDevelop interface, the action now appears when you select a 3D model.

โš ๏ธ 3D models often have a parent-child structure. Therefore, if you want to use Bounding Box Collision, you need to know the ID (name) of the mesh that has the bounding box in advance.
The simplest solution is to add the 3D Model as a child of the 3D Box.

About importing OBJ files

It has some rules and restrictions.

  • Open the OBJ file in a text editor and copy/paste the contents into GDevelop.
  • The 3D model must contain UV mapping.
  • Texture is required. No MTL files are used, so no material colors are applied.
  • For models with multiple materials, specify the textures in GDevelop in that order. (Because of this limitation, it is not possible to set up an OBJ file where multiple models have materials in different orders)

โ„น๏ธ Entering large OBJ strings directly into actions slows down GDevelop. I recommend using Javascript events as shown in the video.

About the Alpha Channel Test

From v0.3.2, "Alpha Channel Test" can be set in "Create 3D Sprite", "Create 3D Plane", "Create 3D Model" and "3D Sprite Projection".
This is a non-rendered transparency reference value.

0 to 1 (Recommended values: 0 or 0.5)

โ„น๏ธ If the texture is opaque, you can set the value to 0 to reduce the drawing load.

About Skybox

To enable Skybox, you need to set an equirectangular image with a 2:1 aspect ratio.

Euler angle problem

As this image shows, you may not always get the values you expect from the rotation.


There is more than one way to represent any given rotation using XYZ (Euler angles). Comparing just one of the XYZ values of a rotation can be confusing.

The simplest solution is to use different variables for each XYZ to manage the rotation. Please refer to "Simple FPS Example" or "Third-person Perspective Example".

For more information on this problem, you may want to search for explanations of Euler and Quaternion by Unity, Unreal Engine, etc.

About 3D Lights

โ„น๏ธ 3D Sprite do not support 3D Lights.
โ„น๏ธ Lighting and drop shadows are different features.

How to enable 3D Shadows

  1. Darken the Ambient Light Color of the 3D Scene.
  2. Check "Cast Shadow" of 3D Light.
  3. Check "Cast Shadow" for the 3D Object that casts a shadow.
  4. Check "Receive Shadow" of the 3D Object that receives the shadow.
  5. Adjust the 3D Light shadow settings.

This extension provides real-time shadows.
Real-time shadowing is a heavy process. Therefore, it is recommended to minimize the shadow generation range.
It is a good idea to move the light along with the camera so that shadows are generated only where necessary.

โ„น๏ธ 3D Sprite do not support 3D Shadows.
โ„น๏ธ Many game engines often use pre-baked shadows and real-time shadows together, but with this extension it is difficult to use baked shadows and real-time shadows together due to limitations of Three.js.

For examples of adjusting 3D light properties, see this page.

Bounding Box Collision and Oriented Bounding Box Collision

โ„น๏ธ Note that the Oriented Bounding Box is generated based on the unrotated state of the 3D object.


๐Ÿ“‚ Examples project file

"WithThreeJsExtensionExamples0.0.0.zip" is the examples project.
Open "game.json" in GDevelop.

List of examples included in the project.

  • Basic Example (Using Behaviors)
  • Basic Example (Using Actions)
  • 3D Box With Multiple Textures Example [UPDATE! 2.0.0]
  • Loading OBJ Format Example => GLB vs OBJ [UPDATE! 2.0.0]
  • Loading Large OBJ Format Example
  • Platformer Example
  • Classic FPS Example
  • Background and Fog Example
  • Various Billboard Samples
  • 8 Direction Character Example
  • Bounding Box Collision Example [UPDATE! 2.0.0]
  • 3D Raycast Example
  • Simple Ground Check Example
  • Point on Camera Example
  • Alpha Channel Test Samples
  • Opacity Blend Samples
  • Dungeon Example
  • Remove 3D Object Example
  • Simple Effect Example
  • Effect Material Samples
  • Simple FPS Example
  • Parent-child Relationship Example [UPDATE! 2.0.0]
  • Third-person Perspective Example [UPDATE! 2.0.2]
  • 3D Sound Example
  • Multiple Camera Example
  • GLB Model Animation Example
  • Light Example
  • 3D Object Variable Example [UPDATE! 2.0.2]
  • Futuristic Racing Example
  • Shadow Example [NEW! 2.0.0]

๐Ÿ“ƒ Summary

โ„น๏ธ The "Projection Scale" and "View Mode" properties that affect Behavior can be set in the "Create 3D Scene" action.

3D Sprite Projection Behavior

Supported: position, animation, flip, scale, opacity, blend mode

  • [Expression]
    • Alpha Channel Test
  • [String Expression]
    • 3D Object ID

3D Board Projection Behavior [UPDATE! 2.0.0]

Supported: position, angle, animation, flip, scale, opacity, blend mode

  • [Expression]
    • Alpha Channel Test
  • [String Expression]
    • 3D Object ID
    • Axis linked to 2D Object Angle
    • Orientation

3D Plane Projection from Tiled Sprite Behavior [UPDATE! 2.0.0]

Supported: position, angle, image offset, opacity, (blend mode)

  • [Expression]
    • Alpha Channel Test
  • [String Expression]
    • 3D Object ID
    • Blend Mode

3D Box Projection from Tiled Sprite Behavior [UPDATE! 2.0.0]

Supported: position, angle, image offset, opacity, (blend mode)

  • [Expression]
    • Depth
    • Alpha Channel Test
  • [String Expression]
    • 3D Object ID
    • Blend Mode

Linked 3D Camera Behavior

Supported: position, angle

  • [Expression]
    • 3D Camera ID
    • Field Of View

Linked 3D Light Behavior [UPDATE! 2.0.0]

Supported: position, angle

  • [Expression]
    • Tilt
  • [String Expression]
    • 3D Object ID
    • Type

3D Box Custom Object [UPDATE! 2.0.0]

The 3D Box can have different textures on its 6 faces.
Supported: position, angle, opacity, (blend mode)
โš ๏ธ This object is high load.

  • [Expression]
    • Depth
  • [String Expression]
    • 3D Object ID

Enable WithThreeJS Custom Object

This custom object always enables built-in 3D rendering.
Click here for instructions on how to use it.

Function

  • 3D Scene
    • [Action]
      • Create 3D Scene [UPDATE! 2.0.0]
      • Clear 3D Scene
      • Load 3D Texture [UPDATE! 2.0.0]
      • Load 3D Model From OBJ
  • 3D Object
    • [Action]
      • Create 3D Sprite
      • Create 3D Plane
      • Create 3D Box
      • Create 3D Model
      • Create 3D Model From Built-In 3D Model
      • Create 3D Group
      • Move 3D Object
      • Move 3D Object On World
      • Rotate 3D Object
      • Rotate 3D Object Like Head
      • Rotate 3D Object On World
      • Look At 3D Object
      • Look At 3D Camera
      • Remove 3D Object
      • Change 3D Texture
      • Change 3D Object Visibility
      • Change 3D Object Opacity
      • Change 3D Object Scale
      • Change 3D Object DepthWrite
      • Change 3D Object All Animations Speed Scale
      • Change 3D Object Blend Mode
      • Resolve Bounding Box Collision
      • Add Child
      • Detach From Parent
      • Set 3D Object ID Of Children To Scene Variable (Deprecated) [DEPRECATED! 2.0.2]
      • Set 3D Object ID Of Children To Variable [NEW! 2.0.2]
      • Play 3D Animation
      • Stop 3D Animation
      • Set number to 3D Object Variable
      • Set string to 3D Object Variable
      • Linearly interpolate 3D Object
      • Add Suffix To 3D Object ID
      • Set 3D Object Shadow [NEW! 2.0.0]
    • [Expression]
      • 3D Object Position
      • 3D Object Position On World
      • 3D Object Rotation
      • 3D Object Rotation On World
      • 3D Object Direction
      • 3D Object Opacity [UPDATE! 2.0.2]
      • 3D Object Scale
      • 3D Object Animation Speed Scale
      • 3D Object Animation Time
      • 3D Object Animation Duration
      • 3D Object Number Variable
      • 3D Object String Variable
      • Distance From 3D Object To 3D Object
      • Bounding Box Collision Result Number
    • [String Expression]
      • 3D Object Parent
    • [Condition]
      • Check Existence Of 3D Object
      • Check Visibility Of 3D Object
      • Check Bounding Box Collision
      • Check 3D Animation Is Playing
      • Check 3D Animation Is Finished
      • Check Oriented Bounding Box Collision [NEW! 2.0.0]
  • 3D Camera
    • [Action]
      • Move 3D Camera
      • Rotate 3D Camera
      • Rotate 3D Camera On World
      • Rotate 3D Camera Like Head
      • 3D Camera Look At 3D Object
      • Change 3D Camera FOV
      • Change 3D Camera Near
      • Change 3D Camera Far
      • Change 3D Camera Zoom
      • Setup Multiple 3D Cameras
      • Linearly interpolate 3D Camera
    • [Expression]
      • 3D Camera Position
      • 3D Camera Rotation
      • 3D Camera Angle (Deprecated) [DEPRECATED! 2.0.0]
      • 3D Camera Direction
      • Distance From 3D Camera To 3D Object
      • 3D Camera FOV
      • 3D Camera Near
      • 3D Camera Far
      • 3D Camera Zoom
      • Point Of 3D Object On 3D Camera
      • Point Of World Position On 3D Camera
  • 3D Sound
    • [Action]
      • Play 3D Sound [UPDATE! 2.0.0]
      • Stop 3D Sound
      • Change Master Volume Of 3D Scene
    • [Expression]
      • Master Volume Of 3D Scene
    • [Condition]
      • Check 3D Sound Is Playing
  • 3D Light
    • [Action]
      • Create 3D Light [UPDATE! 2.0.0]
  • 3D Raycast
    • [Action]
      • Raycast
      • Raycast From 3D Camera [UPDATE! 2.0.2]
      • Raycast From 3D Object
      • Place 3D Object Using Raycast Result
    • [Expression]
      • Raycast Result Count
      • Raycast Result Number
    • [String Expression]
      • Raycast Result String
  • 3D Debug
    • [Action]
      • Create 3D Axes Helper
      • Update Bounding Box Helper
      • Output 3D Model Information To Console
      • Output All IDs To Console

๐Ÿ’– Recommended 3D Software

๐Ÿ‘พ Games created with this extension

Bomb Poi Poi

gd.games

Haunted Shadow House

gd.games

Time Trial 3D

gd.games (Liluo.io) / Google Play

๐Ÿ”— Three.js

Copyright 2010-2023 Three.js Authors
https://github.com/mrdoob/three.js/blob/dev/LICENSE

๐Ÿฉ Donation

In the future I would like to add many features to this extension. (e.g. particle system, physics, etc.)
However, developing this extension requires a lot of time.
Currently, I'm doing development in between jobs, but if many people support me, I will be able to devote more time to the development.
If you enjoy this extension, please consider downloading the Example project file to maintain this extension. (The Example project file will surely help you.๐Ÿ˜‰)

Buy Me a Coffee at ko-fi.com

StatusIn development
CategoryOther
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(51 total ratings)
AuthorPANDAKO
Made withGDevelop
Tags3D, Pixel Art, Retro
Code licenseMIT License

Download

Download NowName your own price

Click download now to get access to the following files:

WithThreeJS2.0.2.zip 59 kB
WithThreeJsExtensionExamples2.0.2.zip 13 MB
if you pay $5 USD or more

Development log

View all posts

Comments

Log in with itch.io to leave a comment.

Viewing most recent comments 1 to 40 of 178 ยท Next page ยท Last page

Awesome extension! I am currently having trouble with the 3D lights however. When i delete the light object, the light stays in place of the object as shown in the screenshot.

Also i know this isn't relevant to this extension but i know you developed it, the Mouse Pointer Lock extension doesn't seem to work on desktop and (chromium-based) browser version of GDevelop, only in Firefox.


Hope to see more improvements to the extension in the future!

This also applies to toggling it's visibility.

(1 edit)

Thank you for reporting this.

I was not able to reproduce the lighting issue. I checked both when using behaviors and when using actions.

Please let me know the steps to check the issue in a new scene.

Do you mean the helper is not deleted? The helper is for debugging and will not be removed.

I don't know how, but trying to reproduce the bug in a new scene/project and now it works as intended when i toggle visibility of the light object. I honestly have no clue what i did wrong since both scene events look identical.

The only difference i made is i created the "light" boolean variable using "At the beginning of the scene" and made it a scene variable instead of a global variable.

I can maybe send the project file to you to check it out yourself.

> Do you mean the helper is not deleted? The helper is for debugging and will not be removed.

No, the bug happens when the helper is on or off. Doesn't matter.

Please send me your project files. I'll leave it up to you to decide how to send the files.

Here you go!

I received the project.

I can't find an action to remove the light. I don't know how to reproduce the problem.

Please explain.

Are you using the "Mouse Pointer Lock" extension on Linux? I've heard reports of issues with it on Linux.

Yes! To be specific, Arch Linux with the GNOME desktop environment using X11/X.org display server. It only works when i have GDevelop open in Firefox and nothing else.

The extension will be updated soon (if approved by GDevelop...)

An update for the Mouse Pointer Lock extension has been released. v0.1.7 is available.

Can confirm it works! Much appreciated!

when 3d multiplayer example?

Hey PANDAKO can you re-added Correct 3D Camera Rotation Within Limits (experimental) for the Website version of Gdevelop

Hello! The pause and return to the scene it's fixed now?

where did correct camera rotation go?

(+1)

Really like this! Paid the $5. Worth it!
I'm using Create Objects from LAYOUT in my scenes and notice when I PAUSE & go to another scene...   objects from the previous scene transfer...   and when I RETURN to the original scene it crashes

(+1)

Thank you for reporting it. I have confirmed that an error occurs.

WithThreeJS does not support the "Pause and start a new scene" action. Currently, I am working on improvements to avoid the error.

Also, I need to have a scene with an ORTHOGRAPHIC camera view. How can I do that?

can you use 3d shadows in gdevlops 3d

(+2)

My game is made with this extension.

https://radioactive-frog-games.itch.io/the-elders-realm

Is there a chance you can sell ready g develop templates? I am having hard time following your youtube tutorials. I would pay for those templates. 

(+1)

thank yuo so much for making this! definitely changed gdevelop!

(+1)

could you make a documentation on this extension?

How do I get the example?

(+2)

have to pay 5 bucks

Download older version if using an older version of Gdevelop?

Ok, I figured out how to add my own GLB 3D file from the video above. Thanks for that! But how do I add collision with the camera and GLB object? I can not seem to get it to work. Oh and is there a forum for WithThreeJS? It would be nice to have community support.

(+2)

The new gdev update breaks this extension

Yeah, I get a black screen when I open the preview of the project I was testing this with. Hopefully there's an update fix.

(+1)

Thanks for letting me know. I am currently working on the issue.

If you want to solve the issue right away, please add a 3D box to Scene objects (no need to place it in the scene). That alone will solve this issue.

(1 edit)

Oh that seemed to work, thank you!
Love the extension. Hopefully one day you can just mod the official 3d to include things like your lighting and sprite projections.

Hey uh, huge fan, love your work. Umm, could you help me with setting up 3D sound. I can't seem to find a simple explanation for it. I want a rock band to play songs on stage and the player's location to affect how it sounds. Please and thank you.

(1 edit)

Really cool! Just purchased. Is there a way to make snow falling? Like a particle effect.

(1 edit)

Is there a way to get other versions of this extension? The latest versions are fine, but I'm not quite used to the changes yet. I'm specifically looking for version 8.5, btw.

(-1)

It's possible to use Spine 2D Threejs runtime with this plugin? 

(-2)

We are waiting for version 1 !!!

There is an extension 3d particles that works with default gdevelop 3d but doesnt work with WithThreeJs. Could you please integrate it with WithThreeJs?

I use 3D projection sprites and want to remove them by there 3D ID. Is this possible?

Can we make 3D layers, for example to make an enemy marking mechanic like in Metal Gear Solid V or Far Cry?

(5 edits) (+5)
I managed to add advanced light and shadow, it's still a little rough but it worked.

Great! Did you use JS for this?

(1 edit) (+3)

Thank you.
I am adding features from ThreeJs.
Within 1 or 2 days I will upload a scene with all the new content, including a night / day scene, a generator of terrain (using heightmaps and displacement) and an isometric game mode.

Deleted 1 year ago
(+1)

Wow this is really epic! How did you do this?

(+1)

Thank you very much, Pandako. Great work.

I created a little mod for your extension, to load morph targets.

Hi Pandako,
I tried to follow with the examples and I cant get mouse look or wasd movement working despite copying exactly from the simple fps example. Could you make a tutorial video of how to get it working from scratch?

pls add lighting

(+2)

Hi Pandako,
Firstly, Thank you for the frequent updates on the extension!

I need to ask, what do you think is the difference between this extension and the 3D features built in GDevelop?
Your description says "This extension is intended for easy and simple 3D rendering." Which means it is made for graphics like Duke3D:

image

Is that correct?
If you plan to optimize the 3d functions and avoid adding shaders, I would be very happy.

how to make camera bounce when moving?

How do I use this in the browser version of GDevelop? There is no option to import an extension.

I don't know if the browser version allows extension from asset store, but this is now in the Community Extensions

Really? What is it called? 

I think it's also called "WithThreeJS". There is an image from this page, try looking for it. (Can't paste it here somehow)

Thank you so much!

How to find out 3d object ID? What is the easiest way?

(1 edit) (+1)

Hi! Just noticed something with the animations - when you try to play an animation it will just stay idle(not animated) unless you click off "hide 2d" then they all start to animate. I can't seem to get any projected 2d sprites animated without this option..

Deleted 4 days ago
(+2)

Version 0.9.0 is not backward compatible. You must correctly re-set the parameters of all actions and expressions related to 3D.

If it is difficult, please download version 0.8.5 from this page and import again.

pandakoใ•ใ‚“ใฏใ˜ใ‚ใพใ—ใฆใ€‚YouTubeใ€ใ„ใคใ‚‚ๆ‹่ฆ‹ใ•ใ›ใฆใ„ใŸใ ใ„ใฆใŠใ‚Šใพใ™ใ€‚ๆœ€่ฟ‘ใ‚ฒใƒผใƒ ไฝœใ‚Šใซ่งฆใ‚Œๅง‹ใ‚ใŸๅ…จใใฎๅˆๅฟƒ่€…ใชใฎใง่ณชๅ•ใฎๆ„ๅ›ณใŒใ†ใพใไผใˆใ‚‰ใ‚Œใ‚‹ใ‹ไธๅฎ‰ใชใฎใงใ™ใŒ๏ผ‘ใคใŠไผบใ„ใ—ใŸใ„ใ“ใจใŒๆœ‰ใ‚Šใพใ™ใ€‚็งใฏใƒ‡ใ‚นใ‚ฏใƒˆใƒƒใƒ—PCใงใฏใชใiPadใ‚’ไฝฟ็”จใ—ใ€Gdevelopใซใฆใ‚ฒใƒผใƒ ใ‚’ไฝœใ‚Šๅง‹ใ‚ใŸใฎใงใ™ใŒใ€ใ“ใกใ‚‰ใฎใ‚ตใƒผใƒ“ใ‚นใ‚’ๅˆฉ็”จใ—ใ€Gdevelop appใง3Dใ‚ฒใƒผใƒ ใ‚’ไฝœๆˆใ™ใ‚‹ใ“ใจใฏ็พ็Šถ้›ฃใ—ใ„ใฎใงใ—ใ‚‡ใ†ใ‹๏ผŸๅ›ž็ญ”ใ„ใŸใ ใ‘ใพใ—ใŸใ‚‰ๅนธใ„ใงใ™ใ€‚

Hi Beginnerman,

I recommend using the browser version instead of the app version.

ใ“ใฎๆ‹กๅผตๆฉŸ่ƒฝใฏiOSใ‚ขใƒ—ใƒช็‰ˆใงใฏไธๅฎ‰ๅฎšใงใ™ใ€‚ใ‚ขใƒ—ใƒช็‰ˆใงใฏใชใใƒ–ใƒฉใ‚ฆใ‚ถ็‰ˆใ‚’ไฝฟ็”จใ™ใ‚‹ใ“ใจใ‚’ใŠๅ‹งใ‚ใ—ใพใ™ใ€‚

Viewing most recent comments 1 to 40 of 178 ยท Next page ยท Last page