Tiled texture storage and sampling in Cycles kernel #55264

Closed
opened 2018-05-30 19:23:39 +02:00 by Geraldine Chua · 6 comments
Member

This task concerns the implementation of a compression technique for large sparse datasets (e.g. Volumes). This is done by subdividing the dataset into smaller grids, and discarding the ones that do not hold any meaningful data.

This task is part 1 of my GSoC 2018 project .

To-dos

  • Make this compatible with the Mesh Volume speedup . Because of they are currently mutually exclusive, using this implemntation will actually slow down rendering.
  • Modify sparse tiles to support generic types (currently only supports float4, should be fine as long they have a > operator overloaded).
  • Add support for all Volume attributes (currently only supports color).
  • Change detection method for calling sparse grid creation (currently, a new ImageDataType was created, but will probably change this to a bool member of Image).
  • Add support for CUDA and OpenCL.
  • Implement lookup for tricubic interpolation (currently just throws an assert if a compressed texture tries to call it).
  • Remove the SparseTile struct altogether and just treat tiles abstractly.
  • Create a wrapper class for device_memory's of SparseTiles?
  • Support 2D tiling and sampling?
  • Make threshold value a user-inputted value?
This task concerns the implementation of a compression technique for large sparse datasets (e.g. Volumes). This is done by subdividing the dataset into smaller grids, and discarding the ones that do not hold any meaningful data. This task is part 1 of my [GSoC 2018 project ](https://wiki.blender.org/index.php/User:Geraldine/GSoC_2018). **To-dos** - [x] Make this compatible with the [Mesh Volume speedup ](https://developer.blender.org/D3038). Because of they are currently mutually exclusive, using this implemntation will actually slow down rendering. - [x] Modify sparse tiles to support generic types (currently only supports float4, should be fine as long they have a > operator overloaded). - [x] Add support for all Volume attributes (currently only supports color). - [x] Change detection method for calling sparse grid creation (currently, a new ImageDataType was created, but will probably change this to a bool member of Image). - [ ] Add support for CUDA and OpenCL. - [x] Implement lookup for tricubic interpolation (currently just throws an assert if a compressed texture tries to call it). - [x] Remove the SparseTile struct altogether and just treat tiles abstractly. - [ ] Create a wrapper class for device_memory's of SparseTiles? - [ ] Support 2D tiling and sampling? - [x] Make threshold value a user-inputted value?
Geraldine Chua self-assigned this 2018-05-30 19:23:39 +02:00
Author
Member

Added subscriber: @gschua

Added subscriber: @gschua
Author
Member

With threshold set to 0.0f (unfortunately hard-coded right now), memory usage of the color texture in this example is reduced by ~33%. If set to 0.2f, memory usage is reduced by ~66%, with no significant visual loss.

I have attached photos of the green smoke with no tiling, with 0 threshold, and with 0.2 threshold. You can also download the .blend file to try.

If you notice the rendering speeds, the non-tiling one rendered much faster. This is most likely because the sparse grid is no longer treated as a mesh volume , and hopefully does not have anything to do with this task. I will see if it is possible to make these two functions compatible.

example.blend
No tiling: post_none.png
0.0 threshold: post_0.png
0.2 threshold: post_2.png

With threshold set to 0.0f (unfortunately hard-coded right now), memory usage of the color texture in this example is reduced by ~33%. If set to 0.2f, memory usage is reduced by ~66%, with no significant visual loss. I have attached photos of the green smoke with no tiling, with 0 threshold, and with 0.2 threshold. You can also download the .blend file to try. If you notice the rendering speeds, the non-tiling one rendered much faster. This is most likely because the sparse grid is no longer treated as a [mesh volume ](https://developer.blender.org/D3038), and hopefully does not have anything to do with this task. I will see if it is possible to make these two functions compatible. [example.blend](https://archive.blender.org/developer/F3521730/example.blend) No tiling: ![post_none.png](https://archive.blender.org/developer/F3521733/post_none.png) 0.0 threshold: ![post_0.png](https://archive.blender.org/developer/F3521732/post_0.png) 0.2 threshold: ![post_2.png](https://archive.blender.org/developer/F3521731/post_2.png)

This issue was referenced by 6998ecec2a9ca5541eb93803f3233c5e9ab23eb5

This issue was referenced by 6998ecec2a9ca5541eb93803f3233c5e9ab23eb5

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'

Archiving old tasks.

Archiving old tasks.
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
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#55264
No description provided.