Bump mapping on a sphere from a normal map

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bump mapping on a sphere from a normal map

jimmypag
Hi all,

I tried to found some bump mapping code working on java3D 1.6 without any success.
Examples I found were for java3D 1.3 or 1.4 and most of the links are dead.
Does anyone knows if it is possible (I read there was a bug preventing from doing bump mapping on a sphere in java3D 1.4) or has some hints ?

Regards,
Laurent.
Reply | Threaded
Open this post in threaded view
|

Re: Bump mapping on a sphere from a normal map

gouessej
Administrator
Hi

You just have to pass the normals when creating your own sphere without using the Sphere object if the bug is still in Java3D 1.6.0. You can use the COMBINE_DOT3 RGB combine mode and the COMBINE texture mode to use a texture for bump mapping. You can use several texture units, one for your main texture and another one for the bump mapping.

Edit.: I'm not sure that you can use several combiners in Java3D 1.6.0, it was the case in Java3D 1.4. If I'm right, you won't be able to fully implement bump mapping with Java3D.

Edit.: You can convert an heightmap into a normal map. Maybe it's possible to use GLSL with a ShaderAppearance but I have never tried this feature.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Bump mapping on a sphere from a normal map

jimmypag
Thanks for your answer Julien.

I could combine object color with bump texture but no luck with color texture and bumpmap for the moment.

Some examples show bumpmap on first unit state, others  on second one... I think I'll have to read the whole documentation of combine management and unitState and test one by one each step of the process.

But there's no easy way I think since nobody tried it for a while ...

Cheers,
Laurent.