Particle texture behaves incorrectly after changing the number of particles #35247

Closed
opened 2013-05-07 14:56:23 +02:00 by Yu Asakusa · 12 comments

%%%--- Operating System, Graphics card ---
Windows 7 64-bit Service Pack 1, Mobile Intel 4 Series Express Chipset

- Blender version with error, and version that worked ---

Error: Blender 2.66a 64-bit, Blender 2.67 RC 64-bit, both official versions from www.blender.org
Working: none I know of

- Short description of error ---

A particle texture which controls the emission time behaves incorrectly after changing the number of particles.

- Steps for others to reproduce the error (preferably based on attached .blend file) ---
  1. Open the attached .blend file.
  2. (optional) Start animation in 3D View to see the expected behavior. Particles are emitted from top to bottom during the first 30 frames, and they disappear in the following 30 frames.
  3. Change the number of particles (of object Cube) from 2000 to, say, 2001.
  4. Start animation in 3D View. Now all the particles are emitted in frame 31.

It is 100% reproducible with the attached .blend file in Blender 2.66a 64-bit and Blender 2.67 RC 64-bit on my PC, which runs Windows 7 64-bit Service Pack 1.

Some notes:

  • After step 4, if I change anything in the particle texture, it works as expected again.
  • The rendering result is the same as 3D View.
  • The coordinates of the particle texture in the .blend file are taken from another object (Plane). This might have something to do with the bug, because if I change the texture coordinates to “Generated,” the behavior changes (in a way I cannot understand…).
  • I do not know whether this is the same issue as [#28263] Particle Texture Influence Bug (3) or not.
    %%%
%%%--- Operating System, Graphics card --- Windows 7 64-bit Service Pack 1, Mobile Intel 4 Series Express Chipset - Blender version with error, and version that worked --- Error: Blender 2.66a 64-bit, Blender 2.67 RC 64-bit, both official versions from www.blender.org Working: none I know of - Short description of error --- A particle texture which controls the emission time behaves incorrectly after changing the number of particles. - Steps for others to reproduce the error (preferably based on attached .blend file) --- 1. Open the attached .blend file. 2. (optional) Start animation in 3D View to see the expected behavior. Particles are emitted from top to bottom during the first 30 frames, and they disappear in the following 30 frames. 3. Change the number of particles (of object Cube) from 2000 to, say, 2001. 4. Start animation in 3D View. Now all the particles are emitted in frame 31. It is 100% reproducible with the attached .blend file in Blender 2.66a 64-bit and Blender 2.67 RC 64-bit on my PC, which runs Windows 7 64-bit Service Pack 1. Some notes: * After step 4, if I change anything in the particle texture, it works as expected again. * The rendering result is the same as 3D View. * The coordinates of the particle texture in the .blend file are taken from another object (Plane). This might have something to do with the bug, because if I change the texture coordinates to “Generated,” the behavior changes (in a way I cannot understand…). * I do not know whether this is the same issue as [#28263] Particle Texture Influence Bug (3) or not. %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Sergey Sharybin self-assigned this 2014-02-03 15:23:13 +01:00

Will try to have a look :)

Will try to have a look :)

Added subscribers: @LukasTonne, @brecht

Added subscribers: @LukasTonne, @brecht

Have a quick patch for this which seems to work here: http://www.pasteall.org/49304/diff

Root of the issue goes to the order of particle initialization which does texture evaluation (which does depend on particle coordinate) and particle birth coordinate calculation. So basically what happened is:

  • Changing number of particles re-allocated all the particles, which sets their coordinate to (0,0,0)
  • Texture evaluation used this non-initialized coordinate
  • Coordinates were calculated for particles

Reshuffled code a bit so now texture evaluation happens after particle coordinate calculation, but that requires more eyes to check: http://www.pasteall.org/49305/diff

@brecht, @LukasTonne guess you're most familiar with this code. Mind having a look into the patch?

Have a quick patch for this which seems to work here: http://www.pasteall.org/49304/diff Root of the issue goes to the order of particle initialization which does texture evaluation (which does depend on particle coordinate) and particle birth coordinate calculation. So basically what happened is: * Changing number of particles re-allocated all the particles, which sets their coordinate to (0,0,0) * Texture evaluation used this non-initialized coordinate * Coordinates were calculated for particles Reshuffled code a bit so now texture evaluation happens after particle coordinate calculation, but that requires more eyes to check: http://www.pasteall.org/49305/diff @brecht, @LukasTonne guess you're most familiar with this code. Mind having a look into the patch?

I'm not so sure about this, initialize_all_particles does more than just calling initialize_particle for each particle, and that code is never called now? Except for keyed particles which still calls initialize_all_particles, but that probably needs to be changed as well?

I'm not so sure about this, `initialize_all_particles` does more than just calling `initialize_particle` for each particle, and that code is never called now? Except for keyed particles which still calls `initialize_all_particles`, but that probably needs to be changed as well?

@brecht, that's a good catch actually.

Here's an updated patch: http://www.pasteall.org/49311/diff

Restored call of initialize_all_particles(). After some code research found that initialize_particle() and initialize_all_particles() are followed by reset_particle() or reset_all_particles(). In the reset function we do know coordinates and could sample texture from there. And now the idea is to sample the texture from reset and don't do it from initialization.

By the looks of it there's nothing which depends sampled texture after initialize_particle() and before the psys_get_birth_coordinates() (if someone could doublechec this it'll be cool) and also seems since resetting could change coordinates of particles then texture is to be re-sampled.

Does it all seems logical now?

@brecht, that's a good catch actually. Here's an updated patch: http://www.pasteall.org/49311/diff Restored call of `initialize_all_particles()`. After some code research found that `initialize_particle()` and `initialize_all_particles()` are followed by `reset_particle()` or `reset_all_particles()`. In the reset function we do know coordinates and could sample texture from there. And now the idea is to sample the texture from reset and don't do it from initialization. By the looks of it there's nothing which depends sampled texture after `initialize_particle()` and before the `psys_get_birth_coordinates()` (if someone could doublechec this it'll be cool) and also seems since resetting could change coordinates of particles then texture is to be re-sampled. Does it all seems logical now?

Looks good to me.

Looks good to me.

This issue was referenced by blender/blender-addons-contrib@78c491e62a

This issue was referenced by blender/blender-addons-contrib@78c491e62a573eac647085a0520cb35526d6fcc3

This issue was referenced by 78c491e62a

This issue was referenced by 78c491e62a573eac647085a0520cb35526d6fcc3

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 78c491e62a.

Closed by commit 78c491e62a.

Removed subscriber: @hal9000

Removed subscriber: @hal9000
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#35247
No description provided.