playcanvas / playcanvas-sync

Real-time synchronization of files between PlayCanvas and your local machine
https://playcanvas.com/
MIT License
75 stars 18 forks source link

Textures are converted to power of two, even with Texture POT disabled #56

Closed mathiassoeholm closed 1 year ago

mathiassoeholm commented 2 years ago

After pushing an image with pcsync pushAll -e png, it appears as resized to a power of two inside PlayCanvas. This happens even though I have disabled the "Texture POT" option:

image

It appears that the Texture import settings are just not taken into account when using pcsync?

mathiassoeholm commented 2 years ago

This appears to be a bug in the assets API, I tried recreating the request made by pcsync and the same thing happens:

> POST /api/assets HTTP/2
> Host: playcanvas.com
> user-agent: insomnia/2022.6.0
> content-type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
> authorization: Bearer *********************************
> accept: */*
> content-length: 9100
mathiassoeholm commented 1 year ago

@yaustar Thanks for moving this issue to the correct place. Is there any update on this? :-)

yaustar commented 1 year ago

I've added this to our bug blitz and it will be prioritised against what we have on the list already. Beyond that, I don't have an update on this

Not entirely sure if this is a REST API issue or pc-sync one

mathiassoeholm commented 1 year ago

@yaustar Sounds good, thanks for the update.

It must be a REST API issue, because I was able to reproduce it without using pc-sync, but just making a raw HTTP Post call.

yaustar commented 1 year ago

Had a quick look and its the pc-sync issue where I believe the default value for pow is true.

When you upload a texture in the Editor, we can see the playload for the PUT request explicitly set pow to false

image

I will move this back 😅

yaustar commented 1 year ago

In terms on how to handle this, we could create an extra config variable for pow2 and pass that in with binary operations for updating assets. That probably would be enough

mathiassoeholm commented 1 year ago

@yaustar oh, interesting! :-)

A pow2 config variable would definitely work for us!