Defold 1.9.4 BETA

I’ll be very happy if you post the result and your screenshots/video in X (twitter) :pray:. Because this is a very cool and long awaited new feature!

2 Likes

1.9.4 no instancing


1.9.4 instancing

140 vs 60 dc.

Something strange with model numbers in profiler. I can add you in project.
Not sure how to make small repro case)

Why model vertexCoint is so big. This is only when enable shadows.
With shadow.


No shadows.

instancing

4 Likes


Look at model VertexCount and VertexSize looks like it show some random number, every new launch?

render.set_render_target(self.shadow.rt, self.shadow.draw_transient)
	render.clear(self.shadow.draw_clear)
	xmath.matrix_mul(self.shadow.draw_shadow_opts.frustum, light_projection, self.shadow.light_transform)
	render.enable_material(HASH_SHADOW)
	render.set_cull_face(graphics.FACE_TYPE_FRONT)
	render.draw(self.shadow.pred_front_culling, self.shadow.draw_shadow_opts)
	--render.draw(self.shadow.pred_flipped, self.shadow.draw_shadow_opts)
	render.set_cull_face(graphics.FACE_TYPE_BACK)
	render.draw(self.shadow.pred, self.shadow.draw_shadow_opts)
	render.disable_material()
	render.enable_material(HASH_SHADOW_BONES)
	render.draw(self.shadow.pred_bones, self.shadow.draw_shadow_opts)
	render.disable_material()

	render.set_cull_face(graphics.FACE_TYPE_BACK)
	render.set_render_target(render.RENDER_TARGET_DEFAULT)

Can we see some information about instancing in profiler?
Something like
Instancing
batches:10
models:100

Sorry, it was fixed)
Was WORLD space in shadow material.
Change to LOCAL now it worked:)

4 Likes

I’m confused, is something not working?

Sorry, no, all worked now)
It was my error. I was use WORLD space not LOCAL space in shadow.material

2 Likes

Phew, good!

1 Like

What about this feature request? @jhonny.goransson

1 Like

Open a ticket and we’ll take a look!

1 Like

Do you change something for windows? app window?
In defold 1.9.3
defos changed window size.
In defold 1.9.4
defos not change window size.
Also mnu extension show on strange position.

void defos_set_view_size(float x, float y, float w, float h)
{
    HWND window = dmGraphics::GetNativeWindowsHWND();

    if (isnan(x) || isnan(y))
    {
        HMONITOR hMonitor = MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST);
        MONITORINFO monitorInfo;
        monitorInfo.cbSize = sizeof(monitorInfo);
        GetMonitorInfo(hMonitor, &monitorInfo);
        if (isnan(x)) { x = (monitorInfo.rcMonitor.left + monitorInfo.rcMonitor.right - w) / 2; }
        if (isnan(y)) { y = (monitorInfo.rcMonitor.top + monitorInfo.rcMonitor.bottom - h) / 2; }
    }

    RECT rect = {0, 0, (int)w, (int)h};

    DWORD style = (DWORD)get_window_style();

    // TODO: we are assuming the window have no menu, maybe it is better to expose it as parameter later
    AdjustWindowRect(&rect, style, false);

    SetWindowPos(window, window, (int)x, (int)y, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);
}

Not that I’m aware of no, scrolled through the change list and there isn’t anything specific that caught my attention

This line throw error in debug bundle

go.property("data_texture", resource.texture("/builtins/assets/images/logo/logo_256.png"))
ERROR:SCRIPT: main/main.script:1: attempt to call field 'texture' (a nil value)
3 Likes

Getting warning about texture sampler and no texture being displayed while using #version 140 pipeline. The textures are displayed in the editor but not in builds.

WARNING:GAMESYS: Material /assets/material/grid.materialc has specified a sampler named ‘texture_sampler’, but it does not exist or isn’t used in any of the shaders.

Even though the material/shader does use the sampler.

The model also provides the texture.

the fragment program

#version 140

uniform sampler2D texture_sampler;
in vec2 var_texcoord0;
out vec4 color_out;

void main()
{
    vec4 color = texture(texture_sampler, var_texcoord0.xy); // Unlit
    color_out = vec4(color);
}

materials/shader work in 1.9.3

1 Like

The introduction of instancing has changed the… I don’t know how to explain it - even with ‘vertex space = local’ vertices are passed to the shader pre-transformed, as if the material is set to ‘vertex space = world’? All materials work differently in version 1.9.4 (96649a0) where I change the vertex position in the vertex shader, i.e. they are displayed incorrectly.

For example like this:

vec3 offset = vec3(1.0, 0.0, 0.0);
vec4 p = mtx_worldview * vec4(position.xyz + offset, 1.0);

Test project - test_model_pos.zip (8.8 KB)

1.9.3 and older

1.9.4 (96649a0)

6 Likes

Thank you!
I’ve fixed this issue. New build will be available in ~1h

2 Likes

Would you mind sharing the project?

Yeah, I noticed too that in the beta version, the vertex position shifting in the vertex shader stopped working. I had them ‘moving’ the grass in the wind.

1 Like

Sure thing I recreated the issue in a basic3d project.
OS: win10
Editor : 5dd6a5300ccde0b7c7d60f254ff564dab6ddc924
Engine : 5dd6a5300ccde0b7c7d60f254ff564dab6ddc924

Opening the main collection you can see the basic unlit shader applied to the cube is showing in the editor.

When you build the project you get the warning and the shader does not display any texture.

Repro:
sampler_test_194.zip (10.2 KB)

2 Likes