Mantaflow Color Mapping not ignoring alpha value #74220

Closed
opened 2020-02-26 04:39:03 +01:00 by Andrew Price · 12 comments

System Information
Operating system: Win 10
Graphics card: dual RTX Titans

Blender Version
Broken: 2.82

Short description of error
The gradient color mapping of smoke simulation will fill empty space with alpha if any color besides black is given

Exact steps for others to reproduce the error

  • Create any smoke simulation
  • In domain smoke settings, enable Color Mapping

Set the left hand field to any color besides black and it will ignore the alpha value and fill it

2020-02-26_13-34-26.png

**System Information** Operating system: Win 10 Graphics card: dual RTX Titans **Blender Version** Broken: 2.82 **Short description of error** The gradient color mapping of smoke simulation will fill empty space with alpha if any color besides black is given **Exact steps for others to reproduce the error** - Create any smoke simulation - In domain smoke settings, enable Color Mapping # Set the left hand field to any color besides black and it will ignore the alpha value and fill it ![2020-02-26_13-34-26.png](https://archive.blender.org/developer/F8370628/2020-02-26_13-34-26.png)
Author

Added subscriber: @AndrewPrice

Added subscriber: @AndrewPrice

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Simply adding straight_to_premul_v4(out); to the end of BKE_colorband_evaluate seems to make it behave as I'd expect. No idea of this is the correct fix. workbench_volume_frag.glsl seems to expect that rgb = 0 when alpha = 0.

Simply adding `straight_to_premul_v4(out);` to the end of `BKE_colorband_evaluate` seems to make it behave as I'd expect. No idea of this is the correct fix. `workbench_volume_frag.glsl` seems to expect that `rgb = 0` when `alpha = 0`.
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Member

@Jeroen-Bakker, do you know if the fix mentioned above makes sense?

@Jeroen-Bakker, do you know if the fix mentioned above makes sense?

Added subscriber: @fclem

Added subscriber: @fclem

I coded the volume shader for workbench. If I remember correctly it expects premultiplied color so that you can have purely emissive material (without alpha) which is exactly what @AndrewPrice is showing here.

In my opinion, the real issue is that the color widgets don't support/show premultiplied colors. So we could fix it after the colorband eval if we don't plan on improving the widget but to me it feels like removing a feature.

I coded the volume shader for workbench. If I remember correctly it expects premultiplied color so that you can have purely emissive material (without alpha) which is exactly what @AndrewPrice is showing here. In my opinion, the real issue is that the color widgets don't support/show premultiplied colors. So we could fix it after the colorband eval if we don't plan on improving the widget but to me it feels like removing a feature.

Added subscriber: @brecht

Added subscriber: @brecht

For volume shading there is no alpha strictly speaking, instead there is density. It's a matter of finding the most useful interpretation.

  • Current: alpha is the density for absorption (the "smoke") only, not emission (the "fire")
  • straight_to_premul_v4: alpha is the density for both absorption and emission

Since this color mapping is used for visualizing one volume grid at a time, I think it's most convenient if the alpha controls the density of both.

If the purpose was to show smoke and fire together you'd want separate control over the density of each, but to me that seems unnecessary here.

For volume shading there is no alpha strictly speaking, instead there is density. It's a matter of finding the most useful interpretation. * Current: alpha is the density for absorption (the "smoke") only, not emission (the "fire") * `straight_to_premul_v4`: alpha is the density for both absorption and emission Since this color mapping is used for visualizing one volume grid at a time, I think it's most convenient if the alpha controls the density of both. If the purpose was to show smoke and fire together you'd want separate control over the density of each, but to me that seems unnecessary here.

This issue was referenced by 9feb0d5f2e

This issue was referenced by 9feb0d5f2eb87cc5f19b00c8928514e44edc4dde

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Clément Foucault self-assigned this 2020-06-29 14:20:22 +02:00
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#74220
No description provided.