bump mapping without shaders

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jmpep
Posts: 32
Joined: Thu Jul 10, 2008 6:55 pm

bump mapping without shaders

Post by jmpep »

Hello to all!

I bet this is quite a basic question, but I've been unable to found the answer neither in the wiki, the tutorials or the forums...

Is there a way of having bump mapping in Irrlicht without using shaders? I need my code to run in hardware that lacks support for them and I would like to offer bump mapping :D
asphodeli
Posts: 36
Joined: Thu Jul 24, 2008 12:46 am
Location: Singapore

Post by asphodeli »

software shaders?
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Post by kornwaretm »

since toy story, since the renderman simulate great lighting behaviour.
GPU are equiped with shader processors, i belive todays GPUs all have shaders processors. you only need to make multiple shaders version so if the higher version fail, use the lower verson.
jmpep
Posts: 32
Joined: Thu Jul 10, 2008 6:55 pm

Post by jmpep »

GPU are equiped with shader processors
I am afraid they aren't, not the ones I am targeting :)

It is possible to create bumpmapping effects without shaders, by using some OpenGL extensions. What I am wondering if it can be done in Irrlicht as it is or shaders in the only method provided for bump mapping...

Anyway, thanks you for your quick answers :)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

As far as i can think there's no way of doing it without shaders, but if you want to know about OGL extensions why not research them? See if something exists by using google.
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

'Yes, there's the GL_ARB_texture_env_dot3 extension which could be used for a basic bump mapping effect. I think NeHe has some tutorial on this.
jmpep
Posts: 32
Joined: Thu Jul 10, 2008 6:55 pm

Post by jmpep »

Oh, I do know how it is done with the extensions -well, actually what I know is where that information is, for example in http://www.paulsprojects.net/tutorials/ ... ebump.html)

I just wanted to know if it is implemented in Irrlicht already or if I would have to do it. How would you do it, as a new material or a as fallback for the NormalMap renderer?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, look at the example:
!SetUpARB_texture_env_combine() || !SetUpARB_texture_env_dot3())
They are using the dot3 extension. They also use cube map normalization, don't know if you really need this, would make things much harder. Also, it's a two pass material, just to note this extra hurdle as well...
erictheturtle
Posts: 5
Joined: Fri Jun 20, 2008 5:27 pm

Post by erictheturtle »

You can do a basic one-pass bump mapping with the DOT3 extension and two textures. You are limited to only directional lighting set in the global color (glColor() in OGL). Unfortunately I don't think Irrlicht lets you use that global color for meshes (I really wish it would), so you may have to change the engine or find some work around. Here is an example of this technique in OpenGL ES.

One work around would be to update the Color component for every vertex with the direction of the light. In that case you could even take it a step further--with some additional calculation you can update each vertex with the direction of a point light.

To get any more complicated than this requires multiple render passes and more calculations.
jmpep
Posts: 32
Joined: Thu Jul 10, 2008 6:55 pm

Post by jmpep »

Thanks you very much erictheturtle!

That example is perfect for me, since I am using OpenGL ES 1.x. In fact, I am targeting a PowerVR MBX card, which is the "big sister" to the MBX Lite found in the iPhone.

I'll try to valorate the feasibility and complexity of using that technique with the tweaks you suggested as a fallback for the normal renderer :)
erictheturtle
Posts: 5
Joined: Fri Jun 20, 2008 5:27 pm

Post by erictheturtle »

Oh in that case you really should take a close look at the PowerVR site. They have lots of details and examples of how to do all the neat effects with their chips (including a DOT3 bump-mapping one, but it's basically the same as the link above).
Post Reply