Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Discussion Create a WebGL Client?

Discussion in 'Web' started by chibiskuld2, Apr 3, 2024.

  1. chibiskuld2

    chibiskuld2

    Joined:
    Nov 11, 2022
    Posts:
    11
    Building to WebGL is working great.
    In fact I recently created this:
    https://skuld.moe/graffiti/
    And it's really neat and fun.

    But this has gotten me recently thinking about a few things, and I came across a major question (Or maybe an idea)
    Is it possible to create a WebGL client in Unity?

    As in I want to make a Windows/Linux app that isn't a web browser, but also isn't specific built to a single WebGL application.
    But instead it can take in a link to an existing WebGL app, and let the new application render it.

    Is this possible? What would be needed to be done to make it possible?
     
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,978
    well in strandard c# you can make an app that is a window with a webbrowser filling it, and have it launch the url.. but...
     
  3. chibiskuld2

    chibiskuld2

    Joined:
    Nov 11, 2022
    Posts:
    11
    Yeah, it would have to be able to not render other web content, just Web GL apps.
     
  4. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,978
    well if you dont let them access the browser, and its fixed to your url, how would they?
     
  5. chibiskuld2

    chibiskuld2

    Joined:
    Nov 11, 2022
    Posts:
    11
    I think you missed the point of what I would like to do.

    Let's put this in a user story for you to better understand.
    • User opens client built with Unity.
    • User puts in a URL for a WebGL application.
    • If valid WebGL Application:
      • WebGL application launches in client, similar behavior to an asset bundle, but a whole application in WebGL.
        • This can not use asset bundles due to the multi-scene behavior and also because asset bundles are platform dependent.
    • If invalid WebGL Application:
      • Reject load of URL, alert user URL is invalid, and continue in current state of client.
     
  6. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,978
    No, you can, but you'd need to download the link and check the contents and then reject it if its not webgl.. but you can do that.. I assumed you wanted to do it for YOUR webgl stuff not everybodys but, you could.. you can do anything pretty much in programming if you you're prepared to work it out
     
  7. chibiskuld2

    chibiskuld2

    Joined:
    Nov 11, 2022
    Posts:
    11
    Can you please review more carefully how you're responding?
    It feels you are replying with an idea you're pushing, "Use C# to do it", and now replying as if I'm arguing with you and replying to things not even said at this point.
     
  8. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,978
    No, I offered a potential solution, you were unclear on your requirements. I adjusted my explanation to accommodate the new information, after you told me i missed the point of information you didnt originally provide. If anything, if you read this as an outside, you could argue you're the one attacking me. So, it works both ways.. If you work in unity c# is a fairly safe assumption, but you can use any language you like.. Delphi would do a fine job too..

    If you dont want suggestions.. why did you ask?
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,488
    if you want to run webgl inside standalone application, it needs to have embedded browser,
    then everything just works (if the embedded browser supports webgl2.0+scripting and all that).

    at which point its probably easier to not use unity to make that client,
    or at least those browser plugins are often expensive in asset store, especially if regular electron or other native browser based app could work with iframe or url..
     
  10. chibiskuld2

    chibiskuld2

    Joined:
    Nov 11, 2022
    Posts:
    11
    The reason I would want this to be in Unity, if possible, is in hopes to load the application as if it were an asset bundle. Then I can work with objects in a more direct manner. I don't want to go to much into detail of what I need this for. But I will say there is a need to directly manipulate the objects, and create my own within the WebGL application.

    I understand the notion to make it not Unity, but my REQUIREMENT is to be able create a seamless connection between my Unity objects, rendering, etc. with the applications.

    Anyways,
    But okay, there may be a few plugins available. Unity itself doesn't expose anything to do this. Got it.
    Perhaps there may be a way to wrap it with an html renderer in some way.
     
    Last edited: Apr 6, 2024
  11. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,978
    well webgl kinda requires a web renderer to work, respecting your desire not to share, have you considered a form of websocks, or gaming connection between, after all you can issue commands from one to another using that effect.
     
  12. chibiskuld2

    chibiskuld2

    Joined:
    Nov 11, 2022
    Posts:
    11
    That is a reasonable thing to consider. Or as I would put it, constructing an API between the apps and the client. I was hoping something already in place for this, but at least this is all reasonable ways forward on the idea.