We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everybody, I'd like to ask what kind of technique this render is using:
http://cpetry.github.io/NormalMap-Online/
I man, I don't know how that is called, 3D texture? How can I obtain something like this? Even a simple example :)
Any reference or link will be appreciated, thank you
Answers
So you mean, specifically, you want to model height distortion on the surface of a 3D sphere, like this?
Yes, nothing too complex, just have the possibility to increase or decrease the texture level.
Here is another example but with MaxMSP: https://www.facebook.com/185345661820182/videos/530908980597180/
in the Menu File | there are examples
Here it is Topics | Textures
there is one for cube and one for sphere
Thank you Chrisir, but I know how to apply a play texture to a 3D shape :)
Have you seen the links I provided? There's more than a plain texture.. the shape is 3D transformed based on texture!
This is more of a proof of concept than anything else. Basically you can alter the position of a vertex based on the color of the texture at the point where the vertex would be otherwise.
Thank you TfGuy44, this is great! :D So you think that the "extrusion" is performed with taking the brightness of the img?
How can I add it to a Sphere instead of a plain 2d rectangle?
I tried, but this is soooo wrong ahah
I modified the textured sphere code from here to do what you want,
edit:
This is 99% of the way there, you just have to fix it so it gets the radius for every 3rd vertex from the next row band of the strip. The triangle strip goes around in bands, it currently leaves gaps between the bands of the strip because the 3rd point of the triangle is not getting the radius from the next band.Fixed it
lowerTween and upperTween used to adjust the bump mapping offset
The "map.png" I used
result
Unfortunately to get results like the video you linked your probably going to want to do this inside of a shader, it would be hundreds-thousands times more efficient than doing it on CPU, or do it half-way on the GPU with mesh tweening.
You should check out the MeshTweening example in Examples>Demos>Graphics
edit2: I did a little more on it and added the ability to draw on the bump map in processing. I wish I knew the math to be able to convert from screen coordinates to the surface of the sphere. https://pastebin.com/Dfc4PXyZ
Thank you lmccandless this is soooo beautiful!! I will need to study trigonometry to understand this (I can't comprehend anything ahah) but, I'm really impressed, thank you!!!
I'm out of borders if I ask you to add some comments that describe some functions? It would help me a lot :)
Than, I'll move to study shader.. so I have a LOT of work to do :D
Thank you again
I added some comments to my previous code post.
I also made a version that uses textures and elevation maps from NASA of the moon. The previous version recalculated the bumping of the sphere every frame, this version stores the bumped sphere in a PShape and only recalculates it when needed.
https://github.com/lmccandless/moonBumpMap
WOW =D> this is absolutely outstanding and astonishing, I will never say enough thank you for this!
I only hope someday I'll can do something like this and share some of my knowledge with other people too.
Inspirational