www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: robert on April 18, 2012, 02:49:07 am

Title: Easy way to apply a normal map ?
Post by: robert 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.
Title: Re: Easy way to apply a normal map ?
Post by: EgonOlsen 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.
Title: Re: Easy way to apply a normal map ?
Post by: robert 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).

Title: Re: Easy way to apply a normal map ?
Post by: EgonOlsen on April 18, 2012, 08:49:51 pm
It depends on what you are after and on which device. This...

(http://jpct.de/jpctnet/img/rpg_dun11.png)

...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.