There are two places in the game I would like to use this:
B: I want to generate a simple ui on the virtual screens inside the cockpit of a airplane. Just some simpel slow changing ui. So if would be nice if I could generate a texture that can be used for the virtual displays inside the cockpit.
Example project: https://playcanvas.com/project/1025160
There are multiple ways of doing this including:
- Doing it all in PlayCanvas and rendering it to a render texture and then using that texture for the UI element or material texture
- Rendering the UI in a Canvas DOM element and using that as a source for the texture and then using that texture for the UI element or material texture
- Doing it all with PlayCanvas UI elements
Oh, just realised that qrious is GPL license which is copyleft
Meaning that the whole game need to be open sourced?
Can we do the same with this one?
Created a new project with a library that is MIT licensed: https://playcanvas.com/editor/project/1025199
Wow, thx a lot!
I’m getting more and more experienced with PlayCanvas, but stuff that involves the DOM is a bridge to far for me now. I will study it and learn
About the ui-texture options, I think this one is the most suitable:
(Which is another reason to learn more about the DOM interaction!)
Can this rendering in a Canvas DOM be done outside PlayCanvas? Does it need to be the same webpage? Or could it be a complete different webpage (but same machine)?
What do you mean by outside PlayCanvas? The TLDR is that as long as PlayCanvas can access the Canvas DOM element, it’s usable for a texture source.
But I think we will start with the easy way: all using the same DOM. And see how far we come.
That’s where it comes down to what the browser can support. If you can find a way to generate it on a separate worker thread and have the texture source set to that canvas, then that’s great. PlayCanvas isn’t stopping you from doing so.
We’ve had some users use a server to generate the images so that the frontend app can load it at runtime via an API on the server.
That’s also an interesting idea. I’ll start with the simple solution first. I think there are plenty of opportunities for improvement.