How to render transparent pixels with OSL?

As i said… you can compute any color via an OSL script but this is only RGB and continue processing this maybe with an additonal output with any other blender nodes…
…or use the OSL own BSDF (look into the API of OSL) in the first place.

…or even elaborate this at bit more…

Youe reply on my hint…

…let’s me assume maybe you don’t realy know what OSL is an how someone can use it in blender ?? Maybe a pure blender shader nodes setup will solve your problem… ???

And here is a example of aglass shader in OSL (which properly uses soem transparency)

Discussed in this thread: