# Having hard times with textures (bug)

**URL:** <https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560>\
**Category:** Rhino\
**Tags:** windows, rendering\
**Created:** [February 1, 2021, 2:04pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560 "2021-02-01T14:04:50Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [February 1, 2021, 2:04pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/1 "2021-02-01T14:04:50Z")

</div>

Hello  
I have some hard time applying a texture on an object.  
Here the object in render preview

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/f/e/3fef6a7d2001fd0cb015ba0f2631f273496ddd9a.jpeg)

Here the object in Raytraced preview

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/f/f/8ffb001a94e3c00d4fd98135e269d130545f9e4e.jpeg)

Here the object properties

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/6/b/66b7bb4da484950c136a6354ec8e75d3f6a97351.jpeg)

As the object is solid I use Match Mapping from another object that is more simpler. This simple object is first unwrapped, a texture is calculated using procedure described here

> [@From procedural texture to image texture (How To)](https://discourse.mcneel.com/t/from-procedural-texture-to-image-texture-how-to/116446):
>
> Here is a way to transform procedural texture to a texture file. In this description a procedural texture is a function that transform a coordinate in euclidean space (X, Y, Z) to a colors (Red, Green, Blue and why not Alpha). Unwrap the object(s) you want to texture, this object could be also an object that is just used as support of UV mapping (used with Texture Matching) 1bis) You can edit the UV map in UV editor in order to optimize the placement of objects. Extract…

I saw lot of discussions about textures problem, unwrapped geometry with bugs, flipped faces …

As there is a good object representation (render view) is it possible to use the mesh behind it instead of ExtractRenderMesh?

Here a Rhino 7 version  
[bug report.3dm](https://discourse.mcneel.com/uploads/short-url/gYuLVI2RPCMLsg0Y5j9sQeTiNAu.3dm) (7.2 MB)

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [February 1, 2021, 2:23pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/2 "2021-02-01T14:23:28Z")

</div>

I believe Rendered mode does here per-pixel mapping, or am I mistaken here @DavidEranen, @Jussi_Aaltonen ?

I know at least for Raytraced we get a baked version of the texture. And then it is up to the texture coordinates on a probably quite low-density mesh to do the interpolation.

For Raytraced / Cycles in the future it would be cool to add raytraced custom mapping, but currently that doesn’t exist yet.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [February 1, 2021, 2:31pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/3 "2021-02-01T14:31:45Z")

</div>

Thanks for answering, there is surely a problem on

> [@nathanletwory](#):
>
> low-density mesh

not far from there as the UV coordinates are from a low mesh.

My problem is not only on Raytraced it is on the mesh that is calculated using ExtractRenderMesh. This problem is exported when I SaveAs “obj” “fbx” …

Or there is a bug in Match Mapping or I have to apply a specific Workflow (that is not clear).

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 3, 2021, 8:55am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/4 "2021-02-03T08:55:33Z")

</div>

@nathanletwory Sounds like something I’ve been dealing with lately. I’ll take a look. Thanks!

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 5, 2021, 6:52am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/6 "2021-02-05T06:52:06Z")

</div>

> [@nathanletwory](#):
>
> I believe Rendered mode does here per-pixel mapping, or am I mistaken here @DavidEranen, @Jussi_Aaltonen ?
> 
> I know at least for Raytraced we get a baked version of the texture. And then it is up to the texture coordinates on a probably quite low-density mesh to do the interpolation.

@nathanletwory Actually Rendered mode bakes the texture and Raytraced for some reason doesn’t. I believe Raytraced should bake like you said (and in fact it does bake the texture but it doesn’t use it). I will check this with a clean install of Rhino 7 and log a bug if needed.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [February 5, 2021, 7:23am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/7 "2021-02-05T07:23:38Z")

</div>

> [@Jussi\_Aaltonen](#):
>
> (and in fact it does bake the texture but it doesn’t use it).

There was a time when this happened - we fixed that with @andy on January 22nd, 2021 in what will become 7.4. Has to do with the render hash calculation, used IDs and so on.

> <https://github.com/mcneel/RhinoCycles/commit/63d9de1361d93e53f26bfd7b4ea65a6db86eca12>
>
> https://mcneel.myjetbrains.com/youtrack/issue/RH-62373

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 5, 2021, 9:38am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/8 "2021-02-05T09:38:08Z")

</div>

I see, Cycles only bakes decals, procedural textures and multiple mapping channels. Custom object mappings are not baked. That explains.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [February 5, 2021, 10:43am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/9 "2021-02-05T10:43:35Z")

</div>

I’ll add that flag right away, sir.

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [February 5, 2021, 10:46am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/10 "2021-02-05T10:46:37Z")

</div>

Thanks for looking into the problem. For sure the custom mapping (here I use Match Mapping) is not saved on the render mesh.  
If I take my 3dm withe the polysurface  
The render view is correct

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/4/c/14ce6875172c15da39a1a37186eaeaf76907ba0c.jpeg)  
If I look to the UV editor, I see the simplified object and the UV mapping associated with it  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/b/e/6be77c886a48bcfefb1940443be1b7af1a3179f1.jpeg)

