Author Topic: Easy way to apply a normal map ?  (Read 1422 times)

Offline robert

  • byte
  • *
  • Posts: 40
    • View Profile
Easy way to apply a normal map ?
« on: April 18, 2012, 02:49:07 am »
Hello,

I would like to know if there is any easy way to apply a normal map texture without using GLSL, as I have no idea how it works, and don't really have the time right now to learn another language...

Thank you.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Easy way to apply a normal map ?
« Reply #1 on: April 18, 2012, 07:08:20 am »
No. For applying a normal map, you have to use shaders. You'll find a parallax mapping shader in the examples that come with the engine. That's basically an advanced normal mapping shader with the extension of a height map. You can strip that code, so that the height map part is gone and you'll have a simple normal mapping shader.

Offline robert

  • byte
  • *
  • Posts: 40
    • View Profile
Re: Easy way to apply a normal map ?
« Reply #2 on: April 18, 2012, 11:08:07 am »
Thanks for the fast respone EgonOlsen. I recall you said in a message that shaders are somewhat slow on mobile devices... do you think a normal map shader will slow down the framerate significantly ? Considering the fact that mobile devices also don't handle "high" polys very well, that's why I was going to use a normal map in the first place, to fake real topology...

P.D: I tried a normal map of a 9000 tris rotating human face using libgdx with specular, diffuse and ambient lighting and it was really fast (60fps, limited by vsync).


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Easy way to apply a normal map ?
« Reply #3 on: April 18, 2012, 08:49:51 pm »
It depends on what you are after and on which device. This...



...is an example of a dungeon with full parallax mapping on all surfaces. It runs between 22-30 fps on a Galaxy S class device. On the other hand, this means that it'll run too slow on devices like the Nexus One.