Home Technical Talk

Math behind Cubemaps and Normals (and how redo it manually?)

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Heya to all,

A silly question, I'm sure, but I was wondering if anyone could explain to me the 'math' behind a cubemap and a normal and how they would work, but also, how would one go about 'declaring' them manually, or reconstructing them back?

Here is an example of what I mean:

-I'm using an engine.
-When I import my cubemaps in the engine, I have to import them one by one per each face, and 'stitch' them manually in the engine.
-After that, I declaring them as a cubemap post stitch.
-I would like to import my cubemap as a traditional texture (EI: open box or centipede) and use that instead.
-I would like to manually declare the reflection of my cubemap, from scratch, so I can use the open box texture as one texture.

About the Normal Maps:

-I'm using an engine.
-I would like to import my Normal Map as a default texture (not compressed nor declared for now)
-I would like to manually declare my texture as a Normal Map, from scratch.

So yep, I'm pretty sure I cannot do any of that stuff in an engine material, but if anyone could prove me wrong, I would be delighted!

Replies

  • FicWill
    Options
    Offline / Send Message
    FicWill polycounter lvl 17
  • equil
    Options
    Offline / Send Message
    not totally sure what you mean when you say "declare". i think making a cubemap lookup function manually is a lost cause. it would be wiser to look into something like dual paraboloid reflection maps.

    the difference between a normalmap and a color map is simply the range. colors go from 0 to 1, normals go from -1 to 1. so all you need to do is tex2d(normalmap)*2-1.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    @Fic: No idea honestly since I'm just balling the idea, I guess I could say the UDK engine for example?

    @Equil: Interesting, I'm taking a look for "dual paraboloid reflection maps" but it seems like most documents from GameDev are dead. http://graphicsrunner.blogspot.ca/search/label/Dual-Paraboloid

    Do I need to setup my cubemap mesh (which will be used for capturing the environment) manually or is it all done through the same old setup? (Sorry for the silly question, I'm not too good with abstract math).

    Also, thanks for the NRM math, figured it would be something simple like that.

    Cheers guys!
Sign In or Register to comment.