Edges visible after baking textures

Hi!
I have a question and I hope I will be able to explain it properly… Let’s see:
I have a basic model, just some walls, and I need to bake the textures (full render baking) to export it with the OBJ and use it in WebGL.


The problem is that, when I bake it, all edges are visible, even if they are between 2 faces in the same plane, and it is really annoying. They are exported into the texture itself, and visible in WebGL, of course.


What would be the perfect workflow to do this job? I guess that I can’t do it in Cycles, because Cycles is not exporting texture information with the OBJ (too bad!!), so I have to go with Blender Internal. But, as you can see, baked texture shows edges everywhere.

I tried decimating my mesh, but resulting UV is absolutely a mesh,and I will like to try to avoid that if there is a better way to do it.

Any kind of help will be appreciated! :smiley:

This can only mean your mesh or UV map is not clean. Make sure you don’t have any overlapping geometry, that your intersections are joined properly and that all faces are UV mapped properly too. Prefer using Lightmap pack for baking the light and AO.

Cycles DOES export textures with obj files (that’s the mtl files that come with them). Maybe you accidentally disabled “Write Materials” in the export options ?
Or maybe you didn’t set up a material for your object.

Thanks for your answer!

Yes, I use Lightmap pack unwrapping, and I make sure that faces are not overlapping. Let me show you how it looks. This is the general aspect:


And this is a zoom of it:


As you can see it is a very basic structure, just squares.

About Cycles exporting textures, I am pretty sure it doesn’t. It exports MATERIALS, specified in the MTL. But no references to the textures, no references to the images that should be loaded. Blender Internal does show in the MTL info about the image files that need to be loaded, but Cycles doesn’t. Try it, you will see what I am talking about.

Thanks!

rayjaken and ChameleonScales, I don’t want to ruffle anyone by interjecting into your discussion. But I agree with rayjaken. In my experience, no cycles does not export .obj texture references. The fbx export/import works much better with cycles materials, if it would fit your purpose.

EDIT: Scratch what I said about fbx export. I do a lot of importing and fbx imports well with cycles. The export IS flaky though. The different import/export routines are all built as separate add-ons and have(or lack) different features.

Thank you for your comment!

Yepp, as far as I know, exporting texture references from Cycles is problematic because of the way Cycles works (I have read that, as it works with nodes, it is not possible to export textures as you do in Blender Internal… although I don’t see the point…). It’s very frustrating in fact :frowning:

Not sure I get it. I did test it before posting. When I export an object with a texture to a wavefront obj while being in Cycles and then import the obj from a new file, the texture is still there, and you can see the mtl file includes the path to the texture :


# Blender MTL File: 'None'# Material Count: 1


newmtl 108_ENV_DOMELIGHT
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd /home/caetano/Pictures/Textures et outils/HDRIs/108_ENV_DOMELIGHT.jpg

What it does not is import them for Cycles. Instead, the texture of the imported obj is only visible in Blender internal because the material is imported as a Blender render material.

:eek: No wayyyy! I have been doing that for MONTHS and there is no f***ing way of doing it, I have tried everything and I never have info about the texture in the MTL. Are you sure you exported it from Cycles, not from Blender Internal??? how do you do that? Can you please add some screenshots??? I really want to know! :open_mouth:

Yeah I can see material reference in cycles obj’s mtl export too.






I tried even by adding a bunch of nodes between the image and the diffuse shader, and also tried different shaders like Anisotropic BSDF. It always worked.
I did a short video to demonstrate :

@critch, @ChameleonScales guys, thank you very much!! But I swear that I can’t find where is my mistake, but I still can not do it!!
I have just recorded a video to show you how I do it. Please, if I am blind and I can’t see my mistake, help me. What in hell am I doing wronggggg??

Try setting up your texture with UVs. I am guessing obj exporter knows nothing about Blender generated texture placement method.

@critch no that’s not it.

You were actually partially right rayjaken, Cycles doesn’t allow to export materials to obj as good as Blender internal does.
You can however export an obj with a single image texture without making a Blender internal material (like you tried in your video) by adding these steps :

  • temporarily switch to Blender internal (without touching the material)
  • enter Edit mode
  • in the UV/Image Editor, select the image
  • exit Edit mode
  • Switch back to Cycles
  • export

This weird behavior is caused by the old way (when there was no Cycles) of assigning a texture to an object to perform operations like Baking, texture painting or others. So you should remember this little trick for other texture issues you will encounter in the future. Hopefully this will change in 2.8.

But if you want to export a multi-texture material (with normals and such) you have to make a Blender internal material.

@chameleonscales thanks!! I’m gonna try it. Did you do it in your video?? You went into blender internal before exporting? Cause I didn’t see it, maybe you did too fast. If you didn’t, why is it that I have to do it and you don’t? Does it depend on blender version? I don’t get it :confused:

It’s the images as planes addon that does that automatically. It sets up the material for the active render engine when opening the image, but also sets the image as face assigned texture (image assigned to UV faces) for Blender internal.

@JA12 thanks!! Ahhh!!! That’s the trick!!! :smiley: :smiley: I knew that there was something that I was missing…
So, all in all, I should create it in Cycles, change to Internal, edit it in UV editor, and go back to cycles to export? It is SOO WEIRD…

!!! what’s SOO weird is YOUR writing style!!

With exporting you can continue what you were doing. Cycles materials don’t export, Blender internal materials do. The material definitions in the .mtl file are from Blender internal and for specular workflow, Cycles uses different material system.

Well I’m sorry if you don’t like my writing style, I am not english-native :stuck_out_tongue: I do my utmost.

So, we go back to the begining: cycles will not export the texture information. But @chameleonscales and @critch say they do.

Well after that I said “not as good as Blender internal” because it doesn’t export more than one texture. But why is it important that you do the material in Cycles if you export it for WebGL anyway ?

Thanks ChameleonScales. It is possible, just got to jump the proper hoops.

Take care!

Me neither, english is my third language. That’s one of the reasons I don’t like all the bells, whistles, jelly, and a severed arm around a simple text. Trying to read and understand what you’re saying and the extra crud is not helping.

The other reason is that this is a support forum. Obviously you want to be understood and help people to read and reply to what you write. Using paragraphs and common sense is enough to do that. Uppercasing acronyms is fine.

Uppercasing normal words have no use on a support forum. I know native english speakers try to use it for emphasis but as you might have already noticed, native speakers couldn’t care less about english. For one it mixes with the acronyms. If you need to be clear about something, use pictures. If you want to express an emotion, use an emoticon. Sparingly though, otherwise the message says you’re a trainwreck. And if you want to emphasize gratitude, $5 or $20 on a paypal account says you really mean it more than 5 or 20 exclamation marks after “thanks”. Some even do that by saying “I love you”. If that is the case, then you might opt for chocolate and flowers, even if it’s for a guy :smiley:

The third reason is that this is a forum about visual arts and composition is one of the fundamentals. Composition rules apply to text.

Those are my reasons. Wasn’t commenting on that just to make a remark.