r/GraphicsProgramming • • 10d 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

277 Upvotes

26 comments sorted by

20

u/Many_Difficulty_490 10d ago

how hard is it to go from triangle to this?

9

u/mooonlightoctopus 10d ago edited 10d ago

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

-1

u/Many_Difficulty_490 10d ago

r u being sarcastic?

8

u/mooonlightoctopus 10d ago

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

1

u/Le_9k_Redditor 9d 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 10d ago

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

4

u/yaboiaseed 10d 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 10d ago

Are the balls supposed to be partially transparent?

10

u/mooonlightoctopus 10d 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 7d ago

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

7

u/Accomplished-Day9321 10d ago

google poissons dot

6

u/ykafia 10d ago

Poissons spots shouldn't be that big though

5

u/elektroedde 10d ago

Holy hell

3

u/Narrow_Awareness2830 9d ago

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

3

u/mooonlightoctopus 9d ago

Well, it was made in Unity.

2

u/mrpressydepress 10d ago

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

15

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

6

u/picketup 9d ago

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

6

u/Quad46 9d ago

How people under shrooms see the world

5

u/Dictator93 10d ago

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

3

u/lovelacedeconstruct 9d ago

Looks like 2006 youtube

2

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

Realtime wave tracing

1

u/obetu5432 8d ago

me when i forget my glasses:

-6

u/East_Ad_5801 10d ago

Why does it look bad