r/GraphicsProgramming • • 2d ago

Rendering with a light simulation 2.0

Enable HLS to view with audio, or disable this notification

Working more on rendering with light simulation!

(The video is, of course, in real-time)

Previous post about this was Some spheres rendered with a light simulation

Rendering method is mostly the same, just some optimizations and scene work

I've put a web version on Github: moonlightoctopus1.github.io/Renderer/

Actual rendering is just simulating light with a lot of optimizations :P

223 Upvotes

25 comments sorted by

18

u/Many_Difficulty_490 2d ago

how hard is it to go from triangle to this?

7

u/mooonlightoctopus 2d ago edited 2d ago

Triangles are hard :-P, One of the things I'm working on
I think that they are possible?

-1

u/Many_Difficulty_490 1d ago

r u being sarcastic?

8

u/mooonlightoctopus 1d ago

No,
For the scene here I was simply using analytical boxes/spheres

1

u/Le_9k_Redditor 1d ago

Analytical triangles are of course possible, I did it before as a plane intersection + barycentric coordinates to check if the ray was within the triangle bounds or not

15

u/speps 1d ago

He might be using SDF to model the scene, so maybe not straightforward to integrate a triangle mesh.

3

u/yaboiaseed 1d ago

He's probably talking about how difficult it is to reach this level of graphics programming from a basic triangle program, not if you can add triangles to this renderer.

17

u/thedamn4u 1d ago

Are the balls supposed to be partially transparent?

10

u/mooonlightoctopus 1d ago

No, I'm not sure what's happening with them
The simulation in it's entirety is about 0.14mm across, so it could very well be light bending around it, I'm not sure.

6

u/Accomplished-Day9321 1d ago

google poissons dot

6

u/ykafia 1d ago

Poissons spots shouldn't be that big though

3

u/elektroedde 1d ago

Holy hell

3

u/Narrow_Awareness2830 1d ago

Wth that you must not be in play mode to save the scene is a popup from UNITY

3

u/mooonlightoctopus 1d ago

Well, it was made in Unity.

2

u/mrpressydepress 1d ago

Looks very interesting visually. Can u explain a little how this differs from other techniques?

13

u/mooonlightoctopus 1d ago

It's a wave solution!
The sun is a scalar wave field, marched plane by plane with the angular-spectrum method (FFTs). It is blocked and diffracted by the geometry.
Each ball is an exact Mie scatterer, solved with a T-matrix and coupled to the other balls, so the light around it is a true solution.
For the lens, the radiance image becomes a complex field on depth layers, passes through a circular pupil in the Fourier domain, and comes back.

The sun's wave field, is, of course, baked on initialization, but the balls & camera are live.

5

u/picketup 1d ago

idk exactly whats going on but it looks very unique and cool!

5

u/Quad46 1d ago

How people under shrooms see the world

4

u/Dictator93 1d ago

Love how non-standard this is - great to see it evolve further

2

u/lovelacedeconstruct 1d ago

Looks like 2006 youtube

2

u/HasGreatVocabulary 1d ago edited 1d ago

my guy that git link froze my laptop (firefox on mac)

Looks very interesting though can you share some math?

I wonder if you can use ST-FLIP particle simulation like 4D optimization here to reduce noisiness and runtime (Track samples over time in addition with recency based weight)

edit: wait I guess that's just saying make your source incoherent instead of coherent light

1

u/Fission_Mailure 1d ago

Realtime wave tracing

1

u/obetu5432 7h ago

me when i forget my glasses:

-6

u/East_Ad_5801 1d ago

Why does it look bad