ray-tracing-renderer icon indicating copy to clipboard operation
ray-tracing-renderer copied to clipboard

Alpha texture

Open nicolab28 opened this issue 4 years ago • 5 comments

How to make a transparency mask, I have tried everything I can't do it.

nicolab28 avatar May 11 '20 06:05 nicolab28

I do not think there is support for transparency mask yet in this ray-tracer.

ManishJu avatar May 11 '20 06:05 ManishJu

@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.

elfrank avatar May 17 '20 15:05 elfrank

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

nicolab28 avatar May 17 '20 17:05 nicolab28

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).

jaxry avatar May 17 '20 19:05 jaxry

Not everyone necessarily needs real-time rendering ... Performances halved, that may be fine. Sometimes we need to do semi opaque, or gradient lacquering. maxresdefault

nicolab28 avatar May 19 '20 08:05 nicolab28