Cycles texture interpolation issues #43779

Closed
opened 2015-02-22 18:14:12 +01:00 by Hilbert Jonker · 16 comments

System Information
OS: Ubuntu Linux 14.04 64 bit
Graphics: nVidia GeForce GTX 560 Ti

Blender Version
Broken: 2.73a bbf09d9
(Tested with same result on 2.67 and 2.70)

Short description of error
With a transparent shader and a PNG image the first or top row and the first or left most column seems to pick the color and transparency of the row or column on the other side of the image (i.e. bottom row and right most column, respectively). An off-by-one error?

Exact steps for others to reproduce the error
See attached .blend file: Test_transparency.blend (the test image should be packed in it).

  • Create a plane.
  • Connect a mix shader with transparent BSDF (top) and diffuse BSDF (bottom) to surface.
  • Add a PNG image texture with transparency.
  • Connect image color output into diffuse shader and alpha into fac of mix shader.
  • UV map plane to the image - note: use complete image till border.
  • Look at rendered viewport or render an output image.

Note: workaround
When you do not use the top most row and the left most column of the image the transparency will work as expected.

**System Information** OS: Ubuntu Linux 14.04 64 bit Graphics: nVidia GeForce GTX 560 Ti **Blender Version** Broken: 2.73a bbf09d9 (Tested with same result on 2.67 and 2.70) **Short description of error** With a transparent shader and a PNG image the first or top row and the first or left most column seems to pick the color and transparency of the row or column on the other side of the image (i.e. bottom row and right most column, respectively). An off-by-one error? **Exact steps for others to reproduce the error** See attached .blend file: [Test_transparency.blend](https://archive.blender.org/developer/F145282/Test_transparency.blend) (the test image should be packed in it). - Create a plane. - Connect a mix shader with transparent BSDF (top) and diffuse BSDF (bottom) to surface. - Add a PNG image texture with transparency. - Connect image color output into diffuse shader and alpha into fac of mix shader. - UV map plane to the image - note: use complete image till border. - Look at rendered viewport or render an output image. **Note: workaround** When you do not use the top most row and the left most column of the image the transparency will work as expected.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @hilbert

Added subscriber: @hilbert

#43795 was marked as duplicate of this issue

#43795 was marked as duplicate of this issue
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Can confirm that. Using viewport texture mode, everything looks fine, so maybe it's a cycles texture mapping issue? Assigning to sergey in case he gets bored with dependency graph ;)

Can confirm that. Using viewport texture mode, everything looks fine, so maybe it's a cycles texture mapping issue? Assigning to sergey in case he gets bored with dependency graph ;)
Sergey Sharybin was assigned by Julian Eisel 2015-02-23 19:55:07 +01:00

Added subscriber: @ZauberParacelsus

Added subscriber: @ZauberParacelsus

I see it on both final render and in rendered viewport.

I think this may be a fundamental issue with texture interpolation. I've seen it in other 3D applications (such as Second Life), where if you have 1x1 repeats on a cube, you'll see some edges interpolated against the opposite side of the texture. What I usually do in those cases is set the repeats to 0.995 x 0.995. I tried that workaround on the example .blend file using the Vector->Mapping node, but it didn't work unfortunately.

Anyways, there are a couple workarounds you can use.

  1. On the Image Texture node, go to the 2nd dropdown, and change it from Linear to Closest. Doing so will turn off smooth interpolation, so if you zoom in the pixels won't be smoothed, they'll be hard-edged. If you're only using this for big solid colors and aren't using any curved or angled shapes (much like the example image), this won't hurt anything.
  2. Another possible workaround would be to use a higher-resolution texture, and perhaps putting a 1px thick alpha border around all sides of the image, so that there is no bleed-through.
I see it on both final render and in rendered viewport. I think this may be a fundamental issue with texture interpolation. I've seen it in other 3D applications (such as Second Life), where if you have 1x1 repeats on a cube, you'll see some edges interpolated against the opposite side of the texture. What I usually do in those cases is set the repeats to 0.995 x 0.995. I tried that workaround on the example .blend file using the Vector->Mapping node, but it didn't work unfortunately. Anyways, there are a couple workarounds you can use. 1) On the Image Texture node, go to the 2nd dropdown, and change it from Linear to Closest. Doing so will turn off smooth interpolation, so if you zoom in the pixels won't be smoothed, they'll be hard-edged. If you're only using this for big solid colors and aren't using any curved or angled shapes (much like the example image), this won't hurt anything. 2) Another possible workaround would be to use a higher-resolution texture, and perhaps putting a 1px thick alpha border around all sides of the image, so that there is no bleed-through.
Sergey Sharybin changed title from Cycles transparent material to Cycles texture interpolation issues 2015-02-27 08:33:08 +01:00

Added subscribers: @SleepyMolecule, @zeauro, @MikePan, @Sergey

Added subscribers: @SleepyMolecule, @zeauro, @MikePan, @Sergey

At least one person with an nVidia card is unable to reproduce (https://developer.blender.org/T43795).

In #43795#291922, @MikePan wrote:
Cannot produce error either. Both render show the 1pixel border. GPU is a GTX970 running 347.09 Driver on Win7.

I experience texture offset using OpenCL on AMD hardware.

At least one person with an nVidia card is unable to reproduce (https://developer.blender.org/T43795). > In #43795#291922, @MikePan wrote: > Cannot produce error either. Both render show the 1pixel border. GPU is a GTX970 running 347.09 Driver on Win7. I experience texture offset using OpenCL on AMD hardware.

After playing with the transparency example and comparing the same result in the internal render, I'm inclined to say that this issue is more a lack of feature.
Exactly the same artifact appears in BI When using an Image or Movie type Texture, however under the Image Mapping section is the option Extension.
The setting Extend specifically repeats the edge pixels of the texture instead of wrapping around.
The setting Clip simply makes all pixels beyond the texture transparent.
The default setting Repeat wraps the texture, this seems the be the default behavior in cycles for any given image texture.
Using either the Extend or Clip settings immediately resolves the artifact.

Right now there is no way to change it, it seems. Having the option for Cycles Image Textures would solve this without work around's.
An interesting side note re: CPU / GPU texture offset, this example shows that the offset I am experiencing is down and left 1~ pixel, as the top line is slightly thicker and the left line is gone.
borderartifact.png (OpenCL GPU render on r7 260x, catalyst omega 14.12)
Although these topics are merged due to visual similarity, I feel that the CPU / GPU issue might be different?

After playing with the transparency example and comparing the same result in the internal render, I'm inclined to say that this issue is more a lack of feature. Exactly the same artifact appears in BI When using an Image or Movie type Texture, however under the Image Mapping section is the option Extension. The setting Extend specifically repeats the edge pixels of the texture instead of wrapping around. The setting Clip simply makes all pixels beyond the texture transparent. The default setting Repeat wraps the texture, this seems the be the default behavior in cycles for any given image texture. Using either the Extend or Clip settings immediately resolves the artifact. Right now there is no way to change it, it seems. Having the option for Cycles Image Textures would solve this without work around's. An interesting side note re: CPU / GPU texture offset, this example shows that the offset I am experiencing is down and left 1~ pixel, as the top line is slightly thicker and the left line is gone. ![borderartifact.png](https://archive.blender.org/developer/F146105/borderartifact.png) (OpenCL GPU render on r7 260x, catalyst omega 14.12) Although these topics are merged due to visual similarity, I feel that the CPU / GPU issue might be different?

I was able to repro the issue on both CPU and GPU/CUDA.

System Information
64bit Manjaro Linux, kernel 3.14.33
CPU: AMD Phenom II 970 Deneb quad-core
GPU: nVidia GTX 650 Ti, driver 346.35

I was able to repro the issue on both CPU and GPU/CUDA. **System Information** 64bit Manjaro Linux, kernel 3.14.33 CPU: AMD Phenom II 970 Deneb quad-core GPU: nVidia GTX 650 Ti, driver 346.35

Please un-merge #43795 (Texture Offset between Cycles CPU and GPU render) as it is unrelated, thanks!

Please un-merge #43795 (Texture Offset between Cycles CPU and GPU render) as it is unrelated, thanks!

I'm not sure why you consider #43795 unrelated. The root of the issue is exactly the same -- wrapping coordinates on the image boundary when doing interpolation. The fact that some devices does expected interpolation in this case doesn't make any difference in the root of the issue.

I'm not sure why you consider #43795 unrelated. The root of the issue is exactly the same -- wrapping coordinates on the image boundary when doing interpolation. The fact that some devices does expected interpolation in this case doesn't make any difference in the root of the issue.

This issue was referenced by e3461a02ac

This issue was referenced by e3461a02ac3617ee50a60601ed277b0cb65459ce

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by blender/cycles@92feda3bdf

This issue was referenced by blender/cycles@92feda3bdf9f8ea512391129635906033cf1c7e6
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
6 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#43779
No description provided.