mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add comment to describe usage of the weighted blended transparency system
This commit is contained in:
parent
bf0b4f68e1
commit
0db32df1c4
@ -51,6 +51,73 @@ using namespace cvf;
|
||||
|
||||
P4 Combination pass
|
||||
|
||||
====================================
|
||||
Usage
|
||||
====================================
|
||||
class MyViewer : public caf::Viewer
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
MyViewer(const QGLFormat& format, QWidget* parent)
|
||||
: caf::Viewer(format, parent)
|
||||
{
|
||||
m_renderConf = new caf::TransparentWBRenderConfiguration;
|
||||
m_renderConf->setUpRenderSequence(m_renderingSequence.p());
|
||||
|
||||
// Cerate overly item if needed
|
||||
cvf::OverlyItem* overlayItem; // = new someTtem
|
||||
m_renderConf->overlayRendering()->addOverlayItem(overlayItem);
|
||||
}
|
||||
|
||||
~MyViewer();
|
||||
|
||||
virtual void optimizeClippingPlanes()
|
||||
{
|
||||
// ... Do ordinary clipplane adjustments
|
||||
|
||||
m_renderConf->prepareForRendering();
|
||||
}
|
||||
virtual void resizeGL(int width, int height)
|
||||
{
|
||||
m_renderConf->resize(width, height);
|
||||
caf::Viewer::resizeGL(width, height);
|
||||
}
|
||||
|
||||
private:
|
||||
cvf::ref<caf::TransparentWBRenderConfiguration> m_renderConf;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
ref<Part> createFacePartFromDrawableGeo(cvf::DrawableGeo* geo,
|
||||
const Color3f& color,
|
||||
float opacity,
|
||||
bool useSpecularReflection)
|
||||
{
|
||||
ref<Part> part = new Part;
|
||||
part->setDrawable(geo);
|
||||
|
||||
cvf::Color4f colorWithAlpha(color);
|
||||
colorWithAlpha.a() = opacity;
|
||||
|
||||
caf::WBTransparencySurfaceEffectGenerator effGen(colorWithAlpha, caf::PO_NONE, useSpecularReflection);
|
||||
ref<Effect> eff = effGen.generateEffectFromCache();
|
||||
|
||||
if (opacity < 1.0)
|
||||
{
|
||||
part->setPriority(100);
|
||||
}
|
||||
|
||||
part->setEffect(eff.p());
|
||||
|
||||
return part;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class RenderPassPreparator : public cvf::DynamicUniformSet
|
||||
|
Loading…
Reference in New Issue
Block a user