Render and preview are different (alpha issue). #41844

Closed
opened 2014-09-15 22:17:01 +02:00 by paul geraskin · 36 comments
Member

System Information
linux 64

Blender Version
Daily build.

Short description of error
Render and preview are different. Possibly this is an issue.
Screenshot (Tested on CPU): http://i.imgur.com/M6ZNc3G.png
File: https://dl.dropboxusercontent.com/u/26887202/blender/test_shader.blend

But! If I put Non-transparent object to backgraund - render and preview will be the same.
undefined

Exact steps for others to reproduce the error

**System Information** linux 64 **Blender Version** Daily build. **Short description of error** Render and preview are different. Possibly this is an issue. Screenshot (Tested on CPU): http://i.imgur.com/M6ZNc3G.png File: https://dl.dropboxusercontent.com/u/26887202/blender/test_shader.blend But! If I put Non-transparent object to backgraund - render and preview will be the same. ![undefined](https://archive.blender.org/developer/F110614/undefined) **Exact steps for others to reproduce the error**
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @PaulGeraskin

Added subscriber: @PaulGeraskin

#104320 was marked as duplicate of this issue

#104320 was marked as duplicate of this issue

#47388 was marked as duplicate of this issue

#47388 was marked as duplicate of this issue
Author
Member

We get the same issue with alpha with Fire simulation system on my job. Transparent background works buggy.
Screenshot_1.png

We get the same issue with alpha with Fire simulation system on my job. Transparent background works buggy. ![Screenshot_1.png](https://archive.blender.org/developer/F110775/Screenshot_1.png)
Sergey Sharybin was assigned by Bastien Montagne 2014-09-16 17:00:04 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

Please always attach (valid, camera is missing in yours) compressed (option in Blender when saving) files here ;) test_shader.blend

Sergey, looks like a premultiplied/raw alpha issue?

