From procedural texture to image texture (How To)

No problem
I am not on my pc but you have a tool on 1.9.9 named mesh uv that gives uv coordinates
Deconstruct your mesh and reconstruct it using these uv points.

Thank you very much

I think you figure it out but the related solution is in this discussion

I didn’t found this component, but i used the other with Resolution (it’s under image or mesh?). Anyway i noticed all this works really well with breps (Who basically are surfaces with UV) but for meshes without UV most of the time It needs tò bake them and unwrap on Rhino because the result is better then regular UV mapping with Human in Grasshopper… It Is possibile to have a parameter (0-1) per vertex for ambient occlusion of the mesh? Most of the texture needs some Shadow where they are occluded. I found a py for this, but i think would be a good addition for this plug in :revolving_hearts: (the One i use more)… Might be under “mesh component group” there are so many components they don’t appear on laptops screens!

Thanks for feedback.
For the component, it depend if you use Food4rhino or package manager. I put it on last version on Package manager (v1.9.9). I’ll publish it on F4R after some improvements and with icons.

Yes I could add ambient occlusion.

I added on 1.9.9 a little too to replicate Shell Factor from Blender. I found it useful for these render.

The value of shell factor is mapped from from [0 1] and put on the UV component. Then I use a Gradient texture to replicate the leaf color variation.



shell factor.gh (11.5 KB)

I already put some component on ImageColors, perhaps I will add a “Mesh Modify” ?


here the registration video of how the tab of mesh component list appear on a laptop screen! i dont’ know if something is missing. My personal idea was to divide mesh components in 2 groups; one who output number values and colours, and other who output a modified mesh or other geometrical stuff… but for sure i don’t have the whole piture of your plugin. For the ambient occlusion what i would love to have is something can be used for valley (0) and ridges (1) so you can 3d painting like how you do on a miniature of warhammer with ink (in the valley) and dry lighting (in the ridges). i will show you the result of texturing with your plug in this model i’m doing entirely with grasshopper (exept for the human body)

375 000 vertex, 100 rays + 10 smoothing steps ~25 seconds


100 rays + 0 smoothing steps (black spots are certainly due to points that are too close to the mesh so ray find itself ! => correction)

100 rays + 4 smoothing

10 rays + 10 smoothing steps ~6seconds

I think to implement something for very fine mesh, just use a percentage of vertex calculation and then use weight smoothing technique to interpolate others weights (seem faster that doing rays).
Or something with a limitation in time. Don’t know what can be the best.

I surely must add a calculation button !

Can an ambient occlusion being done with rays coming from all the directions? Your component of mesh valleys and ridges can be translate in a 0 tò 1 parameter for each vertex of the mesh?


I bought this procedural material library in Blender and I think they have on the shader node something like ambient occlusion for something like this metal aged or something

What I understood from Ambient Occlusion is that you throw rays in all direction and look how much ray are blocked.
I shot N rays in an hemisphere, hemisphere is oriented with normal. Rays have a good distribution but I choose Monte Carlo technique (random direction). And as it is a ratio, yes it is between [0 1], and yes for each vertex.

I have a low-poly uv-mapped mesh that I only temporarily convert to high-poly by tri-remesh to perform the Ambient-Occlusion or other type of analysis. I want to receive image texture that I can later use with the low-poly UV mapped mesh. Can you please take a look if this is this a proper setup?

Ambient Occlusion to Square Texture.gh (82.0 KB)


Is there a problem with welding right now or I’m doing something wrong here?


mesh copy UV.gh (8.2 KB)
uv problem.3dm (1.9 MB)

My tool was updated, in 1.9.9.x
Old one on middle, new on right



you must use this one if multiple “islands”

mesh copy UV (1).gh (11.1 KB)

I will deprecate the old one

I see there is still some problems on the rounded part (the nine of 98) ! The error is due to the triangle mesh that is going on another UV island. My tool seek a closest point on the same island. At the moment I don’t seek if 2 islands are joined and in reality are a single one.

If you add 2 lines as feature for the meshing, it will be quite perfect


Now it works, thanks :slight_smile: I can investigate your tools further.
I just realized that welding the mesh gives much better results in producing AO.
These two regular GH components take most of the time, I wonder if this step can be encapsulated to speed things up.

This is for generating the 4k texture.

Not sure, but Mesh closest point could be improved if encapsulated in a C# and parallel calculation is used.
Not impressive difference


mesh closest parallel.gh (11.9 KB)

If you have the script I could look at that.

Do you generate AO with your tools or mine.
I now have 3 tools for AO. 2 published, and one that will be on next release. They are not perfect but as result can be smoothen it could be more fast that generating millions of ray.

I’m using yours Ambient Occlusion on Mesh component. Not trying to do anything serious at the moment. There are quite a few components and workflows to get familiar with.

unwelded vs welded mesh passed to the Ambient Occlusion on Mesh component different results

I will definitely check the new AO components as well.
There are a lot of interesting possibilities that your techniques can unlock and let users play with UVs and textures. I was writing a longer post about that today but decided to hold it and get more familiar with what is already there.

Different results could be due to the normals. For ambient occlusion (hemisphere) I use normals to orient the hemisphere. I don’t use it on “Sphere” as rays are going on all direction. I also have some false positive. Ray intersect at start, so I push a little the start (with normal).
Thanks for reporting.

Playing with the Ambient Occlusion Sun component. I think it would be beneficial if you will allow for the Mesh List input. It’s way easier to convert separate Brep Faces into analysis mesh, than to split meshes into desired pieces faces after the AO results. (I don’t see any component to split mesh along the unwelded edges or receive unwelded edges indexes that can be used with the Split Mesh Along Edges ID maybe I’m missing something).
The reason why I’m trying to separate the AO colored mesh is to avoid light leaking when using Smooth Weights on Mesh.

Nautilus AO Tests.gh (25.2 KB)

Only one mesh from the list is used in the calculation.


Smoothing joined mesh pieces brings some completely occluded values around the edge giving undesired results.

yes, I will change that so if there are multiple meshes in list, they will be merged in one mesh, AO will be calculated and result will be splitted.
At the moment you can join the meshes (no welding)
Do the calculation and then split the list of results
The smoothing of weights seems to work badly here !

Nautilus AO Tests LD.gh (28.1 KB)

New components (1.9.9.4) will uses list (an dataTree)
I added smoothing weight in the component



There is now a component that splits meshes on unwelded edges (if all unwelded edges form a closed curve)
I will also put one using RhinoCommon method
Mesh[] ExplodeAtUnweldedEdges()