What does the transmission node use as reflection reference?

Hi!

I have a node material with some custom vertex node shader. It’s overriding the default skinning and therefore the vertex positions are being controlled by the shader.

I currently have an issue with transmission properties. I can make a regular transmissive node material work with no issue. But when I use it with my vertex node. The transmission doesn’t use the modified position as a reference. And as soon as my mesh is moved from its rest pose, the transmission no longer aligns.

Here is some pictures for reference:


The solution seems straight forward: Apply the same modifications I applied to the vertex positions to the transmission node. This is the same process I had to go through to update normals after the transformations with the vertex shader.
The problem is that I can’t find what the transmission node is using for reference and therefore update its vertex positions.
Where is it ?

On another hand, I might be wrong but I also believed transmission was calculated with some post processing layers. So maybe this is where I should find my solution ?

1 Like

AFAIK, the transmission effect computes screen space bounds for the area that transmission will be needed…
Then it renders an offscreen buffer region of that size, with camera params based based on the IOR of the transmission, and then renders the scenery behind the transmission surface.

IMO using transmission for something as small as an eyeball isn’t worth the overhead of incurring a whole scene re-render.
Can you make a custom shader that does something like transmission without the offscreen render?

1 Like

To be fair you are right, it’s not optimal for small things like an eye ball. I have this setup because it’s great to have easy accurate high quality renders in blender.
I can make a simpler stylized transparent material that doesn’t need as much computation for sure.

I was still trying to fix the transmission node because I would have loved if my vertex shader would support anything and be as generic as possible. But to be fair it’s a dual quaternion shader for character skinning so transmissive materials are generally not so important anyways.

But seeing that issue made me wonder if down the line any metallic material would have similar issues etc. Hence why I still think that’d be great if I had a solution for this.

1 Like

yeah i don’t really know how it injects that behavior. You can look at the source for PhysicalMaterial here:

end:

maybe there are some clues.. (unfold all and search for TRANSMISSION)

Well I found it. Quickly went through the code shader code and found that transmission was using worldPosition for its computation. (Nice links btw very useful for debugging. :+1:)

I tried applying my transformations to positionWorld in TSL and it immediately worked !

In my code it looks like this :

positionWorld.assign(skinMat.mul(vec4(positionWorld.mul(blendedScale), 1.0)).xyz);

For my use case, I’m still going to use a more efficient transparent material. But that’s at least something that now also works with my shader. And any other material properties based on world position should be fixed as well.

1 Like

Awesome! Glad you figured it out. This will probably help someone down the road. :smiley: cheers.

1 Like