why dont you use a normalmap for the light stuff?The reflection shader however looks neat. You need to share some scripts
...
I thought you want to get the top/left position of the actual sprite and calculate it by substracting the AnimationSize from the actual players position. This however doesnt contain the offset from the sprite to the actual center.
Thanks.
The Mechanics are still a Bit faulty though, only the Reflection works without any Problems, because that is such a simple Technique... except for the Positioning/Scaling, as that is the big Problem discussed here.
I actually started out writing a Shader that would automatically generate a Normalmap for my Character that could be used for Lighting (see Image -- though that is a WIP-Shot), but then I had to admit to myself that I just don't understand the necessary Normal-Vector-Dotproduct-Etc.-Calculations necessary to actually actually use the Normalmap (but I might keep trying), so I instead settled with the much easier Mechanic of using an offset inverted Alphamask blurred across the Character according to the Lightvector (as seen on the multiple Images I have already posted), and I think the Results are neat enough, and run fast enough as well.
However, I never said that that the "Lighting-Stuff" -- i.e. the Character-Lighting -- is problematic in any Way, my Problem is with getting a properly positioned Mask for the shown Effects. I don't see how a Normalmap (on my Character) could possibly produce Godrays, Reflections, or Shadows cast across the Background in Pseudo-3D. Normalmaps don't help with that.
Concerning this: I thought you want to get the top/left position of the actual sprite and calculate it by substracting the AnimationSize from the actual players position. This however doesnt contain the offset from the sprite to the actual center.
I am currently using the Character's Position (and the upper-left Corner of the Duplicate would be there), which is at the Animation-Center and therefore have to offset the Duplicate by the Position of the Animation-Center, which usually is half the Width of the Character-Sprite, and ca. 0.94 of its Height. If, however, I could load the Animation-Sprite's upper-left Corner's Onscreen-Position directly, I would not have to shift it by any such Offset (which changes with each Angle) and could most probably directly place it where the current Sprite is. But you might be right, I should try and do the Calculation with the AnimationSize or AnimationInnerSize and see if that might make any beneficial Difference.
(Problem still being that the AnimationSize does such weird Things when being loaded into the Shader.)