0
\$\begingroup\$

enter image description here

In the image above, I want to know how can I calculate the number of pixels of the rendered players' shadows that are inside the elephant outline.

An occlusion query is used to count the number of pixels occluded in the entire screen, but I want to restrict my count to just the number of pixels that end up inside the outline.

\$\endgroup\$
1
  • \$\begingroup\$ Can you use a snap shot? Break the shape to triangles? What tools do you have at your disposal? \$\endgroup\$
    – AturSams
    Commented Dec 22, 2014 at 21:57

1 Answer 1

0
\$\begingroup\$

Basically:

  1. Render the player's shadows to a render target.

  2. Render the shape to a render target.

  3. For each pixel, determine if it both (A) contains a shape pixel and (B) contains a player shadow pixel.

\$\endgroup\$
1
  • \$\begingroup\$ yes, that's what I've done on that moment, thank you :) \$\endgroup\$ Commented May 29, 2015 at 16:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .