r/GraphicsProgramming • • 23d ago

Rendering with a light simulation 2.0

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

280 Upvotes

27 comments sorted by

20

u/Many_Difficulty_490 23d ago

how hard is it to go from triangle to this?

9

u/mooonlightoctopus 23d ago edited 23d ago

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

-1

u/Many_Difficulty_490 23d ago

r u being sarcastic?

8

u/mooonlightoctopus 22d ago

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

1

u/Le_9k_Redditor 22d 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

17

u/speps 22d ago

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

4

u/yaboiaseed 22d 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.

20

u/thedamn4u 23d ago

Are the balls supposed to be partially transparent?

10

u/mooonlightoctopus 22d 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.

1

u/maverickPixel 20d ago

it kind of looks like the thickness of the ball if its double walled

7

u/Accomplished-Day9321 23d ago

google poissons dot

6

u/ykafia 22d ago

Poissons spots shouldn't be that big though

6

u/elektroedde 22d ago

Holy hell

3

u/Narrow_Awareness2830 22d ago

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

3

u/mooonlightoctopus 22d ago

Well, it was made in Unity.

2

u/mrpressydepress 22d ago

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

15

u/mooonlightoctopus 22d 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.

7

u/Quad46 22d ago

How people under shrooms see the world

6

u/picketup 22d ago

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

5

u/Dictator93 22d ago

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

3

u/lovelacedeconstruct 22d ago

Looks like 2006 youtube

2

u/HasGreatVocabulary 22d ago edited 22d 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 22d ago

Realtime wave tracing

1

u/obetu5432 21d ago

me when i forget my glasses:

1

u/Past_Ad_8145 6d ago

it's SOOOOO viby~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-6

u/East_Ad_5801 22d ago

Why does it look bad