Bug in particle system - missing particles representations #81103

Open
opened 2020-09-23 19:14:32 +02:00 by Sebastian · 8 comments

System Information
Operating system: Linux-5.4.0-47-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX TITAN X/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.44

Blender Version
Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: 3e85bb34d0
Worked: potentially never, does also not work with 2.80

Short description of error
When creating a particle system with instance objects and using more than ~15.000 particles, not all particles are represented with the instance object. The more particles the particle system contains, the more instance objects are missing.
The following images illustrate the problem.

Example with 120 x 120 = 14.400 particles. All particles are represented with the instance object (in this case a cube) - except for the first particle at the top left corner. This particle is always missing - even for small particle systems.

image.png

For slightly bigger particle systems (e.g. 150 x 150 = 22500 particles), a few particles at random positions in the particle system do not contain an instance object (see the black dots)

image.png

For way bigger particle systems (e.g. 200 x 200 = 40000 particles) the last particles (i.e. the particles at the bottom right with the biggest indices are missing)

image.png

The presence of particles without instance objects also affects other particles when using specific nodes. For example, when using the index output of the Particle Info Node to compute a texture coordinate for each particle used to compute individual colors for the particles produced strange results.

Here a working example for 120 x 120 particles (as reference)

image.png

And here a non-working example for 200 x 200 particles (zoomed on the bottom-right corner)

image.png

Side note: In all the examples, the particles are there, but the instance object representation is missing.

Exact steps for others to reproduce the error

Execute the following Python script within Blender's text editor. Or, when using Jacques Lucke's VSCode Plugin: execute the script (again) when Blender is already opened (since it does not work with a restricted context)

particle_sys.py

Blend file with the an incorrect particle system

particle_sys.blend

**System Information** Operating system: Linux-5.4.0-47-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX TITAN X/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.44 **Blender Version** Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: `3e85bb34d0` Worked: potentially never, does also not work with 2.80 **Short description of error** When creating a particle system with `instance objects` and using more than ~15.000 particles, not all particles are represented with the instance object. The more particles the particle system contains, the more instance objects are missing. The following images illustrate the problem. Example with 120 x 120 = 14.400 particles. All particles are represented with the instance object (in this case a cube) - except for the first particle at the top left corner. This particle is always missing - even for small particle systems. ![image.png](https://archive.blender.org/developer/F8912462/image.png) For slightly bigger particle systems (e.g. 150 x 150 = 22500 particles), a few particles at random positions in the particle system do not contain an instance object (see the black dots) ![image.png](https://archive.blender.org/developer/F8912479/image.png) For way bigger particle systems (e.g. 200 x 200 = 40000 particles) the last particles (i.e. the particles at the bottom right with the biggest indices are missing) ![image.png](https://archive.blender.org/developer/F8912492/image.png) The presence of particles without instance objects also affects other particles when using specific nodes. For example, when using the `index` output of the `Particle Info Node` to compute a texture coordinate for each particle used to compute individual colors for the particles produced strange results. Here a working example for 120 x 120 particles (as reference) ![image.png](https://archive.blender.org/developer/F8912504/image.png) And here a non-working example for 200 x 200 particles (zoomed on the bottom-right corner) ![image.png](https://archive.blender.org/developer/F8912501/image.png) Side note: In all the examples, the particles are there, but the instance object representation is missing. **Exact steps for others to reproduce the error** Execute the following Python script within Blender's text editor. Or, when using Jacques Lucke's VSCode Plugin: execute the script (again) when Blender is already opened (since it does not work with a restricted context) [particle_sys.py](https://archive.blender.org/developer/F8912521/particle_sys.py) Blend file with the an incorrect particle system [particle_sys.blend](https://archive.blender.org/developer/F8912511/particle_sys.blend)
Author

Added subscriber: @sbcv

Added subscriber: @sbcv

Added subscriber: @JerBot

Added subscriber: @JerBot
Sebastian changed title from Bug in particle system - missing object instances representations of particles results in incorrect node behavior to Bug in particle system - missing particles representations 2020-09-29 10:46:31 +02:00

Added subscriber: @iss

Added subscriber: @iss

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

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

I can reproduce this even when I duplicate vertices manually, so script should not influence the result.

I can reproduce this even when I duplicate vertices manually, so script should not influence the result.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

The error seems to be unrelated to the instancing itself. It happens in particle_distribute.c:
image.png
See that line 1227 is not executed the expected 39999 times. Instead it is only executed 39967 times. The missing iterations are responsible for the misplaced instances.

There have been multiple attempts to fix this in the past: 950acb0ced, 35ee9ff7a0.
It's a bit crazy that the simplest kind of distribution (one particle per vertex) is hard to implement, currently. The main issue is that this tries to incorporate weights, even if there are none, leading to floating point accuracy issues.

The error seems to be unrelated to the instancing itself. It happens in `particle_distribute.c`: ![image.png](https://archive.blender.org/developer/F9554094/image.png) See that line 1227 is not executed the expected 39999 times. Instead it is only executed 39967 times. The missing iterations are responsible for the misplaced instances. There have been multiple attempts to fix this in the past: 950acb0ced, 35ee9ff7a0. It's a bit crazy that the simplest kind of distribution (one particle per vertex) is hard to implement, currently. The main issue is that this tries to incorporate weights, even if there are none, leading to floating point accuracy issues.

Added subscriber: @2046411367

Added subscriber: @2046411367
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:46:31 +01: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
5 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#81103
No description provided.