ray-tracing-renderer
ray-tracing-renderer copied to clipboard
Alpha texture
How to make a transparency mask, I have tried everything I can't do it.
I do not think there is support for transparency mask yet in this ray-tracer.
@nicolab28 could you clarify what you mean by Transparency mask? such as, what's the use case? To make sure we guide you in the right direction.
What I would like to do is use either a png or a grayscale image, If it's white, it's opaque, if black, transparent ... Like a layer in Photoshop. To do wrire netting / roasting / grating
In other words, the .alphaMap property. This is a really useful feature to have.
Just to give my two cents: It would be straight forward to implement for the first light bounce (the rasterization pass). But when I looked into other ray tracing implementations, reading alpha maps during the ray intersection step can cut performance by 2x or more. So implementing this feature needs some care.
It might be sufficient just to have alpha mapping for the first bounce, since secondary bounces have significantly less detail. Or it also might be possible to implement alpha mapping for ray intersection in a really clean way that only slows down performance for extreme cases (like trees with hundreds of semi-transparent leaves).
Not everyone necessarily needs real-time rendering ... Performances halved, that may be fine.
Sometimes we need to do semi opaque, or gradient lacquering.