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!
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!
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
@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.
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!
@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.
I think font preview is messed upā¦
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.
Awesome, looking forward to that PR. Thanks for the quick reply and help
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.
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
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!