And now if I export my object say to FBX and reopen it in Rhino  
Everything is messed up, like in Raytraced mode …

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/1/1/011fe6e7a09e981318907fd2d430db95d042a246.jpeg)  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/3/7/a/37acb296e3a74ccfd3ea43ed8d39a6120dea5769.jpeg)

So for me it seems that the corrects UV are not set to the rendermesh.

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 5, 2021, 11:30am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/11 "2021-02-05T11:30:36Z")

</div>

@laurent_delrieu Thanks for the model, it’s been of great value for me as I’ve been testing latest improvements for applying custom mesh mappings. So, things will improve slightly in the near future but there are also issues that need to be addressed some other way. I’ll explain one of the major cause for texturing issues on your model.

The model itself seems well modeled and clean. Also the simplified mapping mesh looks good. Problem is that the simplified mapping mesh has detail and discontinuity that gets mapped to the middle of a polysurface face. One such detail is the horizontal step:  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/6/9/86955f8b37bc6a40c91a7dc6c06961dd5d1703ac.png)  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/a/f/5af6a9552e18cb074e986a979dcca6acf058b19c.png)  
For Rendered mode the object gets baked and therefore it can present the discontinuities and result looks good.  
But FBX export always uses the original bitmap texture. Object mesh that is exported has faces that span the area where the discontinuity is. So in order to look correct FBX export would have to add unwelded edges to the exported mesh along the texture discontinuities - and we may add an option to do that in the future.  
Another issue is at the fillets. There are enough mesh edges along the fillets to present the texture discontinuity but unfortunately those edges are all welded - all internal edges on surface render meshes are always welded. So in order to correctly present that discontinuity FBX export should unweld those edges - and that is also something that might be added in the future.

But for now the best thing is to take these restrictions into account when working on texture mapping.

Am I making any sense?

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 5, 2021, 11:36am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/12 "2021-02-05T11:36:09Z")

</div>

One way to overcome the artifacts along the fillets is to split the fillet surfaces so that there will be an edge running right at the middle.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [February 5, 2021, 11:37am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/13 "2021-02-05T11:37:36Z")

</div>

> [@Jussi\_Aaltonen](#):
>
> But FBX export always uses the original bitmap texture.

Should we introduce an option in the exporter to bake all texture mappings? I imagine OBJ for instance would also benefit from that.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [February 5, 2021, 11:46am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/14 "2021-02-05T11:46:54Z")

</div>

In a local build with Raytraced now also getting baked goodness for custom object mappings

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/1/1/911833f28b1e1d99f2e7da7f8c2514f1d5b21955.jpeg)

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [February 5, 2021, 11:48am UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/15 "2021-02-05T11:48:09Z")

</div>

Thanks you are making sense, the confusion for me was the difference between raytraced and render.  
So on the workflow I have to find the best way to cope with these difficulties. It is quite hard to make “solid” model, model with thickness compatible with render model that usually doesn’t need that.  
So I need to ingest that 🤔  
Many choices

1. Surface modelling
2. Solid modelling and unwrapping everything
3. …

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 5, 2021, 12:07pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/16 "2021-02-05T12:07:57Z")

</div>

> [@nathanletwory](#):
>
> Should we introduce an option in the exporter to bake all texture mappings? I imagine OBJ for instance would also benefit from that.

That’s also one possibility. Although for example in this case the texture is already kind of baked and the UV layout is pretty efficient. So baking again with the standard Rhino baker would decrease the quality a little. It’s easy to test by running \_Bake 🙂

---

<div class="post-metadata">

**Author:** ![Jussi\_Aaltonen](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jussi_aaltonen/32/494409_2.png) [@Jussi\_Aaltonen](https://discourse.mcneel.com/u/Jussi_Aaltonen)\
**Post date:** [February 5, 2021, 12:12pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/17 "2021-02-05T12:12:13Z")

</div>

@laurent_delrieu Here’s a tip for how to find the places that cause texture artifacts:

1. Mesh the object using dense settings like these:  

2. Then look at the Rendered mode. Artifacts tend to converge towards the places where the mapping has problematic discontinuities:

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [February 5, 2021, 12:50pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/18 "2021-02-05T12:50:46Z")

</div>

@Jussi_Aaltonen thanks for the tips.  
@nathanletwory having consistency between render and raytraced is a good thing if we stay in Rhinoceros but as far as I understand, there will be some problem after export as other tools will use the texture bitmap.

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [February 5, 2021, 12:51pm UTC](https://discourse.mcneel.com/t/having-hard-times-with-textures-bug/117560/19 "2021-02-05T12:51:47Z")

</div>

> [@laurent\_delrieu](#):
>
> Rhinoceros but as far as I understand, there will be some problem after export as other tools will use the texture bitmap.

Yes, that is why I’m pondering if we should have the ability for exporters to use baked bitmaps instead.
