Attribute name temperature returns incorrect values for shading #110716

Closed
opened 2023-08-02 12:55:17 +02:00 by Simon Thommes · 7 comments
Member

System Information
Operating system: Linux-5.17.15-76051715-generic-x86_64-with-glibc2.35 64 Bits, X11 UI
Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 515.48.07

Blender Version
Broken: version: 3.6.1, branch: blender-v3.6-release, commit date: 2023-07-21 12:59, hash: c284cfcd0830
Worked: (newest version of Blender that worked as expected)

Short description of error
Screenshot from 2023-08-02 12-50-33.png
Due to some special handling an attribute written to the name temperature is not read correctly by Cycles and Eevee in the shader. Eevee returns a third of the actual value, while Cycles simply returns 0.

Exact steps for others to reproduce the error
temperature_attribute_shader_handling.blend

  • write attribute named temperature to mesh
  • try to use it in the shader
**System Information** Operating system: Linux-5.17.15-76051715-generic-x86_64-with-glibc2.35 64 Bits, X11 UI Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 515.48.07 **Blender Version** Broken: version: 3.6.1, branch: blender-v3.6-release, commit date: 2023-07-21 12:59, hash: `c284cfcd0830` Worked: (newest version of Blender that worked as expected) **Short description of error** ![Screenshot from 2023-08-02 12-50-33.png](/attachments/751ebb4d-a30c-4572-a3bb-339fc2e56809) Due to some special handling an attribute written to the name `temperature` is not read correctly by Cycles and Eevee in the shader. Eevee returns a third of the actual value, while Cycles simply returns 0. **Exact steps for others to reproduce the error** [temperature_attribute_shader_handling.blend](/attachments/e99b4205-4481-415c-9a68-fc506b6177ce) - write attribute named `temperature` to mesh - try to use it in the shader
Simon Thommes added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-08-02 12:55:17 +02:00

It's a built-in render attribute, no?

It's a built-in render attribute, no?
Author
Member

Just checked and you can indeed also retrieve it with the Volume Info node, but that has the same issue that the values are inaccurate and it's probably not how it should work.

Just checked and you can indeed also retrieve it with the `Volume Info` node, but that has the same issue that the values are inaccurate and it's probably not how it should work.

The volume doesn't inherit the mesh's attributes, does it?

The volume doesn't inherit the mesh's attributes, does it?
Author
Member

There is no volume involved in this at all, I'm just writing to a temperature attribute on a mesh. Previously without user created generic attributes that was only used on volumes for fire simulations but now this is a quite arbitrary distinction that is not at all obvious and results in what looks a lot like a bug to me.

There is no volume involved in this at all, I'm just writing to a `temperature` attribute on a mesh. Previously without user created generic attributes that was only used on volumes for fire simulations but now this is a quite arbitrary distinction that is not at all obvious and results in what looks a lot like a bug to me.
Member

I guess @mod_moder is right. Function of attribute node (node_shader_gpu_attribute) checks for built in color/temprature attribute and uses their shader functions: https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_attribute.cc#L50

Though I'm not entirely sure about the working here. Forwarding to devs.

I guess @mod_moder is right. Function of attribute node (`node_shader_gpu_attribute`) checks for built in color/temprature attribute and uses their shader functions: https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_attribute.cc#L50 Though I'm not entirely sure about the working here. Forwarding to devs.
Iliya Katushenock added
Module
Render & Cycles
and removed
Module
Nodes & Physics
labels 2023-08-03 10:48:55 +02:00
Author
Member

I already mentioned this to @JacquesLucke before making the report. Could you leave your input here as well?

I already mentioned this to @JacquesLucke before making the report. Could you leave your input here as well?
Member

Looked into this a bit more than I did originally now. Looks like the temperature not only has some special code on the CPU but also on the GPU. There are a bunch of attr_load_temperature_post functions, some of which shift the temperature range around. That seems to be related to the "max temperature" and "flame ignition" in fluid settings.
There is this comment: /* Output is such that 0..1 maps to 0..1000K */

Maybe the problem could also be addressed by not leaving y and z at 0 in node_attribute_temperature but to use the same value that is used for x.

Looked into this a bit more than I did originally now. Looks like the temperature not only has some special code on the CPU but also on the GPU. There are a bunch of `attr_load_temperature_post` functions, some of which shift the temperature range around. That seems to be related to the "max temperature" and "flame ignition" in fluid settings. There is this comment: `/* Output is such that 0..1 maps to 0..1000K */` Maybe the problem could also be addressed by not leaving y and z at 0 in `node_attribute_temperature` but to use the same value that is used for x.
Blender Bot added
Status
Resolved
and removed
Status
Needs Info from Developers
labels 2023-08-04 16:37:31 +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
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#110716
No description provided.