What's wrong with this render bake?

(archis) #1

I have noticed a very specific type of triangular-shaped artefact in various places across the mesh while doing some full render baking to UV. (The mesh is strictly quads, btw – no tris.) Here are some screenshots of the same area of the object in different baked images:
. . . . . .

[INDENT]Image 1 . . . . . . . . . . . . . . . . . . . Image 2 . . . . . . . . . . . . . . . . . . . Image 3

[INDENT] Image 4
[/INDENT][/INDENT]- - - - - - - - - - - - - - - - - - -

Image 1 is cropped from a 1024x1024 px bake with lighting (area & hemi) and additive ao. The triangular patterns are clearly visible in the shaded area.

Image 2 is cropped from a 4096x4096 px bake of the same area, again with lighting and ao. The triangular patterns are less pronounced but still visible.

Image 3 is a 1024x1024 px bake of the same area of the object, this time with all mesh faces set solid (much darker because I disabled ao this time). Triangular shapes all over the place – everything’s worse, not better :confused:

Image 4 shows the same artefacts using a darker material, where they are more obvious, on a 1k bake I believe.

I am using area lights as well a two hemi lamps for illumination, as well as (additive) AO. Update: I have two sky hemis overhead and I realize that many of the areas where this shows up seem to be where the light hits the surface lengthwise (i.e. as opposed to perpendicular). Would this be consistent with a terminator problem? (Update: Probably not – I think I’ve figured it out, see below and subsequent posts).

At first I thought the AO might be interfering with the mesh, but AFAIK that’s not consistent with triangular artefacts - ao might cause dark lines along some mesh edges but not this kind of thing. In fact, I saw several unrelated, thin striations in some areas that went away after some ao bias tweaking but the triangular artefacts persist when I turn AO off.

Then I looked into the UV layout. The UV layout is square (for game import), and some faces are clearly more stretched than others. Perhaps Blender’s UV map might have trouble with the subsurf modifier (I added SS after unwrapping), so I decided to apply the subsurf and unwrap the mesh again. My thinking was that if there’s excessive stretching at some of the faces, the denser mesh would help. In fact, the dense mesh is stretching a lot less. However, it made no difference with respect to the artefacts: Image 2 above was baked to the original mesh, while Image 1 was baked to the new dense mesh. (There is a slight improvement in Image 2 over Image 1, which I believe is caused by the increased pixel resolution – but the triangular bits look exactly the same, even though the underlying mesh has 16 times as many faces in Image 1). Update: I believe the triangular bits are due to the way the render bake process works, and is unrelated to the underlying mesh – it depends on the pixel resolution of the baked image. In other words, if the baked image size stays the same, so does the size & shape of the artefacts. The problem occurs when the render bake visits the same UV face for the second time and calculates the shading slightly differently. See posts below.

Q. Can Blender’s UV maps handle subsurf modifiers? Update: Yes they can since 2.41, using the UV Subsurf
button in the mesh editing panel. I enabled this from the beginning and my dense mesh experiment seems to show that my original UV layout can handle the stretching well.

One area I had not looked at at this point was smoothing. So I set all faces to solid and rebaked, with the results as in Image 3 above. So there seems to be a connection to mesh smoothing, but setting to solid is no cure - in fact, things are a lot worse with the faces set to solid. Update: If there’s an issue with smoothing in certain areas of the mesh, I suppose I could try to control the smoothing there with vertex groups and the Smooth modifier (I haven’t tried that yet). Also: I am using a default subsurf, no additional creasing and also no auto-smoothing.

The only clear improvements I can see come with increased pixel resolution as in Image 2. Are there other ways to remedy this?

Side Note: I also found some “jagged edges” in the bake, seemingly at a spot where the hemi lamps interact with my material settings. Picture:

This might be the same kind of “jaggedness” another poster referred to a little while ago. Again, increasing the baked image resolution helps – the jaggedness decreases but the border between highly reflective and less reflective areas always looks a little awkward. Are there ways to control the mirror reflection (is what I think it is) of the material more precisely? Also, I am using blender’s internal raytracer as I haven’t had time to familiarize myself with yafray. Is this one of those things yafray might be able to do better? Update: I improved the result by slightly decreasing the RayMir value of the material (wich was low to begin with). I still think yafray or sunflow might be able to help a lot with this, though. Another Update: this is an ideal candidate for broken’s new blurry reflections – I can crank up the raytraced reflection and blur the result to fit in perfectly with the blurred spec highlights underneath. Thanks, broken :slight_smile:



(archis) #2

After taking a close look at the mesh region, I’m now focusing on subsurf & UV again. Pic (click to enlarge):

This is the same area of the mesh as depicted in the render bakes above, Image 1-3. The normals are ok (sanity check) but the render artefacts of the bake appear to coincide with the overlapping surfaces that you get in Edit Mode with Draw Subsurf in Edit Mode disabled, i.e.:

  • Edit Mode
  • Solid Mesh Shading
  • Subsurf modifier enabled
  • UV Subsurf in the subsurf mod panel enabled
  • Draw Subsurf in Edit Mode in the subsurf mod panel not enabledThese surface overlaps occur in places where there’s some significant surface stretching going on along more than one axis. These overlaps are not always visible – they are dependent on the viewing angle, it seems – but the artefatcs seem to beat or near the same locations where they can be observed.

Side Note: I can’t seem to switch the UV Subsurf option off. By that I mean that when I uncheck UV Subsurf and then rebake, I seem to get the exact same result as when it is checked. Do the Optimal Draw and UV Subsurf options only “work” at the time you unwrap the mesh?


(RamboBaby) #3

Upload your file. I’ve never had any real problems with baking. It’s not perfect but it’s usually pretty good.



(archis) #4

I’ve found the same artefacts on full render bakes from other meshes as well; wherever the subsurf alters the mesh surface in such a way that it shows up in edit mode with Draw Subsurf in Edit Mode disabled. Often, those places are where the subsurf bends the surface outwards so as to obscure the wireframe in places.

Update: the image text should read Overlaps with Draw Subsurf in Edit Mode disabled.

It’s less obvious on dense meshes and in places where the surface deviation is less pronounced. I’ve decided to redo the mesh with the really ugly bake artefacts with an eye on avoiding these overlaps and press on.

If my theory is correct, this behaviour should be easy to reproduce:

  • Create a simple mesh with sharp angles between adjacent faces in such a a way that the surfaces bend outwards along the normal to obscure some of the edges / vertices of the wireframe in Edit Mode with Subsurf modifier enabled and Draw in Edit Mode disabled (see image above).
  • Unwrap the mesh and do a full render bake.
  • The baked texture should show artefacts in places where the surface obscures the wireframe’s edges & vertices in the 3D view mode described in step 1.I have not tested whether this happens because I’m using (and baking) procedural textures on these objects.

(archis) #5

Here’s a .blend file with example render bakes on two different materials, one using procedurals and the other not.


The artefacts occur on both materials, where the surface starts to bend inwards or outwards. The location of the artefacts seems to roughly coincide with the surface overlaps you can see on the mesh when the Enable Modifier during Edit Mode button in the Subsurf modifier panel is unchecked. Thoughts?


(RamboBaby) #6

Disable Ray Mirror B4 you bake.


(Roger) #7

I didn’t wanted to start a new topic, so perhaps it’ll be answered if I ask it here.

Can I make Indigo renderings to a texture? I like Indigo’s render outputs and thought how great it would be to see stuff like that in real time… Idea’s?

Oh and sorry to bump this threat, but it looks answered :D.