Stop textures warping on a triangle shape

Hi there, I hope you can help me! I’ve been stuck at how to stop textures warping on a triangle shape. When in Cinema 4d, I can change the texture to ‘cubic’ and it ignores this. I would like to know if there is a particular shader in Unity or other method that can ignore the shape of the triangle and just cover the shape with the texture as it is (the cladding is meant to be going up - lines vertical).

Here is a screenshot of my Unity Project so you can see how this warping occurs.
It seems like there should be an easy way to do this but I can’t seem to find it!

Any help appreciated. :slight_smile:

!( Say hello to the new Starter Asset packages page-8)

You’d probably be better-off just editting the UVs of these faces.

You could use a shader that uses world-space triplanar projection to apply textures, but I don’t believe Unity comes with anything like that. You can find tutorials on the web about how to code one or make one with Shadergraph.

If they’re using URP or HDRP, there’s a triplanar node in Shader Graph.

Go to the UV editor and keep the tag in UV mode. Also try subdividing the triangle as phong shading will do this if it doesn’t have enough vertices to subdivide the texture for mapping across the vertex corners.

as previously mentioned
8445578--1119836--set.jpg

Hi there, appreciate all the replies but I am using SRP (not URP or HDRP) - is there a way to edit the UV Mapping in, say, a legacy shader like ‘Diffuse’? (Which is what I have been using whilst learning, as it seemed to be the only way I could add image based textures). Or should I use another shader that also allows me to add images?

Shaders have nothing to do with UV editing. I was only mentioning world-space triplanar projection as an alternative to using UVs.

To edit UV mapping you’d need to use a 3D modelling app like Blender, or you could use Unity’s Probuilder package. There’s no built-in way to edit UV’s in the Unity Editor aside from scripting.

This needs to be fixed in your 3D modelling app.

I’m unfamiliar with the specifics of Cinema4D but if it looks correct in that app then I suspect the ‘cubic’ mapping you are applying is a modifier that is not being applied when exporting to fbx. You do export to fbx? If not then I guess Unity will open Cinema4D and export to fbx automatically, but that might miss applying such modifiers as mentioned above.

So IMHO you need to google Cinema4D exporting and make sure applying ‘cubic’ mapping is applied to the uvs and not simply a modifier on top of the uvs. In most 3d apps when exporting to fbx you should have an option to ‘apply modifiers’ or similar. So you should either be able to apply modifiers during export or at once you’ll have to apply the modifier in the app and make it permanent.

If none of that works, my suggestion would be to export to fbx and re-import it into Cinema4D and check the results. If you still can’t get Cinema4D to uv map correctly then open the fbx in Blender and do it there. Finally if you have no means to export fbx from Cinema4D there is a Unity package to export assets to fbx that might help you out.

In short if you can’t fix it in Cinema4D - export to fbx - open in Blender - fix the uv - export to fbx - import to unity.

I gave him the method In C4D to do it. He just has to convert the tag using the menu to change it to UV coords. It will then lay out the UV map according to the tag modifier.

1 Like