evanrudefx Posted April 28, 2020 Share Posted April 28, 2020 (edited) Hello! I have a few questions about rendering glass/refractive materials in mantra. I found more documentation for renderers like vray and arnold for getting good looking glass. Obviously the parameters are a bit different, but more or less they are very similar. Take a look at this photo about glass and vray from this articles: https://blog.turbosquid.com/2014/04/21/turbotips-v-ray-material-part-3-refraction/ For purposes of testing, I decided to create a similar scene rather then in my main project. That way I can work in a simpler environment and also upload my .hip here. My first question are: Many documentations/sites have the index of refraction (ior) for glass. The article above reads: "IOR is a very important parameter to set correctly, in order for your material to look believable. Fortunately, these values have been calculated for all sorts of materials, so there’s no need to guess here." It then states the ior of glass is around 1.5, which checks in with most other places. How can you just say the IOR of glass is 1.5? Wouldn't some glass have different IOR values? Especially if the glass is flat vs spherical or warped. If I try to match the ior values, it looks nothing like the vray photo. IOR of 1.5 is way too distorted to look correct. Please note that my sphere has an inside and a outside (thickness). I set the normals correctly. It seems having thickness to my sphere causes the ior to double. If I delete the inside of the sphere, it is less distorted. So I try setting the IOR to a lower value. However, once I do that, the reflection becomes too weak and super grainy. Mind my actual project is more complex and the reflections are soooooo grainy. Even with a pixel sample of 20 and turning up my light samples, its still too grainy and takes too long. So why can't I change the IOR for reflectivity separately from refraction? The manual says its not realistic, but its just not working for me when it is tied together. If you look at my photos below (you can make them bigger by clicking them) you can see that 1.5 distorts it too much. In my real scene, I have a snow globe. Whats in snow globe is distorted so badly with 1.5 you can't even see what it is. As I said, if I turn the refraction down to 1.1 or 1.2, I can barely see the reflections and they are SO GRAINY. I tried turning up pixel samples, reflection/refraction quality, the sampling on the lights, but its still way too grainy. Any thoughts/tips? glass_test.hiplc Edited April 28, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted April 28, 2020 Share Posted April 28, 2020 IOR is a fixed property of the material. It doesn't define the total visible distortion that you're going to see... obviously the curvature and thickness of the surface impacts how rays passing through it will end up oriented, but the number itself is just a factor of how quickly light can pass through that medium. Different types of glass will have slightly different IOR values, but a thin sheet of crown glass versus a thick sheet will still have the same IOR. It's possible the thickness of your glass shell isn't realistic? Have you verified the actual thickness in mm? Typical snow globes are pretty fragile, the glass will be very thin, or else it will be made of plastic which has a different IOR. Also, it's important to remember that snow globes are filled with water, which has its own IOR (1.333), so you'd need to either include water geometry inside the globe with an IOR 1.333 material applied, or use a shader that supports an "inside IOR" and "outside IOR" such as the Classic Shader so that the light realistically will be refracted by both the glass and water mediums. 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted April 28, 2020 Author Share Posted April 28, 2020 (edited) 5 minutes ago, toadstorm said: IOR is a fixed property of the material. It doesn't define the total visible distortion that you're going to see... obviously the curvature and thickness of the surface impacts how rays passing through it will end up oriented, but the number itself is just a factor of how quickly light can pass through that medium. Different types of glass will have slightly different IOR values, but a thin sheet of crown glass versus a thick sheet will still have the same IOR. It's possible the thickness of your glass shell isn't realistic? Have you verified the actual thickness in mm? Typical snow globes are pretty fragile, the glass will be very thin, or else it will be made of plastic which has a different IOR. Also, it's important to remember that snow globes are filled with water, which has its own IOR (1.333), so you'd need to either include water geometry inside the globe with an IOR 1.333 material applied, or use a shader that supports an "inside IOR" and "outside IOR" such as the Classic Shader so that the light realistically will be refracted by both the glass and water mediums. thanks for the reply, I will take a look at this..still not sure about the grainy reflections Edited April 28, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted April 28, 2020 Author Share Posted April 28, 2020 (edited) @toadstorm lol, I actually just made the glass (as you suggested) thinner and it pretty much solved all my problems, lol Edited April 28, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted April 28, 2020 Share Posted April 28, 2020 Glad it was an easy fix! Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted April 29, 2020 Share Posted April 29, 2020 Hi Evan, maybe this tutorial helps you 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted April 29, 2020 Author Share Posted April 29, 2020 thanks ill check this out @vicvvsh Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 6, 2020 Author Share Posted May 6, 2020 actually, it doesnt matter what I do, 1.4 refracts way too much. Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 6, 2020 Author Share Posted May 6, 2020 (edited) if you look at this glass there is seems to be little refraction Edited May 6, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted May 6, 2020 Share Posted May 6, 2020 of course there's refraction. look at the edges. the more glass a light ray travels through, the more the distortion. even air refracts. check your IOR and surface thickness/normals. Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 6, 2020 Author Share Posted May 6, 2020 (edited) I meant to say there seems to be little refraction. You can look right through it just fine with out insane distortion. My sphere is super thin and the normals are correct but it displaces everything so much. if the refraction must be 1.4 what then can i change to have less distortion? Edited May 6, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted May 6, 2020 Share Posted May 6, 2020 this glass is about 1mm thick. it's refracting about as much as the photo you posted. glass_ball.hiplc Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 6, 2020 Author Share Posted May 6, 2020 I am confused, my geometry is exactly the same except I did a transform with slight scale and merged it back with the original. But mine looks way different. What is the difference between extruding 1 mm vs transforming 1mm and merging back together? Quote Link to comment Share on other sites More sharing options...
toadstorm Posted May 6, 2020 Share Posted May 6, 2020 The normals of the outer surface and inner surface have to be pointing away from each other. Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 6, 2020 Author Share Posted May 6, 2020 (edited) 4 minutes ago, toadstorm said: The normals of the outer surface and inner surface have to be pointing away from each other. I do, and it still looks different. I just multiplied the same normals by -1 to get them facing the opposite and it looks different Edited May 6, 2020 by ejr32123 Quote Link to comment Share on other sites More sharing options...
toadstorm Posted May 6, 2020 Share Posted May 6, 2020 It's possible that your winding order got reversed. There's two things you need to check... one, the vertex normals have to be facing the right direction. The outer shell points outwards, and the inner shell points inwards. Two, your primitive normals need to be consistent with the vertex normal direction. Displaying the primitive normals in the viewport will give you a hint about your winding order. If they're not consistent with the vertex normals, you'd need to use a Reverse SOP to fix this, likely on the inner shell before you merge it. 1 Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted May 7, 2020 Author Share Posted May 7, 2020 5 minutes ago, toadstorm said: It's possible that your winding order got reversed. There's two things you need to check... one, the vertex normals have to be facing the right direction. The outer shell points outwards, and the inner shell points inwards. Two, your primitive normals need to be consistent with the vertex normal direction. Displaying the primitive normals in the viewport will give you a hint about your winding order. If they're not consistent with the vertex normals, you'd need to use a Reverse SOP to fix this, likely on the inner shell before you merge it. Yes I needed to use a reverse. that was my problem. Thanks so much : ) Quote Link to comment Share on other sites More sharing options...
TobyGaines Posted May 17, 2020 Share Posted May 17, 2020 The noisiness is unfortunately a Mantra problem. Dive down into the shader and find the BRDF drop-down list, and change it from GGX to Phong. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.