Mesh rendered material and Render Software

Hi,

I colored a mesh using a height map and context bake in grasshopper, where each face is given a color from a gradient. Now I want to import this color scheme into my rendering software (Twinmotion). Is there a way to preserve the render apperance of my mesh?

Thanks

Hello
yes it is possible. Here an old link,

Not sure there is an update.

I have a face-colored mesh not vertex, will vertex methods still apply?

Do I need to use a script to export? Thanks for additional info.

I think it could work as it means there will be duplicate vertex. 3 or 4 vertex per face.
Test the script and come back if you have problem. Post something, it is more simple to help than guessing.

I test with my script that import an image and represent it as mesh with color on face, and vertex have color. So it must work

YES it works

Yes, I don’t think Rhino can do that. But you can search in the help.

1 Like

mesh color.3dm (191.6 KB)
texture

Thank you. I was able to write a texture file using a mesh colored by face. The script method almost worked end to end but there is a mapping issue.

Here is my mesh to be rendered:
image

Here is the output of the script:
texture-ct

and the result in TwinMotion.

I can use another rendering software if the approach will work better but I would prefer to get this to work.

You have to bake the mesh from the Vicente Soler script. Because Vicente Script puts texture coordinate on mesh. By default they are not what you want.

That’s amazing, it worked!

I would love to know if there is a way to increase the resolution of the created texture map. I am looking around the C# now. Do you have any ideas about this?

Thank you.

I don’t really see why if you have color per face. There must be no interpolation at all as all colors on face vertex are the same.
In you case the best thing seems to be to increase mesh resolution.

Or DON’T use face color but vertex color that is more classical and color will be interpolated on faces.

I think my script is already using Vertex color.

Edit - I rebuilt to work like this:

And the new outcomes:

texture-bake002

Aaaaarghh you contradict yourself. But whatever, I think if there are different color on vertex rendering tools are doing linear interpolation so increasing resolution of texture will not help (as you will surely do linear interpolation). But increasing mesh resolution will.

I have some tool in Nautilus that smooth values on mesh they could be applied on color so with “bad” data you can have a better render. It is a Catmull & Clark tool for mesh and weight on vertex.

I doubled the face count in Mesh Lab and now the script can’t export the OBJ.

without any data it is hard to help.
Post the mesh. of the grasshopper script with internalized mesh.

Here’s the script with internalized mesh.

When I opened the script on a new rhino file, it was able to write the obj and texture successfully.

But it doesn’t seem to produce a better result:


Mesh_texture_example.gh (4.0 MB)

A bit big here
mesh color forum.3dm (10.8 MB)

I used this script

Hard to say if it is better or not

The texture looks good in Rhino, the screenshots I sent are from Twinmotion.

On all tools there is a texture limitation 1024 2048 4096 … pixels wide height

Same result with your example in Twinmotion.

The size of the images being exported from the script, regardless of Mesh Resolution, is consistently 328x328 pixels. I think that changing the output resolution could help but I don’t know if that can be accomplished by modifying the vicente script.