Hello everyone!
Few days ago i thinking that it was so cool if i have opportunity to use parallax mapping in NME. And i try to create a parallax mapping in NME but i don`t achieve success. It is that what i got: Babylon.js Node Material Editor
But you can see that it is not work correctly. I think it is because i use not right vector transform here:
How i understand it is converting Camera view vector to object normal Vector and i don’t know how i can do this on NME. If somebody knows way to create parallax on NME please tell how to do that.
@Deltakosh Hello! What are you think about support parallax mapping via height map or normal map in NME? This capability would allow the creation of very detailed and large ground places and other surfaces such as diffrent crystals, ice and much more other incridible things! I try to create parallax mapping in NME by myself but i was failed with that(
I will try to do that but I not sure that I get a success because by the true I’m not good programmist-i’m 3D designer and start to write code 1.5 years ago and learned a lot but I’m not sure that my knowledges enough to solve this problem
(sorry for resurrecting an old thread, but since this matter is yet unsolved, I thought I’d take a stab at it)
@Deltakosh I’ve tried to find out what needs to be done. Are we really talking about a couple of switches in an existing node block which would basically defines.setValue("PARALLAX", true); and defines.setValue("PARALLAXOCCLUSION", true);? This looks way too easy, is there something I’m missing?
I feel like I’m still not understanding the issue preventing this. What I know is
a) required functionality is in the standard shader and works with StandardMaterial and PBRMaterial
b) NodeMaterial builds upon existing shaders, e.g. PerturbNormal block activates BUMP define to do its work
I hope this is a correct assumption. In StandardMaterial and PBRMaterial parallax occlusion is activated by two defines: PARALLAX and PARALLAXOCCLUSION. There is a lot of uniform preparation and other stuff, but at its core, the functionality is in the shader, right? Why can’t it be re-used in NodeMaterial? You mention reading multiple times from the normal map, isn’t this part implemented in the shader? If not, why can’t it be replicated in NodeMaterial? And last but not least, why would implementing a PerturbNormalWithParallax node as a stop-gap solution be overkill if it would provide a hacky but working solution to an otherwise unsolvable problem?
I’m sorry for all the questions, but I’m trying to understand the problem while lacking much of the ground-work, which I’m picking up not nearly fast enough.
PS. We need this functionality and we are intending to provide a PR, but need to understand both the problem and reservations about implementation possibilities fully, to make it easier. Not looking for free lunches, Babylon.js is a huge free lunch already