How does BumpMapping Operate?

1 favourites
  • 1 posts
  • Hello all and thanks for looking.

    Im trying to get the bumpmapping effect to work with my game and am having little luck. Im hoping one of you knows how it works.

    When I set bumpmapping Light coX to ((character.X-bumpmap.X)/bumpmap.Width)*100

    and bumpmap Light coY to ((character.Y-bumpmap.Y)/bumpmap.Height)*100

    The Light (in the bumpmap) is floaty and not accurate which can be fixed by adjusting the coordinates but as soon as I overlap another bumpmap its back to being not accurate. Is this because the origin of "light" in the bumpmap is reset with each bumpmap? And is that origin at the bottom of the bumpmap or the bottom of the layout? Im so confused.

    EDIT

    Even if I combine my 2 bumpmaps into one very large bumpmap, the light coordinates are still floaty and drifting. Im assuming then that there's a problem with the equation ((character.Y-bumpmap.Y)/bumpmap.Height)*100

    The bumpmap parameters operate on a 1-100 scale, I guess a percentage of the coverage with 1 being first pixel of the bumpmap, 50 the middle pixel, and 100 the last pixel. I think the equation is missing something and thats allowing the light to drift. Anyone have any ideas? Am I even making sense?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)