Nebula-Developer / Yoru-Engine

🌃 C# Game/Application Framework
MIT License
4 stars 0 forks source link

LightMaps #19

Open Bradleyp123 opened 1 month ago

Bradleyp123 commented 1 month ago

Since Yoru Engine has a focus on Cross platform compatibility and performance. Personally i like Radiosity, Radiosity offers Realistic shadows and light bounces, Normally it is pre computed during a maps compile process (back in the days of Source and Quake). These engines used BSP but unfortunately BSP isn't vary modern and im guessing your going to use a more modern and accessible platform. For reference Here's a small game engine that uses Radiosity lightmapping: https://www.cafu.de/ lighting1

Here's a photo of Source engine of what also uses radiosity lightmaps: AcerNito_DirectX9_hl2 exe

Radiosity has issues with compile times (on my custom version of source has a decade long lightmap compile time) but you can use CUDA to accelerate this (https://github.com/darthryking/SilkRAD). Its due to how it is calculated on CPU, and how you have to devide the map into patches of whom become luxels (lightmap texture).

There is also a real-time implementation of radiosity. https://www.youtube.com/watch?v=0-0aMo_qkGo

But these are things to be done wayyyy in the future.

Nebula-Developer commented 1 month ago

Because radiosity is a technique primarily used in 3D graphics, (and in a context where we have more control over the rendering), it wouldn't necessarily apply directly to Yoru Engine. I do plan to introduce a more global SKShader context to all elements being drawn (or to have certain elements extend from perhaps a LitElement or ShaderElement class) so we have more control over rendering through the use of the Skia shading language (SkSL). If we pass relevant values from the element to a shader, along with values from an ApplicationContext (eg. LightingContext) we could potentially begin to work with the likes of lighting or other effects.