Please always attach (valid, camera is missing in yours) compressed (option in Blender when saving) files here ;) [test_shader.blend](https://archive.blender.org/developer/F110778/test_shader.blend) Sergey, looks like a premultiplied/raw alpha issue?
Author
Member

We also tried to make AlphaOver. But result is a bit different. But almost the same as 3dViewer has.
bake.png

We also tried to make AlphaOver. But result is a bit different. But almost the same as 3dViewer has. ![bake.png](https://archive.blender.org/developer/F110779/bake.png)
Author
Member

Sorry, forgot about Camera. Just add default camera.

Sorry, forgot about Camera. Just add default camera.
Bastien Montagne changed title from Render and preview are different. to Render and preview are different (alpha issue). 2014-09-16 17:03:38 +02:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

It's not bug with cycles, it's a specific of visualizing premultiplied image in viewport and image editor. Viewport is like compositing the render result on the checker, image editor converts image to straight alpha first (because ogl is set up in a way it expects straight alpha in blender atm). Hence you've got differences in browsing the same image in viewport and image editor. And what's more funny here -- neither of the ways are correct or wrong -- this totally depends on what exactly you're investigating and expecting.

Not strictly speaking a bug, just a workflow and suecase question. I'll revisit this for 2.73. Thanks for the report anyway.

It's not bug with cycles, it's a specific of visualizing premultiplied image in viewport and image editor. Viewport is like compositing the render result on the checker, image editor converts image to straight alpha first (because ogl is set up in a way it expects straight alpha in blender atm). Hence you've got differences in browsing the same image in viewport and image editor. And what's more funny here -- neither of the ways are correct or wrong -- this totally depends on what exactly you're investigating and expecting. Not strictly speaking a bug, just a workflow and suecase question. I'll revisit this for 2.73. Thanks for the report anyway.
Author
Member

Ok.

Just don't forget to add it to 2.73. We need some solution for alpha.

Right now we cannot use any Additive Materials in Cycles. And this is really needed feature, especially for gamedev.

Alpha is not seen for additive things :( http://i.imgur.com/AIe0lsK.png

Also, how you will solve it in 2.73?

Thanks.

Ok. Just don't forget to add it to 2.73. We need some solution for alpha. Right now we cannot use any Additive Materials in Cycles. And this is really needed feature, especially for gamedev. Alpha is not seen for additive things :( http://i.imgur.com/AIe0lsK.png Also, how you will solve it in 2.73? Thanks.

Well, the thing is -- the underneath data is correct, it's just image editor which displays it differently from the viewport. To answer your question about fixes -- what exactly usage of the render results? As in, how they're being handled after the render engine in your pipeline?

Well, the thing is -- the underneath data is correct, it's just image editor which displays it differently from the viewport. To answer your question about fixes -- what exactly usage of the render results? As in, how they're being handled after the render engine in your pipeline?
Author
Member

With Additive Materials we achieve visual effects for waterfalls, engines, particles, lighting effects, etc. Additive materials are used in many engines. Even game engines like Unity/Unreal has "additive" checkbox.
Example of engine with additive material: http://wiki.blender.org/uploads/0/0a/Additiveaproach.png

All we need is just to get the same result as viewport has. Without premultiplication. Or have possibility to switch premultiplication off.

Here is another example i showed you https://dl.dropboxusercontent.com/u/26887202/blender/fc_buildings_198_frankenstein_laboratory_01.zip
Just render the blend file and there will be no alphe for additive material.

With Additive Materials we achieve visual effects for waterfalls, engines, particles, lighting effects, etc. Additive materials are used in many engines. Even game engines like Unity/Unreal has "additive" checkbox. Example of engine with additive material: http://wiki.blender.org/uploads/0/0a/Additiveaproach.png All we need is just to get the same result as viewport has. Without premultiplication. Or have possibility to switch premultiplication off. Here is another example i showed you https://dl.dropboxusercontent.com/u/26887202/blender/fc_buildings_198_frankenstein_laboratory_01.zip Just render the blend file and there will be no alphe for additive material.

In the buildings file it is a proper additive material, which represents no opaque and just light emission, meaning alpha=0 and rgb is set ot the emitted light. This is the only way you can composite layers together, and that's what's gonna to be stored in exr file.

Uncertainty begins when you want to make this light visible but keep it still semi-transparent. There's no easy answer on this how to achieve. And no proper math, for as afar as i concerned. One of the tricks would be to set alpha to the max or R,G,B,A of the input image and convert alpha from straight to premul in compositor. That image would be displayed and saved to formats like png in a way you expect it. This might give some major headache when compositing the final shot tho. But as said, for compositing it's all correct without tricks.

In the buildings file it is a proper additive material, which represents no opaque and just light emission, meaning alpha=0 and rgb is set ot the emitted light. This is the only way you can composite layers together, and that's what's gonna to be stored in exr file. Uncertainty begins when you want to make this light visible but keep it still semi-transparent. There's no easy answer on this how to achieve. And no proper math, for as afar as i concerned. One of the tricks would be to set alpha to the max or R,G,B,A of the input image and convert alpha from straight to premul in compositor. That image would be displayed and saved to formats like png in a way you expect it. This might give some major headache when compositing the final shot tho. But as said, for compositing it's all correct without tricks.

So yeah, it's rather a tricky topic, need more research in there and it might still be no "one-click" solution for some usecases.. Anyway, will try to make things at least more clear for the next release.

So yeah, it's rather a tricky topic, need more research in there and it might still be no "one-click" solution for some usecases.. Anyway, will try to make things at least more clear for the next release.
Author
Member

Thank you!
I hope it will be possible to achieve for next release.
You are our super-hero! :)

Thank you! I hope it will be possible to achieve for next release. You are our super-hero! :)
Author
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Author
Member

@Sergey hello again. We noticed that alpha is changed in fire simulation too.
Just see the difference betwee peview and the render http://i.imgur.com/1MU8Q1O.png
I attach the file. Try to render 20 frame. smoke_particles_effect_01_005.blend

@Sergey hello again. We noticed that alpha is changed in fire simulation too. Just see the difference betwee peview and the render http://i.imgur.com/1MU8Q1O.png I attach the file. Try to render 20 frame. [smoke_particles_effect_01_005.blend](https://archive.blender.org/developer/F113423/smoke_particles_effect_01_005.blend)
Author
Member

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'
Author
Member

@Sergey Hi.

2.73 was released, but we still have big issues with alpha. Semi-transparent materials become ugly on final rendering. Could you review this bug again? You said that you would fix it in 2.73 but it did not happen. Could you make a simple checkbox for turning alpha-premultiplication off for final render?

Here we still suffer from rendering semi-transparent materials. See Green glass:
cache1.png

Here is the blend file again if it helps you:
temp_alpha.blend

I'll Open the task for a while if you don't mind.

Thanks.

@Sergey Hi. 2.73 was released, but we still have big issues with alpha. Semi-transparent materials become ugly on final rendering. Could you review this bug again? You said that you would fix it in 2.73 but it did not happen. Could you make a simple checkbox for turning alpha-premultiplication off for final render? Here we still suffer from rendering semi-transparent materials. See Green glass: ![cache1.png](https://archive.blender.org/developer/F139960/cache1.png) Here is the blend file again if it helps you: [temp_alpha.blend](https://archive.blender.org/developer/F139962/temp_alpha.blend) I'll Open the task for a while if you don't mind. Thanks.

Didn't say i will fix it, i told i'll review the status of alpha in the image editor. It's just two different approach to visualizing the images, just making it so image editor starts behaving same as viewport is not totally correct and might ruin someone's day,

This is still on the list to be sovled, but since it's how blender always worked its closer to low-prio todo.

Didn't say i will fix it, i told i'll review the status of alpha in the image editor. It's just two different approach to visualizing the images, just making it so image editor starts behaving same as viewport is not totally correct and might ruin someone's day, This is still on the list to be sovled, but since it's how blender always worked its closer to low-prio todo.

Added subscriber: @MassimilianoPuliero

Added subscriber: @MassimilianoPuliero

Added subscriber: @Vyach

Added subscriber: @Vyach

Probably the same or similar issue.

Final cobined result is not combined with separate glossines. I have a scene with monocle. So I need normal material for metal and only reflective for glass.

2016-09-21_024129.jpg
here on the screenshot, in the bottom row are:
preview,
combined result (empty)
Direct reflection
Reflection color

And if I will have separate render-layer with such material, and if I will disable sky visualization, my lense starts reflect like sky is black.

So if the sky are absent it is nothing to reflect! Not white, nor black!
In is not physically but it is useful for making pictures.

Probably the same or similar issue. Final cobined result is not combined with separate glossines. I have a scene with monocle. So I need normal material for metal and only reflective for glass. ![2016-09-21_024129.jpg](https://archive.blender.org/developer/F365468/2016-09-21_024129.jpg) here on the screenshot, in the bottom row are: preview, combined result (empty) Direct reflection Reflection color And if I will have separate render-layer with such material, and if I will disable sky visualization, my lense starts reflect like sky is black. So if the sky are absent it is nothing to reflect! Not white, nor black! In is not physically but it is useful for making pictures.

Added subscriber: @KonstantinsVisnevskis

Added subscriber: @KonstantinsVisnevskis

Just run into this. So basically - viewport preview doesn't work for semi transparent objects as what you see is not what you get. I understand that probably output can be changed into what is shown in viewport theoretically, but I wasn't able to do that in compositor. I can get a same image as if viewport would be rendered over some color, but not if keeping the alpha (adding un/premultiply seems to fix alpha issue, but brightens the colors, that doesn't mach the viewport again).

Just run into this. So basically - viewport preview doesn't work for semi transparent objects as what you see is not what you get. I understand that probably output can be changed into what is shown in viewport theoretically, but I wasn't able to do that in compositor. I can get a same image as if viewport would be rendered over some color, but not if keeping the alpha (adding un/premultiply seems to fix alpha issue, but brightens the colors, that doesn't mach the viewport again).

Added subscriber: @PranavjitVirdi

Added subscriber: @PranavjitVirdi

i am having a similar issue, 2.79 official release, and had it earlier aswell
Capture.PNG

i am having a similar issue, 2.79 official release, and had it earlier aswell ![Capture.PNG](https://archive.blender.org/developer/F793902/Capture.PNG)

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Duplicate of #52680 (Alpha difference Viewport/F12 ).

Duplicate of #52680 (Alpha difference Viewport/F12 ).

Added subscriber: @JasonForth

Added subscriber: @JasonForth

This is still an issue in 3.2.2.

I am trying to render an animation, but the resulting images being produced are nothing like final renders within Blender.

Blender Alpha issue.jpg

I have tried to change the colour management options, but all yield the same result. I removed the option of using alpha and the render came out how I wanted it to, however, having a solid background on this animation is not an option for me.

Is there a workaround at all?

This is still an issue in 3.2.2. I am trying to render an animation, but the resulting images being produced are nothing like final renders within Blender. ![Blender Alpha issue.jpg](https://archive.blender.org/developer/F13418716/Blender_Alpha_issue.jpg) I have tried to change the colour management options, but all yield the same result. I removed the option of using alpha and the render came out how I wanted it to, however, having a solid background on this animation is not an option for me. Is there a workaround at all?

Added subscriber: @Vasiliy

Added subscriber: @Vasiliy

Issue with alpha still here 3.4.1

Render view on the left, on the right how it actually look.
Screenshot_2.png

Issue with alpha still here 3.4.1 Render view on the left, on the right how it actually look. ![Screenshot_2.png](https://archive.blender.org/developer/F14235950/Screenshot_2.png)
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
10 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#41844
No description provided.