Hi all,
I am new to OpenGL and it’s some time that I started programming with JOGL and JCUDA (OpenGL and Cuda porting on Java)
I would need to calculate the shadow of a 3d model on a plane. Models can be also 5 milions triangles while the plane is basically a square that ranges from 480 to 4800 tiles.
I already managed to draw the 3d model with OpenGL and calculate the projection of each triangle on the plane with CUDA.
The big problem for me arises when I want to know which tiles are covered by the shadow and which ones arent. If I draw the array of the projected triangle I have the result printed on the screen, but I need somehow to manage it (an idea would be to retrieve the result like a boolean matrix).
For example, a projected triangle on a 4x4 matrix could appear like the following:
0100
0110
0111
0000
1 means I have shadow on that tile, 0 means no shadow
I read a lot about rastering, ray tracing, FBOs, stencil buffer, etc…
But since I am a newbie on this field, I am very confused and so I would like to ask you which is the best idea to reach this goal.
Thanks in advance