Engine Release v1.45.0

Engine v1.45.0 has been released. Release notes:

This release contains the texture changes mentioned in this thread: Texture changes in PlayCanvas

To stay updated on engine development, hit Watch on the repo. Support us by hitting Star too! :smiley:

4 Likes

Hey hey

This release unfortunately broke quite a few of our projects as maksim was afraid of. We often render a layer into a texture, similar to this example Capturing screenshot from camera, which now is also broken.

We do not have a custom shader here in which we can just flip the y coordinate by applying uv.y = 1 - uv.y;. It is also a plain texture which we create, so we canā€™t use the flipY property as the documentation says:

Specifies whether the texture should be flipped in the Y-direction. Only affects textures with a source that is an image, canvas or video element. Does not affect cubemaps, compressed textures or textures set from raw pixel data. Defaults to true.

Can you please help us, how do we fix this issue?

@AliMoe Taking a look at this now

Temporary fix for flipping coordinates using negative scale in the example in question:

@Leonidas As you said, this would be just temporary, but we use this method in a lot of places. Flipping the scale or rotating the plane is therefore not an option.

@yaustar Just for completeness sake, the doc also says that the flipY property defaults to true, while the constructor sets it to false. Donā€™t know if there is anything else that also needs updates in the documentation.

2 Likes

Good shout, we will update that

Hi @AliMoe ,

Iā€™m really sorry this change has impacted your projects, itā€™s definitely something we donā€™t like doing.

In this case itā€™s probably easiest to use the plane materialā€™s offset & tiling as follows:

Hopefully thatā€™ll work for now, but Iā€™ll take a closer at dynamically rendered images and see if we can do anything better there.

Thanks!

1 Like

@slimbuck This unfortunately also doesnā€™t work for us. The way we render a layer in an UI element is like this:

var colorBuffer = new pc.Texture(this.app.graphicsDevice, {
  width: this.targetEntity.element.width,
  height: this.targetEntity.element.height,
  format: pc.PIXELFORMAT_R8_G8_B8_A8,
  autoMipmap: true,
  minFilter: pc.FILTER_LINEAR,
  magFilter: pc.FILTER_LINEAR,
});

var renderTarget = new pc.RenderTarget({
  colorBuffer: colorBuffer,
  depth: true,
});

var layer = this.app.scene.layers.getLayerByName(this.layerName);
layer.renderTarget = renderTarget;

// The UI entity
this.targetEntity.element.texture = layer.renderTarget.colorBuffer;
this.targetEntity.element.color = pc.Color.WHITE;
this.targetEntity.element.opacity = 1;

We are not rendering into the diffusemap of a material, so we canā€™t flip the tiling.

Hello,

It seems DXT textures doesnā€™t have alpha anymore when compressing (not a rendering issue, the file really has a completly ā€œwhiteā€ alpha). Iā€™m not sure if itā€™s directly linked to this release but as it requires a recompression, itā€™s not possible to use DXT anymore.

Hi @Gwendal ,

Can give me access to your project so I can take a look (user slimbuck)?

Alternatively if you can create a small repro so we can take a look at that?

Thanks!

Added you to a simple repro project. Issue is also visible in the editor : left disc is uncompressed (using original PNG), right disc is compressed in DXT.

Another example if you need it @slimbuck https://playcanvas.com/editor/scene/1197283

This has now been fixed. So sorry for the trouble, please recompress your DXTs.

2 Likes

I think font preview is messed upā€¦ :thinking:
image

Hi @AliMoe,

Weā€™re working on a PR where render targets can be flagged with ā€˜flipYā€™, see RTT texture flip flag by slimbuck Ā· Pull Request #3346 Ā· playcanvas/engine Ā· GitHub.

2 Likes

Awesome, looking forward to that PR. Thanks for the quick reply and help :smile:

Can we have a project wide drop down setting which allows us to select older PC versions? It is getting quite annoying to have to fix engine issues every other release and changing the version through the URL is not something that scales well with larger team sizes.

And I think this texture issue was the right thing to do but you guys should think about how you roll out new engine versions.

6 Likes

Added feature request to the repo here: Be able to select older engine versions in the Editor and Launch tab Ā· Issue #467 Ā· playcanvas/editor Ā· GitHub

2 Likes

Hi @AliMoe,

If you have a chance, please could you check that renderTarget.flipY flag works for you?

You can do this by running your app launch page with argument ?use_local_engine=https://code.playcanvas.com/playcanvas-latest.js

And add flipY: true to the render target options constructor parameter.

Thanks!