Jump to content


Photo

Textures and normals


  • Please log in to reply
4 replies to this topic

#1 euma12

euma12

    GMC Member

  • New Member
  • 2 posts
  • Version:Unknown

Posted 25 May 2012 - 08:25 PM

Hello everybody,

My question is very simple.I understand that game maker is not the ultimate 3D tool and it isn't working very well with 3D graphics, however If i want to bring any normal maps in Game Maker (for more details) how can I do it?
  • 0

#2 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2440 posts
  • Version:GM:Studio

Posted 25 May 2012 - 08:36 PM

To use a normal map in GameMaker, you'd have to use a renderer DLL like GMOGRE or Ultimate 3D.
There is one catch though - you have to use GM 8.0 (or earlier supported versions), as these DLLs aren't actively supported anymore. GameMaker does not natively support normal maps.
  • 0

#3 euma12

euma12

    GMC Member

  • New Member
  • 2 posts
  • Version:Unknown

Posted 25 May 2012 - 08:45 PM

Not even 8.1?
  • 0

#4 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1590 posts
  • Version:GM8.1

Posted 25 May 2012 - 11:07 PM

To use a normal map in GameMaker, you'd have to use a renderer DLL like GMOGRE or Ultimate 3D.
There is one catch though - you have to use GM 8.0 (or earlier supported versions), as these DLLs aren't actively supported anymore. GameMaker does not natively support normal maps.

If you're willing to forsake per-pixel lighting and alpha-mapping AND willing to take about 6 times as much memory AND willing to draw... between 6 and 12 times as much per light each time, then you can have normal maps in native GM.

Here's how:
Create 6 textures (1 for each cardinal 3D direction). These should be greyscale images with value corresponding to the absolute value of a coordinate of the normal for each texel. (Negative values get a separate texture).
Create 6 models (1 for each cardinal 3D direction). These should be the same as the regular model EXCEPT that the normals correspond with a cardinal direction (You can do local-space normal mapping, but since models don't bend it'll probably work best to use global-space normal mapping).

Using the default blending mode, draw one of the normal-map models with its corresponding texture map.
Set blending mode to additive, then draw rest of the normal-map models with their corresponding texture maps.
Set blending mode to subtract, then draw the normal-map models with the texture maps corresponding to the OPPOSITE direction.

Congratulations! You have calculated the lighting for a single light. For multiple lights, draw the scene to a surface for each, then add the surfaces together.
To give it texture, draw the regular model (unlit) with a multiplicative blend mode (draw_set_blend_mode_ext(bm_dest_color, bm_zero)).

And there you have it. Normal mapping. Slow, imperfect, COMPLETELY NOT WORTH IT normal mapping.
  • 0

#5 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3278 posts
  • Version:GM8.1

Posted 25 May 2012 - 11:40 PM

i made something that pertains to this.

http://gmc.yoyogames...howtopic=489291
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users