Multi-Resolution Rendering with Overlapping AMR: Difference between revisions

From ParaQ Wiki
Jump to navigationJump to search
No edit summary
Line 2: Line 2:


With dataset sizes growing increasingly large, exploratory interactive visualization keeps on getting harder and harder. Multi-resoltuion visualization makes it possible to deal with large datasets while keeping the system requirements and response times low.
With dataset sizes growing increasingly large, exploratory interactive visualization keeps on getting harder and harder. Multi-resoltuion visualization makes it possible to deal with large datasets while keeping the system requirements and response times low.
This document is for advanced developers and assumes familiarity with VTK data and execution model and ParaView architecture.


=Design Overview=
=Design Overview=
Line 11: Line 13:


This general streaming principal can be extended to views and representations too, for rendering. The representations, in this case, act as the sinks that process meta-data and request blocks from the sources. The render view in ParaView (vtkPVRenderView), provides mechanisms for representations to leverage to render the dataset in a streaming fashion.
This general streaming principal can be extended to views and representations too, for rendering. The representations, in this case, act as the sinks that process meta-data and request blocks from the sources. The render view in ParaView (vtkPVRenderView), provides mechanisms for representations to leverage to render the dataset in a streaming fashion.
=Implementation=
While the framework is flexible enough to support any composite dataset, our current implementation only supports AMR datasets (vtkOverlappingAMR). This section provides an overview of the various components involved in multi-resolution rendering of AMR datasets.
==Source==
The starting point is the data source. The source needs to provide meta-data about the data in RequestInformation() pass and then read blocks of data as requested in the RequestData() pass. Examples are vtkUniformGridAMRReader, and vtkAMRFlashReader. These readers read the "meta-data" in the files (without reading the heavy data) and produce an empty vtkOverlappingAMR in their RequestInformation pass with structure matching the expected blocks in the output.
<source lang="cpp">
//----------------------------------------------------------------------------
int vtkXMLUniformGridAMRReader::RequestInformation(vtkInformation *request,
  vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
  if (!this->Superclass::RequestInformation(request, inputVector, outputVector))
    {
    return 0;
    }
  // this->Metadata is of type vtkOverlappingAMR and is filled up before the control reaches
  // this point.
  if (this->Metadata)
    {
    // Pass the meta-data down the pipeline.
    outputVector->GetInformationObject(0)->Set(
      vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA(),
      this->Metadata);
    }
  else
    {
    outputVector->GetInformationObject(0)->Remove(
      vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA());
    }
  return 1;
}
</source>

Revision as of 10:46, 10 October 2012

Motivation

With dataset sizes growing increasingly large, exploratory interactive visualization keeps on getting harder and harder. Multi-resoltuion visualization makes it possible to deal with large datasets while keeping the system requirements and response times low.

This document is for advanced developers and assumes familiarity with VTK data and execution model and ParaView architecture.

Design Overview

ParaView/VTK provides an infrastructure for multi-resolution analysis based on composite datasets (multiblock datasets or overlapping AMR datasets). The principle is as follows:

  1. Sources/Filters produce meta-data in their RequestInformation() pass. This meta-data can be used by any sink to decide what are the blocks in the dataset, how are they positioned, what is the cost for processing that block of dataset. For AMR datasets, this meta-data is properly defined by vtkAMRInformation. For other composite datasets, users are free to come up with their own convention. So long as the sink and source are aware of the convention, we are good.
  2. A Sink can request a particular block (or blocks) from the source by providing appropriate keys in the RequestUpdateExtent() pass. The source then delivers those blocks.

This general streaming principal can be extended to views and representations too, for rendering. The representations, in this case, act as the sinks that process meta-data and request blocks from the sources. The render view in ParaView (vtkPVRenderView), provides mechanisms for representations to leverage to render the dataset in a streaming fashion.

Implementation

While the framework is flexible enough to support any composite dataset, our current implementation only supports AMR datasets (vtkOverlappingAMR). This section provides an overview of the various components involved in multi-resolution rendering of AMR datasets.

Source

The starting point is the data source. The source needs to provide meta-data about the data in RequestInformation() pass and then read blocks of data as requested in the RequestData() pass. Examples are vtkUniformGridAMRReader, and vtkAMRFlashReader. These readers read the "meta-data" in the files (without reading the heavy data) and produce an empty vtkOverlappingAMR in their RequestInformation pass with structure matching the expected blocks in the output.

//----------------------------------------------------------------------------
int vtkXMLUniformGridAMRReader::RequestInformation(vtkInformation *request,
  vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
  if (!this->Superclass::RequestInformation(request, inputVector, outputVector))
    {
    return 0;
    }

  // this->Metadata is of type vtkOverlappingAMR and is filled up before the control reaches
  // this point.
  if (this->Metadata)
    {
    // Pass the meta-data down the pipeline.
    outputVector->GetInformationObject(0)->Set(
      vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA(),
      this->Metadata);
    }
  else
    {
    outputVector->GetInformationObject(0)->Remove(
      vtkCompositeDataPipeline::COMPOSITE_DATA_META_DATA());
    }
  return 1;
}