Hosting assets on the Playground server

Hello :slight_smile:

As many others on the forum, I try to be active on helping people on the Questions category. Something I miss at least once a week, is the ability to quickly upload a light asset : .PNG for a material issue, .GLB for an asset issue, etc…

A few reasons why I would love this feature :

  • Ability to quickly upload a fix of an asset, for example when the issue comes from a bad .glb on the server of the guy asking help.
  • If someone uses a free hosting website, it’s never “forever”. There is nothing more frustrating than a forum where some images are 404 because too old (fortunately, this Discourse hosts images forever !)
  • It often happens that people don’t set up their CORS policies, ending up with Playground unable to load assets directly from their server.
  • When really in need of being able to share a light asset, I use to convert it in Base64 and insert it as text in the Playground, like I did recently here for @Buugeed . But I would like to avoid doing this because :
    • I don’t like feeding a PG with a 10 km wide line
    • If the user is a beginner he might get confused compared to a more convenient URL
    • The user cannot directly download the asset if needed… He would have to copy the base64 text and convert it back to binary, which is not obvious for everyone.

About the way I see this feature being added in the future :

  • Could be an upload button on top bar :
  • It would be accessible with an URL such as :
    https://playground.babylonjs.com/assets/1G5TY6Z/test.glb
    Which means from the PG it self, assets/1G5TY6Z/test.glb would be ok.
    The asset ID would ensure uniqueness of the asset, while still letting ability to keep the filename and extension.
  • For budget / storage reasons, this feature could be limited to 5MB for example (like the assets uploaded on the forum by the way).

I’m pretty sure most of us would do great usage of such new feature ! :slight_smile:

++
Tricotou

2 Likes

I believe the Team has recently started evaluating possible improvements for the PG. I kind of recall this post:

May be something that could be added to the overal thinking?

1 Like

This is not that simple. It will require some form of identification from the user, and will require us to allocate space for every user. It also puts us in a position where we must check for assets being served by us for copyright infringements and fair usage. NSFW assets also come to mind. Bandwidth abuse would also be an issue.
It is simple to implement, but not simple to maintain.

What i can offer as a temp solution is the ability to connect to your own file hosting server. For example, allow a connection to onedrive or dropbox, that will allow you to easily upload assets and pull them for your own playground. Of course any solution has its own caveats.

@RaananW I understand. :frowning: .

  • bandwidth abuses
  • Copyrights Violations
  • NSFW stuffs
  • etc…

Are exactly the reason why I restraint myself from doing so many funny projects I have in mind (Using BJS, or other, webservers, and ability to upload whatever)… Everything would be so much easier in a world where everyone is nice and clean ! ^^


What about hosting here on the BJS Forum ?
For now it’s already ok to upload images, and zip files. Maybe it’s up to the configuration of the Discourse server to allow other extensions (for example : .glb)

Then, it would be up to us to insert the right file in the post, along with the Playground.
I just gave it a test in this Playground, using the screenshot I edited above… It works :slight_smile: (CORS policies are already ok :heavy_check_mark: )

That would be abusing our agreement with the form host :slight_smile:
I mean - if you as a user manages to do that - more power for you, but we would not add an API to do that.

Ah yeah, I was writting while having the idea to be honest ^^ I had no API in mind on the PG side, I was just thinking, maybe just authorizing the .glb files here on the forum would be enough.


Test : here is a .glb renamed as .zip :arrow_right: hover.zip (681.9 KB)
The upload actually works, but sadly, I cannot load it as a .glb in this Playground due to CORS policies … Quite strange by the way, the fact that images are given with the right CORS, but not the files… :thinking: