Main Menu

Bump mapping

Started by Del, July 20, 2010, 22:51:27

Previous topic - Next topic

Del

Hi,

I cant get anywhere near getting this to work using LWJGL
http://nehe.gamedev.net/data/articles/article.asp?article=20

I have tried tutorials for normal/bump mapping in opengl but can't  get any going in LWJGL :(

Can't seem to find working examples already for bump mapping in LWJGL except for the NeHe conversion, but that is not using normal mapping.

If anyone could convert the example in the link to work in LWJGL, can't see it taking long for a more experienced programmer, or a working LWJGL normal mapping tutorial/code it would be really appreciated.

The post before this asks about tangent space bump mapping, no replies yet, but the link also says how to go about converting that code to do this also, any help there too would be great.

Thanks for your time.

Del

plummew

Hi,

I posted the previous message and wondered where your problem was in converting the NeHe article code?

I suggest you start with a different LWJGL sample from NeHe or elsewhere that loads a texture and displays a textured object.

Get this working, then ensure the mesh is a simple quad or triangle and add another texture load/bind for the normal map, finally add the dot3 and normalisation cube map code from the NeHe and see how you get on.

For info:
The cube map is a way of getting normalisation to work on a per-fragment basis and was required before fragment shaders came along that can normalise vectors.

The NeHe code is a openGL texture extension method for hardware bump mapping, but it is ultimately doing the same as the GLSL shaders do in other articles such as the one at: http://www.blacksmith-studios.dk/projects/downloads/bumpmapping_using_cg.php Although this one uses CG rather than GLSL.

Or the GLSL example at: http://www.fabiensanglard.net/bumpMapping/index.php

As this second example loads a mesh, I reckon I'll need to check out that code and potentially use the doom3 model used there to debug my own code.

Good luck!

Del

Thanks,

The extra info really helped.

The second link, I have looked at that guys code before to the shoot em up, Learnt some things there. I hadn't seen the new things he'd, I'll have a look through them properly after some sleep.

Hope your tangent space normal mapping makes some progress :)