render bug in freestyle #47111

Closed
opened 2016-01-02 18:27:42 +01:00 by Torsten Mohr · 15 comments

Hello,

in the attached render result there is a line that i can't explain. I also attached the BLEND file that directly leads to this render result.

{F271347}bug_freestyle.png

Best regards
Torsten

Hello, in the attached render result there is a line that i can't explain. I also attached the BLEND file that directly leads to this render result. {[F271347](https://archive.blender.org/developer/F271347/bug_freestyle.blend)}![bug_freestyle.png](https://archive.blender.org/developer/F271345/bug_freestyle.png) Best regards Torsten
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @tmohr

Added subscriber: @tmohr
Member

Added subscriber: @Blendify

Added subscriber: @Blendify

Added subscriber: @ignatz

Added subscriber: @ignatz

I downloaded the blend file (bug_freestyle.blend) and had a look.

There is an extra line showing in the render, but I do not believe that this is really a freestyle bug.

The mesh is very simple, consisting of nothing more than extruded cubes which are then curved by the armature. This is actually producing non-planer mesh elements.

I think that what is happening is that when Blender breaks this down into (legal) triangular polys prior to the render we end up with some unexpected geometry.

If you just add in the "triangulate" modifier ahead of the armature modifier in the stack then the rendered result will be just fine.

Of course, this does beg the question as to just why there is a difference in the way that the render engine breaks down the mesh as opposed to the way that it happens when we use the triangulate modifier. That is, perhaps, the real bug here... if it is even a bug.

I downloaded the blend file (bug_freestyle.blend) and had a look. There is an extra line showing in the render, but I do not believe that this is really a freestyle bug. The mesh is very simple, consisting of nothing more than extruded cubes which are then curved by the armature. This is actually producing non-planer mesh elements. I think that what is happening is that when Blender breaks this down into (legal) triangular polys prior to the render we end up with some unexpected geometry. If you just add in the "triangulate" modifier ahead of the armature modifier in the stack then the rendered result will be just fine. Of course, this does beg the question as to just why there is a difference in the way that the render engine breaks down the mesh as opposed to the way that it happens when we use the triangulate modifier. That is, perhaps, the real bug here... if it is even a bug.

Added subscribers: @kjym3, @mont29

Added subscribers: @kjym3, @mont29
Tamito Kajiyama was assigned by Bastien Montagne 2016-01-03 16:01:07 +01:00

Let’s see what @kjym3 has to say about it. ;)

Let’s see what @kjym3 has to say about it. ;)

Just to confirm what @ignatz said, adding a Triangulate mesh modifier gives Freestyle lines consistent with the Solid render component. Without the extra mesh modifier, Freestyle seems to compute lines based on geometry data that is different from what Cycles and the Blender Internal actually see.

So the problem is where that inconsistency of geometry data comes from. I've never seen this kind of discrepancy and I have no idea of how to fix it. @mont29, do you have any thoughts?

Just to confirm what @ignatz said, adding a Triangulate mesh modifier gives Freestyle lines consistent with the Solid render component. Without the extra mesh modifier, Freestyle seems to compute lines based on geometry data that is different from what Cycles and the Blender Internal actually see. So the problem is where that inconsistency of geometry data comes from. I've never seen this kind of discrepancy and I have no idea of how to fix it. @mont29, do you have any thoughts?

Added subscriber: @AnthonyEdlin

Added subscriber: @AnthonyEdlin

I did a little debugging on this and have a little more info to give.

First, this is only happening on cycles render, if you switch to blender internal the quads are split the same as freestyle is showing. Here are some renders:

Viewport:
Viewport.png

Cycles:
Cycles.png

Internal:
Internal.png

The function that is splitting the quads in the internal pipeline is check_non_flat_quads in convertblender.c file. There is a setting under Scene properties tab and on the Simplify panel called Skip Quad to Triangles. If you set this then this function is not called and you can see the result here:

SkipQuad.png

It has the same quads as viewport and cycles but looks like there is some rendering artifacts at least with my settings.

Probably it would be good if quad splitting was consistent across viewport/internal/cycles but finding the best way to do that is probably beyond my knowledge right now. Hope that helps narrow down the issues here. Good luck.

