How to detect the opacity of a material at a certain pixel to modify collisions?

Hey all, I hope you can help with this as I’ve hit a wall.

What I’m trying to achieve is to cast a trace onto a material and find the opacity of the material at that pixel, so I can turn collisions on/off. It would be used for a walkway, so when there’s no light touching the surface it goes invisible using a mask and turns off collisions on the player when stood on that point so they fall through.

I’m not able to read parameters from materials as they change in real time, but I’ve heard of a possible case for using a GBuffer but I’m not sure if that’s the solution. Also, it wouldn’t strictly need to be done with the material, I just need to disable collision when light is hitting it using the light’s attenuation and the material seemed the cleanest way.

Does anyone have a second opinion on how best to achieve this effect? Thanks!

I guess you could do a line trace from the light to the bridge, that give you an impact point. You also know where the player is. Then you can turn off the collision if need be.