I don’t use that method. I even managed to forget its there. You shouldn’t concern yourself with it. It doesn’t do what you think it does.
What you need to do is this:
- Parent all stuff that you need to project texture onto to the ProjectionScreen node (or rather to the nodepath, to be exact).
- Call projectionScreen.recompute() to generate new texture coordinates.
- Reparent stuff back to where it belongs.
You should also set the lens to the right position and rotation, but that’s rather obviously the first thing to do.
I’m still not convinced you’ll be able to use the ProjectionScreen (or the MultitexReducer, for that matter) to do blood stains. I’m just not sure how to explain why… Every time you recompute your texture coords with the PS (which will happen every time a character is hit), the 0-1 set will be inside the lens. And there’s just once lens. This means that you will only have one stain at a time.
I don’t think the multitex reducer is smart enough to merge textures that use different texture coords correctly, and even if it was, I don’t think it’s worth it in this case.
Plus, I think both systems may be too slow for that use, especially if you wanted to have more than a few characters running around with assault rifles.
What I would advise doing, is just using a PNMImage and drawing blood on that. It’s fast, simple and for blood stains you don’t need much more. Of course, in case of a character you would need to translate the 3D hit point to 2D texture coordinates of a pixel (set of pixels) you need to color, but that’s fairly easy and I can help with that.
The last solution I proposed has one big disadvantage, though. That’s memory inefficiency. You would need a PNMImage for every character and a also lookup table to store the 3D → 2D translation, because computing that on the fly could slow you down too much. The good news is that the “blood texture” could be relatively small (assuming your actors are low poly enough and assuming optimal unwrapping).
That’s probably the best and the simplest (I like it when the two come together) solution you can get without using shaders. In fact, with shaders you would practically do the same, just with better and faster results.
I know, feels good to know others like my work .