Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flame 3D] Create more distinct types of light source #3294

Open
1 task
danielAsaboro opened this issue Sep 2, 2024 · 3 comments
Open
1 task

[Flame 3D] Create more distinct types of light source #3294

danielAsaboro opened this issue Sep 2, 2024 · 3 comments

Comments

@danielAsaboro
Copy link

danielAsaboro commented Sep 2, 2024

What could be improved

More Details for Point Light and Further Breakdown of Ambient Light

Points should be visualized by a plain, circled dot.
But they should have a radius parameter, such that when the radius is larger than zero,
light will be emitted from a spherical surfaces with the specified radius.

Also, Lights with larger size should have softer shadows and specular highlights.

Why should this be improved

I've just watched Luan's Presentation on Flutter and Friends, 2024 and one part that stood to me is Light Sources.

I think it's very important, because Lights have significant importance on how things are rendered on screen.
So we will need more distinct types of lights for better rendering accuracy, and a few new addtions;

  • Spot Light
  • Area Light
  • Sun Light

Spot Light

A Spot light should emit a cone-shaped beam of light from the tip of the cone, in a given direction.

spot shape and spotlights

It's constructor should have parameters like:

  1. Power [in watts]
  2. Radius
  3. Size in degree/radian
  4. Clip Start
  5. Blend

Area Light

Area light simulates light originating from a surface (or surface-like) emitter.
For example, a TV screen, office neon lights, a window, or a cloudy sky are just a few types of area light.

It's constructor should have parameters like:

  1. Power [ in watts]
  2. Shape [Rectangle, Circle, Star, Ellipse etc]
  3. Size [Bounding Box for the Shape]

Sun Light

A sun light provides light of constant intensity emitted in a single direction from infinitely far away.
A sun light can be very handy for a uniform clear daylight open-space illumination.

It's similar to the Ambient Light Luan described in his talks.
But i believe there are quite some distinction;

Risks

I'm just an intern, or at best a Junior so I can't state with great accuracy the technical difficulty involved or risks;
But one thing i can say it will change some API. Luckily the work on Flame 3D has just begun so not a big change like that;

More information

For more info, please visit blender reference for light soure

Other

  • Are you interested in working on a PR for this?
@TheMaverickProgrammer
Copy link
Contributor

The number and quality of lights varies greatly between rendering pipelines. Which rendering pipeline does Flame3D use? e.g. forward rendering/deferred rendering/tiled rendering/etc.

@luanpotter
Copy link
Member

Thanks for this breakdown @danielAsaboro !

I definitely went for an "MVP / baby-steps" approach at first, and just implemented two basic types of lights (ambient and point). They already allow for some basic use cases, but I definitely agree we should implement the other types. This is an interesting area I am not currently heavily working on, so PRs and contributions would definitely be welcome! The only thing to call out is that we currently do not support binding arrays to the shader (neither SSBO nor fixed arrays). See this and this PRs for details. So ideally we can get those working nicely first.

As for the rendering method, @TheMaverickProgrammer , we use simple forward rendering. This is so far a very barebones and embryonic implementation. We do not support more advanced things like deferred rendering, shadows, occlusion, etc. Those are harder topics to tackle but def open to discuss as well if you guys are interested in contributing :)

@TheMaverickProgrammer
Copy link
Contributor

@luanpotter Deferred rendering can be done in screenspace. Flame3D will just need 2+ renderbuffers to write and sample from. It's doable with a barebones forward renderer as a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants