how to make shadows for transparent objects using ray tracing in C++/openGL

Posted by happy face on Stack Overflow See other posts from Stack Overflow or by happy face
Published on 2012-06-18T02:18:47Z Indexed on 2012/06/18 3:16 UTC
Read the original article Hit count: 237

Filed under:
|
|
|

I'm trying to make a code that cast shadow from trasnparent objects(such as glass) for rendering in 3D I do not have a shadow map and photon mapping yet, and I wanted to know if there is a way to make shadows for transparent materials using ray tracing only. Caustics sounds very hard without photon mapping... I have implemented a simple code in C++ that only makes the shadows black (no matter if the objects are transparent or opaque) Pseudo code would be great, thnx.

 for(size_t i = 0;i < num; ++i) {
   if(state_list[i].hit && state_list[i].distance < dist_from_light[i]) {
        return[i] = BLACK;
    }

© Stack Overflow or respective owner

Related posts about c++

Related posts about rendering