SPH Fluid Density texture #29680

Closed
opened 2011-12-23 01:39:19 +01:00 by Alex Fraser · 14 comments

%%%This patch adds a new texture type for rendering SPH fluids. It is based on the Point Density texture, but on each sample, the actual SPH field variables are used to colour the surface. Like Point Density, this can also be used with a volumetric material to visualise the shape of the particle system.

This patch overlaps a little with 29661 and 29663 (bug fixes and refactoring). However the patch provided (fluidDensity_r42811_1_svn.patch) applies against trunk (r42811) and does not need other patches applied first.

By making a contribution to this project, I certify that the contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file.

Signed-off-by: Alex Fraser adfries@vpac.org on behalf of VPAC Ltd.%%%

%%%This patch adds a new texture type for rendering SPH fluids. It is based on the Point Density texture, but on each sample, the actual SPH field variables are used to colour the surface. Like Point Density, this can also be used with a volumetric material to visualise the shape of the particle system. This patch overlaps a little with 29661 and 29663 (bug fixes and refactoring). However the patch provided (fluidDensity_r42811_1_svn.patch) applies against trunk (r42811) and does not need other patches applied first. By making a contribution to this project, I certify that the contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file. Signed-off-by: Alex Fraser <adfries@vpac.org> on behalf of VPAC Ltd.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%As discussed with Janne on IRC, the patch in its current form may not be ideal. It might be better to either:

  • Combine this feature with the Point Density texture, or
  • Combine it with the force field visualisation work by Lukas.%%%
%%%As discussed with Janne on IRC, the patch in its current form may not be ideal. It might be better to either: - Combine this feature with the Point Density texture, or - Combine it with the force field visualisation work by Lukas.%%%
Author

%%%Attached is a new version of the patch that applies against r46643 (fluidDensity_r46643_4_svn.patch). This version no longer introduces a new texture type: instead, the new functionality is added directly to Point Density. A new test file is attached, and new rendered image.

Point Density now has three modes: [Particle System, Object Vertices, Fluid Particles]. In Fluid particles mode, all the falloff options are disabled, because this information is taken from the SPH settings. Also the colour source is hidden, because extracting the velocity and age is not implemented yet (it would be possible, in future, to extract these using the SPH kernel).

The attached image (fluidVsPoint_wave2.png) shows the difference between the old Particle System mode and the new Fluid Particles mode. Blue is old, red is new. As shown in the image, it is possible to come close with the old method, but it is not an accurate representation of the SPH density field.%%%

%%%Attached is a new version of the patch that applies against r46643 (fluidDensity_r46643_4_svn.patch). This version no longer introduces a new texture type: instead, the new functionality is added directly to Point Density. A new test file is attached, and new rendered image. Point Density now has three modes: [Particle System, Object Vertices, Fluid Particles]. In Fluid particles mode, all the falloff options are disabled, because this information is taken from the SPH settings. Also the colour source is hidden, because extracting the velocity and age is not implemented yet (it would be possible, in future, to extract these using the SPH kernel). The attached image (fluidVsPoint_wave2.png) shows the difference between the old Particle System mode and the new Fluid Particles mode. Blue is old, red is new. As shown in the image, it is possible to come close with the old method, but it is not an accurate representation of the SPH density field.%%%
Author

%%%Attached a new version (fluidDensity_r46643_5_svn.patch) which fixes a crasher: now, if Fluid Particle mode is chosen but the particle system has no fluid settings, the texture will return a value of zero for all samples. Note that the old Particle System mode is unaffected by this.%%%

%%%Attached a new version (fluidDensity_r46643_5_svn.patch) which fixes a crasher: now, if Fluid Particle mode is chosen but the particle system has no fluid settings, the texture will return a value of zero for all samples. Note that the old Particle System mode is unaffected by this.%%%
Author

%%%With a volumetric material, this can also be used to render a surface of a particle fluid (fluidDens_volume.jpg). Although, you can get similar results with the original Point Density texture - but this is more accurate! :)%%%

%%%With a volumetric material, this can also be used to render a surface of a particle fluid (fluidDens_volume.jpg). Although, you can get similar results with the original Point Density texture - but this is more accurate! :)%%%
Author

%%%Attaching a new version of the patch (fluidDensity_r53102_6_svn.patch) that applies against HEAD. This version works with the new classical SPH solver too.

Also attaching a comparison of the SPH density field vs regular point density texture for a dam break simulation (fluidVsPoint_dam_break.png).%%%

%%%Attaching a new version of the patch (fluidDensity_r53102_6_svn.patch) that applies against HEAD. This version works with the new classical SPH solver too. Also attaching a comparison of the SPH density field vs regular point density texture for a dam break simulation (fluidVsPoint_dam_break.png).%%%

%%%I am trying your patch.
I am frustated to not having access to radius and fall-off settings.
Although shape's accuracy is better; it is difficult to obtain a rendered volume close to what we see in 3D view.
It is obvious in your render ( fluidDens_volume.jpg ). Borders of rendered volume are far away from borders of particles mass in 3D view.
I hope that efforts to create low-poly surface for sph will happen.
Volumes are slow to render and a nightmare in compositing (no ability to obtain correct normals for reflection rendering, no only shadow option, no raytransparency limited to point density). %%%

%%%I am trying your patch. I am frustated to not having access to radius and fall-off settings. Although shape's accuracy is better; it is difficult to obtain a rendered volume close to what we see in 3D view. It is obvious in your render ( fluidDens_volume.jpg ). Borders of rendered volume are far away from borders of particles mass in 3D view. I hope that efforts to create low-poly surface for sph will happen. Volumes are slow to render and a nightmare in compositing (no ability to obtain correct normals for reflection rendering, no only shadow option, no raytransparency limited to point density). %%%

%%%image upload%%%

%%%image upload%%%

%%%a blend to show problem with a volume.
http://www.pasteall.org/blend/18286

a pratical case where i did not succeed to obtain a thin fluid with fluid particles choïce.
http://www.pasteall.org/blend/18287%%%

%%%a blend to show problem with a volume. http://www.pasteall.org/blend/18286 a pratical case where i did not succeed to obtain a thin fluid with fluid particles choïce. http://www.pasteall.org/blend/18287%%%

%%%I made an animation with this patch.
http://vimeo.com/56813254%%%

%%%I made an animation with this patch. http://vimeo.com/56813254%%%
Author

%%%Hi Ronan,

Sorry it has taken me so long to respond. The animation is good! Are you happy with that result, or do you still want more control over the look?

How useful do you think this texture is in general? If there was a way to generate a surface mesh from the particles, would you use the texture at all?

Cheers,
Alex%%%

%%%Hi Ronan, Sorry it has taken me so long to respond. The animation is good! Are you happy with that result, or do you still want more control over the look? How useful do you think this texture is in general? If there was a way to generate a surface mesh from the particles, would you use the texture at all? Cheers, Alex%%%

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Dalai Felinto self-assigned this 2019-12-23 18:50:40 +01:00

Hi, thanks for your patch.

We are undergoing a Tracker Curfew where we are automatically closing old patches.

If you think the patch is still relevant please update and re-submit it. For new features make sure there is a clear design from the user level perspective.

Hi, thanks for your patch. We are undergoing a [Tracker Curfew ](https://code.blender.org/?p=3861) where we are automatically closing old patches. If you think the patch is still relevant please update and re-submit it. For new features make sure there is a clear design from the user level perspective.
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
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
3 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#29680
No description provided.