I did a little debugging on this and have a little more info to give. First, this is only happening on cycles render, if you switch to blender internal the quads are split the same as freestyle is showing. Here are some renders: Viewport: ![Viewport.png](https://archive.blender.org/developer/F271814/Viewport.png) Cycles: ![Cycles.png](https://archive.blender.org/developer/F271816/Cycles.png) Internal: ![Internal.png](https://archive.blender.org/developer/F271818/Internal.png) The function that is splitting the quads in the internal pipeline is check_non_flat_quads in convertblender.c file. There is a setting under Scene properties tab and on the Simplify panel called Skip Quad to Triangles. If you set this then this function is not called and you can see the result here: ![SkipQuad.png](https://archive.blender.org/developer/F271823/SkipQuad.png) It has the same quads as viewport and cycles but looks like there is some rendering artifacts at least with my settings. Probably it would be good if quad splitting was consistent across viewport/internal/cycles but finding the best way to do that is probably beyond my knowledge right now. Hope that helps narrow down the issues here. Good luck.

@kjym3 Spent some time on this this morning, was suspecting some mismatch in tessellation between freestyle and the renderers, but…

I tried forcing one 'middle edge' or the other in both BlenderFileLoader::insertShapeNode() check places, but gave me no change in result, which I find pretty odd. :|

Freestyle does only work on triangles, right?

@kjym3 Spent some time on this this morning, was suspecting some mismatch in tessellation between freestyle and the renderers, but… I tried forcing one 'middle edge' or the other in both `BlenderFileLoader::insertShapeNode()` check places, but gave me no change in result, which I find pretty odd. :| Freestyle does only work on triangles, right?

Really I don't think it's a freestyle issue. Freestyle just uses blender's internal render database to get tri/quads. In this case if you use internal render and not cycles render you get the freestyle lines to match up. So issue is that internal render and cycles render do not do same quad splitting. You can see all of this in my post above. The function that does the internal render database quad splitting is check_non_flat_quads(). I'm not sure how cycles does quad splitting but it seems to always match viewport so it probably just always splits on vert index rather then doing any normals testing like check_non_flat_quads() does.

So possible fixes to this could be.

  1. Make internal render not do the quad splitting, or make it always split on index rather then testing which way to split. This I think would make internal/cycles/freestyle/viewport all have same look, but could make old files internal render different.

  2. Make cycles use same quad splitting as internal. You would have to reimplement check_non_flat_quads() in cycles somewhere. This would make internal/cycles/freestyle have same look, but viewport would show different quad splits in some cases, unless you could also reimplement check_non_flat_quads() for viewport also. Could also make old cycles renders different.

  3. You could also change freestyle to detect which renderer is being used and also make sure it is sent non-split quads from internal renderers database. This way freestyle could split quads either like internal render or like cycles render based on which is being used at the time. Internal render and cycles render would still have inconsistent quad splitting.

I personally think trying to make quad splitting consistent is the way to go.

Really I don't think it's a freestyle issue. Freestyle just uses blender's internal render database to get tri/quads. In this case if you use internal render and not cycles render you get the freestyle lines to match up. So issue is that internal render and cycles render do not do same quad splitting. You can see all of this in my post above. The function that does the internal render database quad splitting is check_non_flat_quads(). I'm not sure how cycles does quad splitting but it seems to always match viewport so it probably just always splits on vert index rather then doing any normals testing like check_non_flat_quads() does. So possible fixes to this could be. 1) Make internal render not do the quad splitting, or make it always split on index rather then testing which way to split. This I think would make internal/cycles/freestyle/viewport all have same look, but could make old files internal render different. 2) Make cycles use same quad splitting as internal. You would have to reimplement check_non_flat_quads() in cycles somewhere. This would make internal/cycles/freestyle have same look, but viewport would show different quad splits in some cases, unless you could also reimplement check_non_flat_quads() for viewport also. Could also make old cycles renders different. 3) You could also change freestyle to detect which renderer is being used and also make sure it is sent non-split quads from internal renderers database. This way freestyle could split quads either like internal render or like cycles render based on which is being used at the time. Internal render and cycles render would still have inconsistent quad splitting. I personally think trying to make quad splitting consistent is the way to go.

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This is solved in 2.8, where freestyle uses the same triangulation as everywhere else in Blender.

This is solved in 2.8, where freestyle uses the same triangulation as everywhere else in Blender.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#47111
No description provided.