In PBR materials, we can set up a refraction texture and set the render list. In Node Materials, I am setting the texture to the RefractionBlock texture prop in code, and it shows up as expected in the Inspector:
And in that texture, I am setting the render list to both null and all meshes.
I think refractionBlock.texture expects an environment texture since it defaults to the scene’s environment texture. It looks like setting refractionBlock.texture to a RefractionTexture is essentially telling the renderer to refract a refraction.
Hmm, but that doesn’t seem right, does it? The idea is that we want to set a refraction texture so it shows the mesh behind it as though it’s through some sort of transmissive material such as plastic. Using the environment texture sort of defeats the purpose, no?
It could be that you have to put your refraction texture in scene.customRenderTargets so that it gets rendered (you don’t have to do it for standard/PBR materials because the system does it automatically for you in these cases).
As you can see, with @Evgeni_Popov 's suggestion, I am now seeing something rendered there, but for some reason it’s rendering itself instead of the other meshes! It seems close, but what is happening there now?
The thing that I’m seeing now is that even though I can see through the box, I don’t see any refraction on the sphere, and adjusting the numbers doesn’t seem to have any effect. I’m sure it’s something silly!
The value would not be used in this configuration. I ll try to make it optional soon but in the meantime, you can put it to any values if not using translucency or tint.