Convert normal map height map?

Hi

Searched the forums and couldn’t find if there is a was to do this using the JME api. Basically a method which takes a Texture2D containing a height map and returns a Texture2D containing a normal map, and vice versa.

Thanks
Barney

@barney said: Hi

Searched the forums and couldn’t find if there is a was to do this using the JME api. Basically a method which takes a Texture2D containing a height map and returns a Texture2D containing a normal map, and vice versa.

Thanks
Barney

Can’t do that with jME, but you can in the SDK. Open the image in the SDK and check the top of the window where the image is in. There are several options to modify the image. Always make backups because it’s not always user friendly. :wink:

Yeah, but right-click the image and select “edit image”, if you just double-click it the internal NetBeans image viewer opens.

Hi

I don’t see an “edit image” on the context menu, I see “Edit Texture” and it opens some view called “PixelHead” which doesn’t seem to have any useful features at all, certainly nothing like image conversion:

Do I have a plugin missing? Or am I just being thick?!

I specifically want to do the conversion programmatically not in a tool - but if it is in the SDK or an open source plugin I can probably rip the code from there.

Thanks

Yes, thats the editor, click the “Filters” menu item. I don’t think this way makes much sense for your height map though.

Ah, yes, I was just being thick! Saw the filters button just after posting, I had mistaken it for just a window title :frowning:

Cheers

Actually that only appears to do the conversion from height map (or any image) to normals, not from normals to heights … but in fact I think that will suffice for the moment. Thanks again.

@barney said: Actually that only appears to do the conversion from height map (or any image) to normals, not from normals to heights ... but in fact I think that will suffice for the moment. Thanks again.

But you were asking about height map to normal map?

Basically a method which takes a Texture2D containing a height map and returns a Texture2D containing a normal map, and vice versa.

My original post did say “and vice versa” … but I’m okay with just heights to normals for now.

If anyone has written or knows of (open source) java code which does both, then so much the better…

B

What would be the use of this? I think you’re probably better off looking at how to generate the normals for your height map, e.g. as the terrain system does it.

The Normal Map plugin for Gimp 2.8 does it, just make sure you select the Convert to height option.