A 3D rendered image of two mushrooms, some grass, and a bit of dirt insisde a bottle with a mottled texture and a cork in the top, against a green
            background.

about this piece

This project was insaaaaane and went through a lot of stages. It's probably my most involved one because I ran into problems with the Eevee engine, which doesn't love rendering glass. First I followed the Mushroom in a Bottle tutorial by 3D GreenHorn on Youtube, so far so good until he turns on the glass materials. 3D GreenHorn renders everything in Blender's Cycles engine, like any self-respecting 3D modeler would because it's just better lol. I however don't have the power to reliably run Cycles so I render everything in Eevee. So where Cycles just works for things like glass and shadows, Eevee struggles a bit, but considering how Eevee is used for realtime rendering, such as for games, and SOME games must have SOME glass, I figured compromises must be possible. So I had to do a lot of research just to get to the glass part of the tuturial but yes, at least some reasonable glass rendering is possible with Eevee. Here's what I came up with at first:

Being easily amused I thought, "Wow! Gee whiz, computers sure are neat!" But clearly there were some improvements to be made. The shading in the bottle was all fucked up, there was no shading outside the bottle, the lighting was not very dynamic, etc. I kept following along with the tutorial, doing the gradient shading with shader nodes for the dirt piece and improving the mood with better colors and lighting. I also added more spots on the mushroom caps.

Nice. But wait---

I couldn't get a handle on this shadow problem!! It seemed there was an edge on the original mesh that was messing with the glass material and screwing up Eevee's estimation of how he light and shadows should work. This was solved with a lot of tweaking that eventually led me to better understand the IOR value and the "screenspace refraction" value in the material properties of the glass object and how it handles the sort of built-in glass distortion in the images seen through the glass. Basically the previous image had the "IOR" (index of refraction) at 1.5, while the "screenspace refraction" value was something like 0.2-0.5 m (meters). These values have to do with firstly how much the glass either reflects what's on the outside of the glass versus how transparent it is, and secondly how thick the glass is and the scale of the object, which will affect the level of distortion. In my initial changes that just made the glass work like I wanted to (when first enabled in Eevee, the glass material will not be transparent at all and will try to only reflect what's outside), so I ended up with the screenspace refrection slightly too high. I fixed this (after much experimentation) by adjusting the screenspace reflection to 0.01 (to have almost but not quite no refraction at all).

So I finally fixed my weird shadows on the grass, but the bottle was looking a bit like it was just hovering over the contents, not like the contents were inside it. So I tried adding a bit of tint to the glass as well and adding another light to the scene to try to make the bottle pop somehow.

I was getting pretty psyched by this point. My project hardly looked like 3D GreenHorn's, but he had the benefit of Cycles. I also didn't do the little sparkles and stuff that he did. I liked the colored bottle and the new color palette, but I was bothered by the now LACK of refraction on the bottleneck, or rather the rim around the cork. I thought it should be a lot more refracted there since that's where the glass is the thickest. So I thought... can I put TWO glass materials on the same object and set them to different IOR and screenspace refraction values? So I tried it and it turns out you totally can.

YES! I couldn't believe it. This was an exciting development and I came to it entirely on my own. I added some textures to the cork and dirt, which I did with shader nodes. This took a lot of research and trial and error as well (especially error) because the tutorial I was following did not cover this topic AT ALL lol. I actually did two materials for this one object with different shader node trees, because I wanted the sort of gradient effect with the grassiness turning into dirt to continue down the side of the dirt, not just on the top surface, but I'm only showing the node tree for the top here.


I could have left it at this and I was really pleased with the way this was going, but I started to wonder if I could add texture to the glass with shader nodes the way I could with the cork and dirt. It was actually easier than it was for the dirt lol.

So I came to have my final image at the top of the page. It was a lot of fun (and sometimes really fucking annoying) but I learned a lot with this one. Comparable to the donut honestly, but only because I have to use Eevee. I think if I had access to Cycles, I would be too spoiled because so much about Cycles just works out of the box. There's still stuff I could mess with for hours like the shading and such, but overall I'm really happy with the final result. :)