Particle Ageing (via Math Node) does not map correctly to ColorRamp Fac #39474
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#39474
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system and graphics card
Mac OS, Macbook Air
Blender Version
2.70
2525f9c
(latest)(Has never worked in past versions as far as I have experienced)
Short description of error
Attempting to use Particle Info node in Material to cause particles to change RGB during lifetime - for example to simulate sparks which start yellow-white hot then cool to red before dying.
Straightforward/conceptual math would reason that Particle Agedivided by total Lifetime would result in a 0.0-1.0 range, perfect for plugging into a ColorRamp's Fac.
However, this is not consistently the case.
I have in the included Blend file shown my reasoning and steps to arrive at this conclusion.
Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps
Jarron-ParticleInfoNodeMathColorRampMismatch.blend
Note that I have intentionally maximized the variables involved to more clearly show the error.
The Particle's Instanced Object Material nodes are set up as shown in the file.
One should now expect that the Pos of the Ramp Handle will map consistently to the scene playhead.
What actually happens, however, is that results are mixed depending on the set Pos
Such a percentage may sound like nitpicking, but the error is manifested in quite reasonable ranges, too.
It's how I first became confused by the problem, after all.
Further, the fact that it happens at some values and not others makes me regard this as a bug worthy of chasing up since it involves some pretty foundational nodes, such as the Math node.
If it was a consistent offset I would just add another math node to compensate.
//Yes yes, I know this isn't the place to request features, and I will file a separate request, but seriously: Why isn't there a way to directly find out the evaluated result of a Math node?
Either by plugging in a "Show Value" node, conceptually equivalent to the Viewer Node for image results - or even better simply displaying the value in the node's upper right corner, just like the warning on the new Volumetrics nodes.
It would eliminate so much guesswork...!//
Changed status to: 'Open'
Added subscriber: @Jarron
Oh: I forgot to mention that I have tested this on multiple computers, the Math Node's Clamp option appears to have no effect, and that it does also manifest when Physics are enabled.
Added subscriber: @willi-2
I can repro it, and I agree. As connecting the output of the Divide node directly to the emission shader gives RGB values 0.10197, the input to the ramp node is correct. In addition, the Pos value within the ramp node is exactly 0.1 without truncated decimal places, so I'd see the problem in the ramp node, too.
After looking at the source code, I think the reason is that the color ramp has a limit of 256 entries (in the range 0 to 255). At frame 10197, the age is 10196 because the start frame is one. Age divided by LifeTime results in 0.10196. Multiplied by 255 it's 25,9998. This value rounded is 25. That means: At frame 10197, the entry at position 25 in the ramp table is used.
At frame 10198, the computation is ((10198 - 1) / 100000) * 255 = 26,00235. Consequently, the entry at position 26 is used.
In other words, the fac of the ramp node has a resolution of 0.00390625.
So the experienced behavior is by design.
I should have added that I was referring to constant interpolation mode (i.e. no interpolation) as in your blend file. Otherwise, I wonder what's the actual problem if you set interpolation to linear, which is, what you probably need in your actual project.
Added subscriber: @gandalf3
Changed status from 'Open' to: 'Archived'
The color ramp indeed has only limited precision, it's converted to a table with 256 entries for fast lookup at render time. I wouldn't consider this a bug, we could add more precision but that also means more memory usage or longer render time. If you need to do such precision operation it would be better to use math nodes.
It's a valid question, I suppose, wondering just what practical impact this has – especially considering all the other hoops I have to jump through to get the particle system working as I want, but shrug I found a bug, so I reported it.
If y'all wanna ignore it, no worries. At least my conscience is clear (this was my very first instance of "contributing something back" to one of my fav apps - I appreciate you taking the time to make it a very professional experience)