Skip to content

Ultralig.ht integration for the Stride (stride3d.net) game engine

License

Notifications You must be signed in to change notification settings

lionfire/LionFire.Stride.Ultralight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LionFire.Stride.Ultralight (with Blazor Server)

I have .NET 5.0 + Blazor Server + Ultralig.ht working as a proof of concept inside Stride (stride3d.net) game engine on Windows. This repo doesn't have a complete working example (feel free to create one) but contains some key files and this README refers you to more detailed info.

Working:

  • Transparency
  • Mouse clicks (left-click only)
  • Toggle the ultralight browser visibility on/off with F10 key (perhaps useful for a debug UI)
  • Auto-reload via Livesharp (not a free product), a bit crude

Partially working:

  • colors in Ultralight are a little bit off. I'm not sure how perfect of a match to expect.
  • Keyboard input

TODO:

  • Pass through clicks on transparent areas of the browser window to the 3D world
  • GPU renderer for ultralight -- is this possible?
  • Scroll input
  • Middle and right mouse clicks: it looks like these will require changes to Stride's input code, which currently only passes left clicks up to the Stride UI's ImageElement touch events.
  • Require a cookie / auth token to be sent via HTTP when talking to Blazor Server, so that only the Stride Game process can talk to its in-process web server.

Screenshot

screenshot

Stride + Ultralig.ht integration

Based off of this repo -- refer to it for instructions: https://github.com/makotech222/Ultralight-Stride3d_Integration

Here's my customized C# file that supports Microsoft.Extensions.Logging and Mouse/Keyboard Input: UltralightUIScript.cs

More up to date version lives here: UltralightUIScript.cs

Stride UI fix

By default, as of now, Stride's postproessing effects are applied to the UI, which makes it look bad. Refer to here for the full scoop: https://github.com/herocrab/StrideCleanUI

In short:

  1. Set UI to render to group 31
  2. Rework your compositor (I included my compositor asset FWIW: GraphicsCompositor.sdgfxcomp)

Hosting ASP.NET Core (Blazor Server) alongside Stride

See StrideGameService.cs

  1. Create an ASP.NET Core application (.NET 5.0)
  2. In your ConfigureServices(IServicesCollection services) method, do services.AddHostedService<StrideGameService>();

A more up to date copy of StrideGameService.cs may be here: https://github.com/lionfire/Core/blob/master/src/LionFire.Hosting.Stride/StrideGameService.cs

Blazor object inspector

The razor component for the fledgling .NET object inspector/explorer I created can be found here:

https://github.com/lionfire/Core/blob/master/src/LionFire.Blazor.Components.MudBlazor/ObjectExplorer.razor

Stride keyboard mapping

See StrideKeyConversion.cs

About

Ultralig.ht integration for the Stride (stride3d.net) game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages