Wed, 11/13/2013 - 21:22
OCCT 6.7.0 introduces several major improvements of the visualization component. One of the most breaking changes in OCCT visualization concerns simplified implementation of ray tracing algorithm for regular OCCT visualization primitives. This algorithm is implemented using OpenCL. Being a part of TKOpenGl library, it is fully integrated with standard OCCT visualization logic. From now on, ray tracing can be used as alternative rendering method instead of OpenGL rasterization. Compared to third-party ray tracing libraries, the built-in implementation ensures real-time rendering performance, which is close to or even better than OpenGL rasterization performance on heavy models.
The simplified - but still powerful! - ray tracer implementation has the following features:
- High-quality shading by interpolating normal across the triangle pixels and using advanced illumination model (Phong shading)
- Depth-correct order-independent transparency for any number of overlapped objects
- Sharp shadows from isotropic point and directional lights without any approximation – greatly improve visual appearance
- Specular reflections and environment mapping – for high-quality rendering of metallic surfaces
- Low-cost adaptive anti-aliasing allows to improve image quality by removing jagged edges from the image
- Based on cross-platform OpenCL framework – runs on GPUs of major vendors (NVIDIA and AMD/ATI)
- Makes the most of the mid-/top-range GPUs but also runs successfully on low-end GPUs that support OpenCL
Once OCCT has been built with OpenCL support, using ray tracing is really simple: it is enough to call V3d_View::SetRaytracingMode() to switch the 3D view to ray tracing rendering. Refer to V3d_View class documentation and check vraytrace and vsetraytracemode DRAW Test Harness commands for details how to adjust ray tracing options. Probably, the easiest way to evaluate ray tracing output is to run the following command from the DRAW command prompt:
source samples/tcl/raytrace.tcl
Below some snapshots are included that give a basic idea how OCCT ray tracing improves quality of 3D scene rendering. The snapshots were created using CAD models from http://www.grabcad.com/.
The first version of ray tracing algorithm has the following limitations, some or all of them will be addressed in the future OCCT releases:
- Textures are not imported from OCCT visualization data (except for the environment texture which is taken into account)
- Ray tracing component currently supports only polygonal geometry
- Points, lines and text are not supported – as a consequence, wireframe presentation cannot be rendered using ray tracing
- Coincident triangles results in visual artifacts (same problem as in case of OpenGL usage)
- The workaround is to shift coincident geometries with respect to each other by a very small value
- Support of CPUs and Intel GPUs is not tested
- Operation under MacOS X is not tested. OCCT users are encouraged to provide their patches related to this platform.
- Source geometry for ray tracing is taken from CPU memory, existing VBO data is not reused by ray tracing
- To enable OpenGL rendering in parallel with ray tracer rendering, VBOs are created without releasing CPU memory occupied by geometrical data
- Non-optimal memory footprint:
- Combined rendering (OpenGL + ray-tracing): 3.3x memory amount used (2.3x on GPU)
- 2 GB GPU memory: up to 30M triangles in ray-tracing mode
Thu, 11/14/2013 - 20:28
Hi Sergey,
just for interest: has anyone tried to compile it with the NVIDIA SDK? Or is the AMD SDK required for building?
Greets,
Patrik
Thu, 11/14/2013 - 20:57
Hello Patrik,
As OCCT uses standard OpenCL interface, it should build well with either AMD or NVIDIA or any other OpenCL SDK compatible with the specification. We actually use OpenCL ICD Loader tool available from Khronos, see http://www.khronos.org/registry/cl/. You can download ready-to-use builds for Windows at http://www.opencascade.org/getocc/download/3rdparty/
Andrey
Fri, 11/15/2013 - 11:41
Cool,
thanks for the fast info. I'm very excited about the new visualization features ;-)
Patrik
Wed, 04/23/2014 - 16:50
Good news for those suffered recently from an extra OCCT dependency on OpenCL: the OCCT ray tracer is now written in GLSL.
A nice side-effect of this migration, switching between the OpenGL rasterizer and the ray tracing now takes almost zero time.
See issue 24739 - and don't forget to check out and try the code from the OCCT Git master!
Wed, 04/23/2014 - 16:47
One more new cool feature of the OCCT ray tracer that is worth having a look, bi-level BVH tree has been implemented that enables fast updates of the ray tracer acceleration structure and avoid heavy recalculations in the following cases:
Refer to Mantis issue 24520 and corresponding Git commit that is already available in OCCT Git master.
Tue, 05/20/2014 - 02:43
Please can you post some models and code for reproducing the same result of the samples that you have posted in this thread?
I have tried to enable raytracing, with shadows, reflection and antialiasing, but I haven't reached the same result as you have posted on the visualization project page
http://dev.opencascade.org/index.php?q=home/projects/visualization
Could you add the models and sample code for having this results?
Then I have tried to use it, but for me is far from being realtime, I have tested the master trunk snapshot 6.7.2, have you any further develope in progress to make this ray tracer really in real time?
Tue, 05/20/2014 - 08:36
Dear mach22,
the Ray-tracing core in OCCT is in functionality prototyping stage and is not designed for old GPU architectures - you need modern GPU (GCN+ from AMD or Kepler+ from NVIDIA) to achieve performance comparable to traditional rasterization pipeline.
Please see earlier discussion here:
http://dev.opencascade.org/index.php?q=node/954#comment-321
Could you please post you graphic card model name?
The optimization for obsolete GPUs is currently out of scope but might be considered if requested by customers.
Tue, 05/20/2014 - 23:17
I have tested it on Nvidia Geeforce 720M, as I need to make this working not only on the top graphic card, which ones do you certified as minimal requirement? better AMD or Nvidia, I have read that it seem that AMD has better support for OpenCL so it could be better, right?
An AMD R7 260x could be good for example? Or I need to have a GCN or Kepler?
I'm quite disappointed because I can't request a top graphic card to have this kind of rendering while other cad software can make this working with middle level GPU. I hope you'll improve it.
Wed, 05/21/2014 - 09:53
AMD R7 260x is based on GCN 1.1 architecture. It should be sufficient for testing this functionality, although we have not such card yet to perform own tests.
GeForce 720M is quite old low-end graphics based on Fermi kernel (released in 2010). As most low-end chips it has worst performance characteristics, and sufficient only for basic rendering.
Yes, GeForce drivers have problems with OpenCL. However Ray-tracing core in OCCT master branch is no more based on OpenCL - it uses GLSL (apart from releases 670 and 671 with OpenCL-based code).
There is no other CAD software which provides complete built-in real-time Ray-Tracing as far as I know - only limited features or spec-effects.
Thu, 05/22/2014 - 00:57
which card can you recommend to test this functionality?
An AMD R9 270x could be good? or it could have some problems and better going on a R9 280x? Or better an NVIDIA card?
On which card do you have tested it with good performances? can you post a list with the brand and model certified to works good with the rendering based on ray tracing?
I'd like to have some model and example with right materials and light to reproduce the models presented in the project of visualization
http://dev.opencascade.org/index.php?q=home/projects/visualization
like the Samovar sample or the 3 example of BRep model testing the
Ambient occlusion sample
Soft shadows sample
Rendering with light refraction support (simulating glass)
There will be any improvement in the next public release? 6.8.0 or 7.0.0?
Thanks
Thu, 05/22/2014 - 10:44
Dear mach22,
As a general remark related to graphic hardware compatibility check, we are thinking currently how to implement it, see this post for example. Obviously, we will not be able to test OCCT visualization component with all popular graphic cards on the market, so we are in favor of some automated procedure that can give the answer quickly for a particular hardware.
Just as an example of suitable hardware, we use AMD RADEON HD 7850 on one of our development stations, and ray tracing (after migration to GLSL) seems to show acceptable performance. Another example is NVIDIA GeForce GTX 770. Naturally, these are just samples, not the complete compatibility list.
We are working on this topic right now, hope to prepare an OCCT Git branch soon that will contain the mentioned Tcl samples and new BRep models.
However, please note that experiments with soft shadows are not yet completed and corresponding development results are not yet in OCCT Git.
We have plans to include some ray tracing improvements into OCCT 6.8.0 - like migration to GLSL, implementation of refractions and support of lines and text labels. Some of these features are already available as corresponding OCCT Git branches. Follow the visualization forum, we post information about new important improvements in real time as soon as development branch is ready for testing.
Thu, 05/22/2014 - 22:32
You could make an executable like glCapsViewer to check the performance of the graphic card in the local machine and make the result loaded to an online community database
http://delphigl.de/glcapsviewer/listreports.php
In this way you could list several cards making involved the community of OpenCascade developers and users, and so presenting the minimal requirement compared with many different graphic cards.
Fri, 05/23/2014 - 11:22
Hello mach22!
Your idea sounds good, and this is definitely one of the options we will consider.
Best regards,
Sergey
Fri, 05/23/2014 - 19:27
Hello mach22!
Before any more sophisticated tests are available, can you please try the following very simple one in DRAW command prompt:
and post here the results for the graphic cards you use?
And please state clearly which OCCT version you use - OCCT 6.7.1 or the current development snapshot from Git.
Best regards,
Sergey
UPDATED: Just for fun, we have tried this simple test with integrated Intel graphics (Intel Core i5-3450) and the current OCCT development snapshot (debug build!).
Here are the results:
Now you have some reference to compare your figures with.
Wed, 05/28/2014 - 01:31
with the integrated intel HD 4000
Draw[6]> vglinfo
OpenGL info:
GLvendor = 'Intel'
GLdevice = 'Intel(R) HD Graphics 4000'
GLversion = '4.0.0 - Build 10.18.10.3308'
GLSversion = '4.00 - Build 10.18.10.3308'
GLdebug = ON
Draw[7]> vfps
FPS: 25.355400361316079
CPU: 0.46875 msec
With the NVIDIA 720m
Draw[6]> vglinfo
OpenGL info:
GLvendor = 'NVIDIA Corporation'
GLdevice = 'GeForce GT 720M/PCIe/SSE2'
GLversion = '4.4.0'
GLSversion = '4.40 NVIDIA via CG compiler'
GLdebug = ON
Draw[7]> vfps
FPS: 9.3194306227965331
CPU: 83.28125 msec
It seem that the integrated intel HD 4000 is better than the NVIDIA 720m is it right?
Wed, 05/28/2014 - 14:03
Yes, low-end graphics from AMD (but not in their APUs) and NVIDIA has worst characteristics and does not inherit GPU architecture improvements of their bigger brothers for years (being renamed to new "family numbers" from really older chips each year).
Although this does not mean that Intel HD 4000 would lead in all use cases!
High CPU time on NVIDIA card also indicates that GLSL program is most likely not executed entirely on GPU due to driver bugs or hardware limitations (such limitation might be determined by close analysis, but it does not mean that code can be (easily) improved to workaround such limitations).
Wed, 05/28/2014 - 01:30
running the same sample with an intel HD 3000 I can't finish the raytracing test because of a crash of the Draw.exe
Do you have some other benchmark with some graphic card where the raytracing works well to understand which are the minimal requirements for AMD or NVIDIA cards?
Wed, 05/28/2014 - 13:51
Please make sure you have recent drivers - Intel drivers are known to be extremely buggy. Although new problems regularly occurs after upgrade...
Wed, 05/28/2014 - 22:27
I have installed the last driver for this processor.
Thu, 05/29/2014 - 04:27
If you've observed FPE exceptions in Draw - this is known issue (unfortunately appears often on Intel OpenGL drivers and software Mesa LLVM renderer with GLSL):
http://tracker.dev.opencascade.org/view.php?id=24589
Otherwise - could you please provide stack trace / error message?
Mon, 07/14/2014 - 14:46
I think that "source samples/tcl/bottle.tcl" should be changed with "source samples/tcl/raytrace.tcl" in the description of OCCT ray tracing above. The "bottle.tcl" seems to use simple shading.
Mon, 07/14/2014 - 14:50
Ok, done