Parallax not working. I know I am wrong

Hi,

I 've got an issue with parallax.
https://playground.babylonjs.com/#10I31V#419

Modifying the scale ratio won’t affect the outcome.
Note: I have my diffuse, normal and height-map in png and separated.

Trying different solution, even cranking up the scale bias won’t do anything.

What did I miss?

Thanks

Hi,
Well, it works. Sort of :wink:
Looks to me like your normal texture is ‘abnormal’ :grin:
Jokes apart I believe it really works but the values are incorrect to make a proper height for parallax occlusion.

May be a quick a look at this topic:

@mawa : Thanks!
Well, it means that my normals textures are wrong… That’s strange…
How did you correct it? :fist_right: :fist_left:

They are not really wrong, in essence. They would work fine for a bump. But parallax occlusion uses the alpha for the height. The lowest could be either transparent or white (or black and then inverted). Your normal does not have these differences to make a proper height.
Check out these two example textures and compare them to your version:
Imgur

You’ll see what I mean.

Edit: my apologies, the lowest needs to be transparent I believe. Not sure though. May be it converts it to alpha but then may be not. Best is to have it transparent; understand use the alpha for the height.

Hmmm…

I will need to create a script to append the heighmap info from the heightmap to the normal alpha channel then… (correct me if I am wrong)

Indeed. Or you can use the NME to create a procedural texture that will generate the texture for you:

Note that I need to do “1-height” for the height channel, else the effect was reversed from what it should be.

1 Like

Thanks Evgeni,
I have so many textures that a script will be much faster :slight_smile:
it’s a 5 min work anyway :+1: :+1:

1 Like

Lol. Devs always think it’s better to make it the fancy way :grin: I’m sure the script will do fine.

1 Like

For me it was faster to make a node material because I have never worked out how to add an alpha channel (coming from an external pic) to a picture in Gimp!

1 Like