"Normal maps" in Blitzmax and 2D games, is it possible?

Started by Rick, June 27, 2023, 11:53:06

Previous topic - Next topic

Rick

Hello! (someone starting at BlitzMax, me),
  I wanted to know if anyone has experience in implementing "normal maps" and if it is possible to do it with BlitzMax in 2D games based on simple sprites?
  Can someone tell me, in a simple way and with a simple example, what steps to take to achieve these effects with BlitzMax.
Thanks in advance.
  Rick.-
== The tRick is that there is no tRick ==

GW

It's possible with the Mojo2 module.
I wrote a game that uses normal maps for lighting effects you can check out here http://www.kerneltrick.com/?p=36
the mojo2 library is not the easiest to use, but it works well.
Also you can use the raylib mod to use shaders and get the effect that way.

markcwm

There's a bumpmap example in mky/mojo2 it's not a true example of using a normal map but it should get you started.

Usually you need to use a normal map generator (I haven't made any so can't recommend one) and load that along with an ordinary color texture. It seems like mojo does the rest for you.

Here's a good place to look: https://www.cgdirector.com/best-normal-map-generators/