PBR Height and ambient occlusion?

I’m quite new to jMonkeyEngine and I’m trying to use a PBR material from FreePBR. To be exact, the “Pocked Stone” material.

I’m trying to define the material using jMonkeyBuilder. Assigning the albedo (I’ve put that as the BaseColorMap), metalness, roughness and normal maps was no problem, but the height and Ambient_Occlusion maps don’t seem to fit anywhere? Where do I need to assign them, or is that functionality not supported by PBRLightning.j3md?

1 Like

Height maps is not really supported, at least as they are in unreal. You can set it as the ParallaxMap and play with the paralaxHeight values. Also I recommend to set the SteepParallax to true.
Note that this won’t give you the same effect as in unreal (they have a dynamic geometry tesselation on the gpu and offset the vertices with the heightmap), but it’s close enough.
For the ambient_occlusion map set it in the LightMap slot also set the LightMapAsAOMap param to true.

Hope that helps.
If you mind posting a screen shot of the result, I’d be interested.


Thanks nehon! I’ve got the ambient_occlusion map working. But I think I’ll just leave the heightmap out; I can see pretty much no difference except there being a slight, flickering distortion around the edges and, on values above 1.0, a weird warp effect in the center.

I couldn’t upload the screenshots here (the forum always gave an error), so I’ve uploaded them here instead: Heightmaps in jMonkeyEngine - Album on Imgur

Yeah parallax works better on a plane than on a sphere. Though make sure all your maps are in repeat mode to avoid the edges tearing.

Yes, they’re in repeat mode by default. I’ve seen the same with using the cube though. Eh, I guess it’s a matter of time until this will be supported, and it’s no dealbreaker for me; it would just have been a “nice to have”.

Have to ask… does your model have tangents, ie: did you generate them?

Parallax won’t work without tangents.

true… since he is using a normal map, I assumed that he was.

Ahh, I had to re-create the material after ticking the box in the options. Yes, it definitely has an effect now! Though only inwards, so towards the edges of the cube there’s a really weird “mirror effect” going on.

yep…definitely. Parallax is a trick really.