Can adding Lens Flare Node be considered a GSoC topic?

manas96

New Member
Contributor
I'm talking about this issue which seems to have been dormant since last August. Can I implement a Lens Flare system as part of my GSoC project?
 

manas96

New Member
Contributor
So in order to implement this (referencing @manu3d 's suggestions and google) :
  1. Get a set of lensflare artifact textures in a single Texture Atlas file. The number of artifacts is arbitrary.
  2. Check if any light source is visible in the camera (using OpenGL's occlusion queries) If not occluded by anything, proceed.
  3. Find the 2D coords of the light source on the screen.
  4. Using the light source's 2D coords and the center of screen's 2D coords, we have an axis along which to render the lensflare artifacts. We also know the distance between lightSource and center('D').
axis.png
5. The brightness of each artifact is calculated as being inversely proportional to D.​
6. Assuming number of artifacts in atlas = N.​
To place any arbitrary number of artifacts along the axis, we first scale the lightToCenter vector down by some amount (say 0.2).​
Now starting at the light's position, for each artifact, we keep adding this scaled lightToCenter vector to get the position of the next artifact.​
artifacts.png
Also, to implement this in Terasology where do I start? I have been trying to understand the DAG based rendering system. These have to be rendered before any GUI stuff. I think the addFinalPostProcessingNodes() method of the WorldRendererImpl class might be the place to start.​
I would like to know if I'm on the right track. Thanks.​
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hey there. Not that I'm really qualified to give you a certain answer here but I expect a lens flare node is not GSOC scope on its own, although a rendering-related GSOC item is quite possible, and could probably contain one or more nodes in it. Both on a technical level a single node is probably a bit underwhelming for three months of work, as well as a project prioritization level - would it really help move the project forward substantially to be able to show lens flares thanks to three months of effort, even if they're really cool? :)

Hop on chat to find one of us sometime for a Slack invite, as the #rendering channel there is probably the best place to ask for further details
 

manas96

New Member
Contributor
I should have been more clear in my words. I did indeed mean that LensFlare will be a part of a GSoC project.
 

manu3d

Active Member
Contributor
Architecture
I agree with Cervator's assessment.

In response to your question, you are on the right track in regard to WorldRenderer/WorldRendererImpl being the right place where to start, and in particular the nodes added in addFinalPostProcessingNodes(). Notice that LensFlares should likely go before tone mapping and potentially other nodes, I don't have the chance to check right now.

Welcome aboard!
 
Top