Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Embedding
#7
Took a little break from Python, and switched over to something else I had been curious about. I wanted to know if Tilengine could be profitably integrated into Unity, as an alternative rendering engine to Unity's standard implementation. I'm not really interested in replacing Unity's default rendering, so much as using Tilengine to supplement it with a more authentic version of 2D rendering.

Initial experiments seem good. I was able to feed the Tilengine.dll and SDL2.dll into a standard Unity project as native plugins. I was also able to properly import and reference the Tilengine.cs bindings. Then I cooked up a quick-and-dirty script to reference and initialize the Tilengine Engine object. Worked like a charm, and even ran in the editor preview window with no errors. Of course, that's just the most basic set-up. The real challenge is going to be binding the Tilengine reference to a pixel array. That isn't going to be quite as easy in Unity as it was in PyGame. (where one of the fundamental structures had exactly what I needed) My plan at the moment is to create a RenderTexture in the Unity editor, add a link to it in my script, and use that as a target for both initializing Tilengine, as well as binding it to the pixels for the RenderTexture.

I was a little disappointed to see that the Engine initializer is a singleton instance. Since you can't construct multiple instances of the Engine, it will most likely be impossible to have multiple Engines running within Unity. One of the niftier applications of this experiment would be to have populated RenderTextures that could be used as the texture for a television screen in a 3D game. The 2D focus and low-level performance of Tilengine would probably make for a tighter version than trying to emulate such an effect using Unity's standard implementation of faux-2D 3D sprites and a separate camera. It can still be done, certainly. But you can likely only do it one screen at a time, and wouldn't be able to render multiple different screens in the same scene. A minor limitation that won't effect most people, but still something to think about.
Reply


Messages In This Thread
Basic Embedding - by Richard Kain - 09-08-2018, 09:46 AM
RE: Basic Embedding - by Domarius - 09-08-2018, 11:31 PM
RE: Basic Embedding - by Richard Kain - 09-11-2018, 05:43 AM
RE: Basic Embedding - by megamarc - 09-11-2018, 07:19 AM
RE: Basic Embedding - by Richard Kain - 09-11-2018, 08:52 AM
RE: Basic Embedding - by megamarc - 09-13-2018, 06:22 AM
RE: Basic Embedding - by Richard Kain - 10-18-2018, 06:45 AM
RE: Basic Embedding - by megamarc - 10-18-2018, 11:34 PM
RE: Basic Embedding - by Richard Kain - 10-23-2018, 03:49 PM
RE: Basic Embedding - by megamarc - 10-24-2018, 05:17 PM
RE: Basic Embedding - by Richard Kain - 01-15-2019, 03:37 PM
RE: Basic Embedding - by megamarc - 01-22-2019, 02:58 AM
RE: Basic Embedding - by Richard Kain - 04-18-2019, 01:54 AM
RE: Basic Embedding - by megamarc - 04-18-2019, 07:26 PM
RE: Basic Embedding - by Richard Kain - 04-19-2019, 02:52 AM
RE: Basic Embedding - by megamarc - 04-19-2019, 05:39 PM
RE: Basic Embedding - by Richard Kain - 04-20-2019, 06:56 AM
RE: Basic Embedding - by megamarc - 04-23-2019, 07:20 PM
RE: Basic Embedding - by Richard Kain - 05-01-2019, 05:23 PM
RE: Basic Embedding - by megamarc - 05-01-2019, 09:26 PM
RE: Basic Embedding - by Richard Kain - 10-11-2019, 06:09 AM
RE: Basic Embedding - by megamarc - 10-14-2019, 08:31 PM
RE: Basic Embedding - by Richard Kain - 11-05-2019, 03:39 AM
RE: Basic Embedding - by Richard Kain - 11-05-2019, 04:46 AM
RE: Basic Embedding - by megamarc - 11-06-2019, 05:16 AM
RE: Basic Embedding - by Richard Kain - 11-06-2019, 06:08 AM
RE: Basic Embedding - by Richard Kain - 11-08-2019, 02:38 AM
RE: Basic Embedding - by megamarc - 11-09-2019, 02:27 AM
RE: Basic Embedding - by RootBeerKing - 11-10-2019, 10:54 PM
RE: Basic Embedding - by megamarc - 11-11-2019, 06:01 PM
RE: Basic Embedding - by RootBeerKing - 11-11-2019, 07:53 PM
RE: Basic Embedding - by megamarc - 11-12-2019, 02:18 AM
RE: Basic Embedding - by Richard Kain - 11-12-2019, 04:06 PM
RE: Basic Embedding - by RootBeerKing - 11-13-2019, 05:42 AM
RE: Basic Embedding - by Richard Kain - 11-13-2019, 05:36 AM
RE: Basic Embedding - by megamarc - 11-13-2019, 08:25 AM
RE: Basic Embedding - by RootBeerKing - 11-13-2019, 08:42 AM
RE: Basic Embedding - by megamarc - 11-13-2019, 06:08 PM
RE: Basic Embedding - by Richard Kain - 11-14-2019, 04:53 AM
RE: Basic Embedding - by Richard Kain - 11-14-2019, 08:30 AM
RE: Basic Embedding - by megamarc - 11-28-2019, 12:04 AM
RE: Basic Embedding - by megamarc - 12-05-2019, 08:22 PM
RE: Basic Embedding - by adreajessica - 11-25-2021, 02:42 PM
RE: Basic Embedding - by Richard Kain - 01-22-2022, 06:00 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)