Skip to content

New extension: Environment Map #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

Description

Provides two ways to create environment map. (Cube Map and Equirectangular Map)

It applies the image texture to the threejs environment map. and It has also option to apply same texture to the gdevelop scene background. On this one it override the gdevelop render. Because on default gdevelop's only option for background is color picker, we can't put images to the scene backgrounds. So that makes the game freeze at the beginning till the images load for the background.

For the Equirectangular image method: Because threejs scene is Y up the background and environment map created is not suitable for Z up games.
Unless gdevelop start to use threejs version 162 and above. 162 is the first time environment map and background rotations implemented. When Gdevelop migrates to newer threejs version I will update this extension to provide easy way to rotate environment map to Z up.

For the cube map: images can be edited externally to get the desired orientation.

Also when Gdevelop adds a .hdr file support this extension can be updated for that too.

How to use the extension

Why do you need this?
3D models with reflective surfaces (metalness/roughness) will reflect this Environment Map.
Your scene will be illuminated realisticly with this Environment Map.
Good for creating static Skyboxes that covers entire 360° Scene background.

How to use this?
Cube Map: Use tools like https://matheowis.github.io/HDRI-to-CubeMap/ to create a CubeMap from HDRI images.
Equirectangular Map: Use HDRI preview images from sites like https://polyhaven.com/
Make sure to choose "Keep Model Material" in 3D model's object properties

Limitations
This is not for realtime reflections, your reflections are gonna be static image.
Gdevelop doesn't have .hdr file format support, Only image formats (png, jpg etc.) can be used.
In Gdevelop Threejs scene is Y up oriented. For your Z up game, Cube Map textures needs to be setup manually for desired result.

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

Environment Map Example.zip

Extension file

EnvironmentMap.zip


Extension by @Eldarduil

You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type !update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:

!update [MyExtension.zip](https://github.com/GDevelopApp/GDevelop-extensions/files/12709661/MyExtension.zip)

It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!

@github-actions github-actions bot requested a review from a team as a code owner May 30, 2025 11:53
@github-actions github-actions bot added the ✨ New extension A new extension label May 30, 2025
@D8H D8H added the ⌨ JavaScript Uses JavaScript code, and thereby needs a reviewer who knows JavaScript. label Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨ JavaScript Uses JavaScript code, and thereby needs a reviewer who knows JavaScript. ✨ New extension A new extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants