Alpha channel is not respected by emission (or some/any other) shaders, connected to one of two duplicated image texture nodes, one with alpha on and the other with alpha off. #50032

Closed
opened 2016-11-15 03:10:19 +01:00 by Ales Volcini · 8 comments

System Information
Windows 7, Linux Mint 17.3 (in VirtualBox)
AMD R9 Nano

Blender Version
Broken: 2.78a

Short description of error
See screenshot - Cube is glowing instead of glowing only at the bottom.

Screenshot.png

Exact steps for others to reproduce the error
Have a png or tga texture file, RGB channel for diffuse and alpha to specify emission region.
Create a mesh, switch to cycles, import the texture, duplicate it, set up other nodes, set alpha to off for the texture connected to the diffuse node. Render will be invalid one.
Pack one of the textures to blend file, render will become valid.
Unpack it again, preview is still valid until F12 rendering, but the render result is again invalid. Preview also becomes invalid after some parameter change happens (eg. emission strength is changed).

See attached blend file emission test1.zip.

It appears there is the same effect if emission shader is swapped for a different one. I also noticed texture preview hints at the correct result, if the alpha mode is set to straight and the incorret result, if the alpha mode is set to premultiplied. Material preview however does not reflect any changes. My guess is Alpha mode: Straight is somehow ignored.

Ales

**System Information** Windows 7, Linux Mint 17.3 (in VirtualBox) AMD R9 Nano **Blender Version** Broken: 2.78a **Short description of error** See screenshot - Cube is glowing instead of glowing only at the bottom. ![Screenshot.png](https://archive.blender.org/developer/F400874/Screenshot.png) **Exact steps for others to reproduce the error** Have a png or tga texture file, RGB channel for diffuse and alpha to specify emission region. Create a mesh, switch to cycles, import the texture, duplicate it, set up other nodes, set alpha to off for the texture connected to the diffuse node. Render will be invalid one. Pack one of the textures to blend file, render will become valid. Unpack it again, preview is still valid until F12 rendering, but the render result is again invalid. Preview also becomes invalid after some parameter change happens (eg. emission strength is changed). See attached blend file [emission test1.zip](https://archive.blender.org/developer/F400879/emission_test1.zip). It appears there is the same effect if emission shader is swapped for a different one. I also noticed texture preview hints at the correct result, if the alpha mode is set to straight and the incorret result, if the alpha mode is set to premultiplied. Material preview however does not reflect any changes. My guess is Alpha mode: Straight is somehow ignored. Ales
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @avolcini

Added subscriber: @avolcini

Added subscriber: @FloridaJo

Added subscriber: @FloridaJo

I see that when I use your png, but when I create one from Gimp I'm not seeing that.
Can you try this image attached in place of test003.png

JTest2.png

I see that when I use your png, but when I create one from Gimp I'm not seeing that. Can you try this image attached in place of test003.png ![JTest2.png](https://archive.blender.org/developer/F425940/JTest2.png)
Author

I don't think it's a file type related problem, a tga texture has the same result.
I came across this problem with textures used for Valve Source engine, where there is a diffuse channel combined with an emission one (or transparency, bump etc. (i.e. noncolor data, however this texture setting does not change anything visible in this setup).

Since I could not extract only the alpha channel, I duplicated the image texture node, made one a single-user copy so they didn't share alpha setting, switched off alpha in one for the diffuse shader (since black alpha affects color, too) and used only the alpha in second to select regions with emission. Before I tried with straight and premultiplied alpha, too, with no effect.

I used your texture, it does the same (see emission test3.blend in a zip below). Just switch 'viewport shading' to 'rendered' mode and when you'll click "pack an image as embedded", it will render in a way (i think) it should be - where alpha is 0, non-glowing. Funny thing: the material preview (on the right side of screenshots) is ok in both cases. Using same texture in two separate files renders ok. A case with both textures packed renders ok, too. It's just the case when the texture source is in the same actual file even if it's 'single-user copy'.

emission tests.zip

Emission test3.blend before'pack' (incorrect): Screenshot before.jpg After (correct): Screenshot after.jpg

I also attached another test - emission test2.blend - with texture (also made with gimp, first one was made with gimp too, so that's not related to a program).

Before (incorrect render): Screenshot3.jpg After 'pack' (correct render): Screenshot4.jpg
Funny again, the material preview on the right side seems ok in both cases.

I don't think it's a file type related problem, a tga texture has the same result. I came across this problem with textures used for Valve Source engine, where there is a diffuse channel combined with an emission one (or transparency, bump etc. (i.e. noncolor data, however this texture setting does not change anything visible in this setup). Since I could not extract only the alpha channel, I duplicated the image texture node, made one a single-user copy so they didn't share alpha setting, switched off alpha in one for the diffuse shader (since black alpha affects color, too) and used only the alpha in second to select regions with emission. Before I tried with straight and premultiplied alpha, too, with no effect. I used your texture, it does the same (see emission test3.blend in a zip below). Just switch 'viewport shading' to 'rendered' mode and when you'll click "pack an image as embedded", it will render in a way (i think) it should be - where alpha is 0, non-glowing. Funny thing: the material preview (on the right side of screenshots) is ok in both cases. Using same texture in two separate files renders ok. A case with both textures packed renders ok, too. It's just the case when the texture source is in the same actual file even if it's 'single-user copy'. [emission tests.zip](https://archive.blender.org/developer/F426290/emission_tests.zip) Emission test3.blend before'pack' (incorrect): ![Screenshot before.jpg](https://archive.blender.org/developer/F426278/Screenshot_before.jpg) After (correct): ![Screenshot after.jpg](https://archive.blender.org/developer/F426280/Screenshot_after.jpg) I also attached another test - emission test2.blend - with texture (also made with gimp, first one was made with gimp too, so that's not related to a program). Before (incorrect render): ![Screenshot3.jpg](https://archive.blender.org/developer/F426286/Screenshot3.jpg) After 'pack' (correct render): ![Screenshot4.jpg](https://archive.blender.org/developer/F426288/Screenshot4.jpg) Funny again, the material preview on the right side seems ok in both cases.

This issue was referenced by blender/cycles@0f7a17a023

This issue was referenced by blender/cycles@0f7a17a0230787dfd062a6c702d044de04325e4f

This issue was referenced by ced20b74e5

This issue was referenced by ced20b74e58f3dd33840f2a62f6f1f19714b35d7

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
4 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#50032
No description provided.