I don't remember the first time that I saw scanning electron microscope images of opal - it's fascinating. The microscopic structure consists a lot of little silica spheres, essentially grid packed glass spheres. Precious opal has them in these very structured, crystalline lattices, and opalized glass is a little different, more random. You can see what that looks like, below. Precious opal has some very interesting rainbow behavior, referred to as "fire". There's some very complex optical behavior here - it involves the constructive and destructive interference of various different frequencies of light, Beer's law, and deep reflection and refraction ( the Tyndall effect ). My implementation, which you can see the current state of above ( click through for high res ), really only models the Tyndall effect component. It appears to be doing something spectral, the slight internal blue milkiness/glow, due to the distribution of colors in the the sky model.
I was inspired to explore this microstructure in a discussion with a friend I became acquainted with through the Inércia 2023 Demoparty. They have an article, where they talk about brute force modelling microfacet diffuse materials by densely packing reflective spheres inside of SDF geometry. I think it's an incredibly cool approach, they also have one about doing a similar approach on individual fibers in fabric.
Siren supports explicit ray-sphere intersections, for refractive materials ( other explicit ray-primitive intersectors, as well, but I have avoided doing this with raymarch primitives to avoid added complexity ). I used some very similar logic to the early sphere packing experiments, where I iterated through a list of randomly placed spheres, having each repel one another in several iterations, till they no longer have any sphere-sphere intersections. This comes with the inherent limiation of having to iterate through the full list of primitives to get the nearest hit, as I don't have any BVH construction implemented for this project. Another friend shared their rhombic dodecahedron grid traversal code. Putting a properly sized sphere inside of each of the grid cells, you can shape the overal structure with noise or SDF samples at the grid cell centers ( threshold for rejecting sphere hits ). Also doing a hash based on the grid index, you could do more isolated high frequency stuff. I put this aside for a couple weeks, because of some things I have had some real life things going on - have not been able to focus as much as I want on it. I do still intend to explore this avenue in the near future.
They also shared some ideas related to impostors, that makes me want to revisit the approach. The core concept is that you rasterize a bounding box, and use the fragment input as an AABB solution - getting worldspace position and primitive ID, you can do a ray-primitive test for the contained primitive. If you hit the primitive, you can take that hit - if you don't, you can discard the fragment. This holds the depth-greater qualifier, which is cool. It's also very general - you could do a lot of things inside that bounding box - raytracing primitives, sphere tracing / raymarching, even voxel traversals. Lots of potential, and it greatly opens up some directions from where I was at with it, doing Vertexture. I had just played with spheres - this would allow for basically any kind of primitive you wanted - millions of them.
A big part of the opal appearance of the image at the top of the page is the color distribution from the sky model that I used. I found this one by ollj, a while back, and have always really liked it. It has some oddities, not least of which is the coding style ( leading semicolons, interesting ), and some inconsistencies in two calculated terms that appear to come from at least two sources. In any event, I wrote it in such a way as to pack the data into a rectilinear map along the lines of the Mercator projection. It loses detail near the poles, and has a distinct seam along one side, but you can rotate your camera or the mapping to get it out of your renders. You can see what that mapping looks like, here.
I typically have been using this low resolution ( 1024x512, 16-bit floats ), but it could be bumped up if need be. One thing that I think is interesting - problematic, for some configurations, but still interesting - changing from a constant background color to this setup has introduced fireflies. The pixels associated with the sun are very hot, ~90, where the rest of the image is in more reasonable 0..1 kind of range. It has a very interesting appearance, like it's at the edge of space. I did a number of interesting renders, playing around with this.
This last one is my favorite - I think it sets a new high water mark for my renders. I really like the extremely thin depth of field, the colors, and the hexagonal bokeh. I'm really pleased with how it came out. There was an issue resolving the sun highlight - but throwing about three hours of GPU time at it did end up resolving it fairly well at 4k.
Fuming is a glass process by which metal oxides are bonded to the outermost layer of the glass. This creates various different looks, depending on what chemical preparation is used. It can create interference patterns that give rise to very interesting optical behavior. Something I tried, was adding a 50/50 chance to take refractive or metallic behavior. Differring albedo on front and back faces created some very interesting behavior.
This green one looks remarkably like the green plastic components of a lego set ( 2160 ) that I recieved on my 4th birthday. Connor. Interesting - I've been trying to get in contact with some people from my childhood, catch up - lost some very close friends the past couple years. Guy I lived with for a year and a half during college died August 1, and I didn't find out till the middle of December. I'm struggling with having to be so far away from my home and my family. In any event, I thought this was quite interesting to see. It also gives rise to some more interesting optical behavior, where some rays get sort of "trapped" inside the glass object. Creates some very unique appearances.
Last updated 1/15/2024