Defold 1.4.6 has been released

Defold 1.4.6

Release notes

Summary

  • NEW: (#7521) Generate a build report for live update content
  • NEW: (#7238) Set texture float support
  • NEW: (#7559) Refactor textures as handles
  • NEW: (#7578) Resource get texture info
  • NEW: (#7585) New paramenter --max-cpu-threads for bob.jar
  • NEW: (#7583) Support texture handles in render.enable_texture
  • NEW: (#7591) Added back gesture support for Android 13
  • NEW: (#7566) Show project template URLs on editor Welcome screen
  • NEW: (#7614) Fix focus on committing values in the form view
  • FIX: (#7477) Added option to make DefoldActivity transparent on Android
  • FIX: (#7510) Crash when using a tilesource with 50 tiles
  • FIX: (#7603) Fix issue when setting up persistent file storage on HTML5 from a sandboxed iframe
  • FIX: (#7607) Cubemap faces are flipped when bundling
  • FIX: (#7373) Updated MoltenVK to v1.2.3 db8512a6
  • FIX: (#7635) Fixed issue with finding the skin in an animated model
  • FIX: (#7594) Added support for throwing a Java exception from the model compiler
  • FIX: (#7612) Fixed struct size calculation for buffer formats
  • FIX: (#7562) Clickable Lua preprocessor build errors
  • FIX: (#7570) Correct animation preview speed on high refresh rate screens
  • FIX: (#7551) Show output from the bundle process while bundling from the editor
  • FIX: (#7633) Fixed modelc exception handling for Win32
  • FIX: (#7635) Fixed issue with finding the skin in an animated model
  • FIX: (#7576) Camera frustum preview

Engine

NEW: (#7521) Generate a build report for live update content
The generated build reports will now also list excluded live update content in a separate report file.

java -jar bob.jar --verbose --platform=x86_64-macos --archive --liveupdate=yes --build-report=report.json --build-report-html=report.html clean build bundle

Will generate:

excluded_report.html
excluded_report.json
report.html
report.json
report_time.json

NEW: (#7238) Set texture float support
Exposed floating point texture formats to the resource script API:

resource.TEXTURE_FORMAT_RGB16F
resource.TEXTURE_FORMAT_RGB32F
resource.TEXTURE_FORMAT_RGBA16F
resource.TEXTURE_FORMAT_RGBA32F
resource.TEXTURE_FORMAT_R16F
resource.TEXTURE_FORMAT_RG16F
resource.TEXTURE_FORMAT_R32F
resource.TEXTURE_FORMAT_RG32F

Note that the device running your game might not support all of these features, and the constants will only be exposed if it does. To check if the device can support a certain format, you can check if it is nil:

if resource.TEXTURE_FORMAT_RGBA16F ~= nil then
    -- it is safe to use this format
end

NEW: (#7559) Refactor textures as handles
Refactored how textures and rendertargets are exposed and used in the engine, instead of passing around raw pointers, we now represent them as generic asset handles. This is the first step to bring the render and gameobject world closer together, where graphical assets can be transparently shared between them. Meaning, a texture that has been created by a script (or any texture, e.g an atlas texture) can be passed to the render scripts where it could be bound to the render state for drawing. Similarly, a render target could be created in a render script, passed to a game object and used as a texture on a model or an atlas.

NEW: (#7578) Resource get texture info
Added the new function resource.get_texture_info to get metadata from a texture resource or handle:

local my_texture_info = resource.get_texture_info(my_texture_path)

-- my_texture_info is a table that contains
{
     handle, -- the numeric handle of the texture
     width, -- width of the texture
     height, -- height of the texture
     depth, -- depth of the texture (1 for a 2D texture, 6 for a cube map and [1...slice-count] for an array texture)
     mipmaps, -- number of mipmaps the texture has
     type -- texture type
}

NEW: (#7585) New paramenter --max-cpu-threads for bob.jar
Added new parameter --max-cpu-threads for bob.jar which controls the maximum number of threads bob.jar can use. At the moment this value used only by the texture encoder.
Also, if texture compression is ON in the editor, the editor uses at least detected_max_threads - 1 in case when 2–4 threads are available and detected_max_threads - 2 if more than 4 cores are available.

NEW: (#7583) Support texture handles in render.enable_texture
Render scripts now support enabling texture handles via the render.enable_texture function. This means that you can pass a texture handle from scripts to the renderer and use them as global textures when rendering:

-- in a regular gameobject script:
local my_texture_info = resource.get_texture_info("/my_atlas.a.texturesetc")
msg.post("@render:", "set_my_texture", { handle = my_texture_info.handle })

-- in a render script:
function update(self, dt)
    render.enable_texture(0, self.my_texture)
end

function on_message(self, message_id, message)
    if message_id == hash("set_my_texture") then
        self.my_texture = message.handle
    end
end

NEW: (#7591) Added back gesture support for Android 13
Android 13 doesn’t support Back button anymore. Instead, it uses back gesture. This

:warning: AndroidManifes.xml updated with new flag android:enableOnBackInvokedCallback="true" for the <application> tag. If you use your own manifest, make sure you apply the same changes.

FIX: (#7477) Added option to make DefoldActivity transparent on Android
It is now possible to make the main Activity transparency by adding a meta-data option in AndroidManifest.xml:

    <meta-data android:name="alpha.transparency" android:value="true" />

Note: By default the feature is disabled and does not negatively impact performance.

FIX: (#7510) Crash when using a tilesource with 50 tiles
The “max mipmaps” value was not correctly set in res_texture, so the assert was triggered even though it should have been supported.

FIX: (#7603) Fix issue when setting up persistent file storage on HTML5 from a sandboxed iframe
Setting up persistent file storage while running an HTML5 build from a sandboxed iframe on Firefox would throw an exception and stop the game from loading. This change will catch any exceptions thrown while setting up persistent file storage and continue to load the game.

FIX: (#7607) Cubemap faces are flipped when bundling
Fixed a bug where the cubemap +z and -z sides are uploaded incorrectly on OpenGL based graphics adapters.

FIX: (#7373) Updated MoltenVK to v1.2.3 db8512a6
We’ve updated the MoltenVK library to version 1.2.3

FIX: (#7635) Fixed issue with finding the skin in an animated model
This fixes a crash when the skin didn’t have a name.

FIX: (#7594) Added support for throwing a Java exception from the model compiler
We’ve made the model compiler more robust and it will now catch any C/C++ errors, and then throw a Java error. This lets the editor handle such a case, and we minimise the risk of the user losing any edits in the project.

FIX: (#7612) Fixed struct size calculation for buffer formats
The allocated buffers used too much memory due to a miscalculation in the struct size.

Editor

NEW: (#7566) Show project template URLs on editor Welcome screen
The project templates that are used on the editor Welcome screen are downloaded from GitHub when used. This change shows the URL of each template project in the list. The URL is clickable and will download the template project if selected. This will help users understand that the templates are not stored locally with the editor but downloaded from the internet, and thus require an internet connection to use.

NEW: (#7614) Fix focus on committing values in the form view

FIX: (#7562) Clickable Lua preprocessor build errors

  • Build errors from extension-lua-preprocessor now show more information and are clickable in the Build Errors view.

FIX: (#7570) Correct animation preview speed on high refresh rate screens
The update speed for flipbook animations and particle effects were locked to 60 updates per second even if previewing on a high refresh rate screen (eg 144Hz).

FIX: (#7551) Show output from the bundle process while bundling from the editor
This fixes an issue in Defold 1.4.4 where output from the command line tool was not shown in the editor while bundling.

FIX: (#7633) Fixed modelc exception handling for Win32
We fixed a use-after-free issue that was noticed on Windows platforms.

FIX: (#7635) Fixed issue with finding the skin in an animated model
This fixes a crash when the skin didn’t have a name.

FIX: (#7576) Camera frustum preview
Added a wireframe rendering of the camera frustum for the editor.

25 Likes

just asking will pbr be an engine feature or an extension for 3d

It will be an extension with some tools, shaders, render pipeline etc It should be ready for pre-release soon. @jhonny.goransson will be able to provide more info.

7 Likes

thaks

Just updated, and building now throws this error:

/crypt/ext.manifest
	Internal Server Error

When removing the crypt extension, a new error is thrown:

/extension-gamecenter/ext.manifest
	Internal Server Error

Both extensions are up to date. Removing the internal folder didn’t help. Maybe something is up with the build server?

Maybe.
What extensions are you using?
Which platform are you building for?
Which server are you using?

Extensions:

dependencies#0 = https://github.com/defold/lua-language-server/releases/download/v0.0.3/release.zip
dependencies#1 = https://github.com/defold/extension-gpgs/archive/refs/tags/3.0.0.zip
dependencies#2 = https://github.com/Dragosha/extension-gamecenter/archive/master.zip
dependencies#3 = https://github.com/defold/extension-websocket/archive/refs/tags/3.1.0.zip
dependencies#4 = https://github.com/heroiclabs/nakama-defold/archive/refs/tags/3.1.0.zip
dependencies#5 = https://github.com/defold/extension-crypt/archive/refs/tags/1.0.2.zip
dependencies#6 = https://github.com/defold/extension-siwa/archive/refs/tags/1.1.2.zip
dependencies#7 = https://github.com/britzl/defold-orthographic/archive/refs/tags/3.2.1.zip
dependencies#8 = https://github.com/britzl/monarch/archive/refs/tags/3.7.0.zip

I’m building for macOS Ventura (testing the game locally), using https://build.defold.com.

1 Like

I cleaned out some stuff on the disc, please try again!

1 Like

Now it runs again, no errors! Thanks!

1 Like

Yes, it will be an extension first and foremost. Having it as an extension gives us the ability to publish something “in progress” that people can start to use and help us out with further development without sacrificing the stability of the mainline Defold project. There are some tooling involved as well as some custom image formats (.HDR) that we don’t want to integrate into the editor environment right now.

After the PBR extension has been published, which is very close, just having a few glitches on linux currently, I want to start building a slightly more advanced 3D rendering pipeline that involves shadows, post-processing, HDR rendering and so on that should give projects a decent quality out of the box.

12 Likes

:star_struck:

As someone who’s dabbled with shadows in particular, this would be nice, and a real timesaver.

4 Likes

I released the game with 1.4.6 beta and it was working flawlessly on my machine (as always) - great job! :heart: Thank you for fixing so much issues!

I once asked in related topic about floating point texture format - how does it help when implementing SSAO, shadows or other such things?

2 Likes

It’s mostly used for g-buffers (writing normals, positions and such) that can be used for deferred rendering, depth textures for shadow mapping, HDR output and environment maps for PBR. Basically any effect that requires higher precision for the inputs

4 Likes

Thanks for fixing that!

3 Likes

In 146 some animation in my project broken. In 145 all worked.
Please look on it.

2 Likes

In 1.4.6 we moved to matching the animation tracks by bone name as opposed to relying on all models having the exact same layout.

In your case, you use two skeletons, which have two separate root bones (Character_Rig.001 and CH_WomanBeach)

When specifying the skeleton on the .model, it will be considered an override (i.e. for animation retargeting), but we haven’t designed that feature yet. E.g. how to “know” which bones to match to another skeleton?

For now, as a workaround, I suggest simply using the same skeleton on the .model as in the animationset. I.e. businessman/idle.dae to make sure the names match between the skeleton and the animation tracks.

In the meantime, I’ll look into a fix for this regression.

4 Likes

Thanks :+1: