1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0024130: Implementing ray tracing visualization core

The purpose of this functionality is to bring a basic ray-tracing solution to existing OCCT visualization toolkit (TKOpenGL).
Currently ray-tracing visualization core supports sharp shadows, specular reflections, transparency and adaptive anti-aliasing.
However, the basis for all ray-tracing algorithms is versatile, allowing you to add new ray-tracing features easily (such as ambient occlusion).
All ray-tracing computations are performed on the GPU using OpenCL framework, allowing real-time rendering performance.

It is important to note, that real-time ray-tracing is possible using high-performance GPUs with support of OpenCL 1.1 and higher (such as NVIDIA GeForce 660 or ATI/AMD Radeon 7850).
When using low-end GPUs (such as NVIDIA GeForce 640) the ray-tracing performance may slow down significantly.
Therefore, even with NVIDIA GeForce 640 you can render scenes with the millions of triangles. The support of OpenCL-enabled CPUs and integrated graphics cards is not guaranteed.
This commit is contained in:
dbp
2013-10-31 15:35:18 +04:00
committed by bugmaster
parent 008aef40eb
commit e276548b09
52 changed files with 6266 additions and 287 deletions

View File

@@ -24,9 +24,17 @@ MDIWindow::MDIWindow(View* aView,
myView = aView;
myDocument = aDocument;
#ifdef HAVE_OPENCL
myShadowsEnabled = true;
myReflectionsEnabled = true;
myAntialiasingEnabled = false;
#endif
}
MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags )
MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags, bool theRT )
: QMainWindow( parent, wflags )
{
QFrame *vb = new QFrame( this );
@@ -39,7 +47,7 @@ MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlag
setCentralWidget( vb );
myDocument = aDocument;
myView = new View( myDocument->getContext(), vb );
myView = new View( myDocument->getContext(), vb, theRT );
layout->addWidget( myView );
connect( myView, SIGNAL( selectionChanged() ),
@@ -49,6 +57,14 @@ MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlag
resize( sizeHint() );
setFocusPolicy( Qt::StrongFocus );
#ifdef HAVE_OPENCL
myShadowsEnabled = true;
myReflectionsEnabled = true;
myAntialiasingEnabled = false;
#endif
}
MDIWindow::~MDIWindow()
@@ -137,4 +153,26 @@ QSize MDIWindow::sizeHint() const
return QSize( 450, 300 );
}
#ifdef HAVE_OPENCL
void MDIWindow::setRaytracedShadows( int state )
{
myView->setRaytracedShadows( state );
myShadowsEnabled = state;
}
void MDIWindow::setRaytracedReflections( int state )
{
myView->setRaytracedReflections( state );
myReflectionsEnabled = state;
}
void MDIWindow::setRaytracedAntialiasing( int state )
{
myView->setRaytracedAntialiasing( state );
myAntialiasingEnabled = state;
}
#endif