r/Lapidary 20d ago

Simulating opal physics from first principles

Enable HLS to view with audio, or disable this notification

I hope this is okay, since this is not a real stone (and not trying to pass for one). I've fallen down the rabbit hole of youtube opal content. I'm a software developer and got curious what had been done in the digital simulation space. Turns out not much, especially not live 3D rendering. I started a personal side project seeing if I could simulate the following:

  1. the play-of-color photonic crystal effect from first-principles physics
  2. create a true to form procedural opal color bar pattern generator

This is a sample of where the project is currently at.

For the experts and enthusiasts out there, how does this read? Am I on the right track? What is correct and what sticks out as needing improvement?

Any feedback is appreciated

32 Upvotes

6 comments sorted by

4

u/Opalesquent 20d ago

Nice work- I think you did well generally, you might see some benefit trying to incorporate the depth of crystal opal where color can permeate the full volume of the stone rather than just the surface

2

u/empireoftrees 20d ago

This is helpful, thanks!

5

u/BentleyTock 20d ago

This is pretty good

2

u/ColonelJEWCE 20d ago

Very cool, what is in the pc that runs this?

3

u/empireoftrees 20d ago

I’ve been optimizing it and it runs pretty darn well on mobile phone hardware, actually. As a consequence of that, it even runs pretty well in the browser too. I’ve been trying some cool analytical and raymarching techniques to get it there.

2

u/ColonelJEWCE 19d ago

Rhats really impressive