Visualization suggestions

devdscm

CAD practitioner
Hello,
any suggestions to get similar visualization of 3d shapes like "CAD ASSISTANT" does?
(see attached example). I suppose a shader should be used.
thanks in advance
 

Attachments

  • cad_assistant.png
    cad_assistant.png
    294.1 KB · Views: 5

JSlyadne

Administrator
Staff member
Hello,
any suggestions to get similar visualization of 3d shapes like "CAD ASSISTANT" does?
(see attached example). I suppose a shader should be used.
thanks in advance
Hello,

Could please bring more light to what you mean saying "similar visualization"? What exactly effects you would like to mimic?
 

devdscm

CAD practitioner
I don't know how to explain.
I'm referring to the quality of the images
It looks like the visualization of the 3d shape is non-photorealistic (ok) , but it seems rather a toon-like visualization ( maybe I am wrong , a sort of a 3d toon-shader) . I would like reach a similar result in my application
 

devdscm

CAD practitioner
Hello , hoping the attached image clarify better my requirments.
Image 1 is phong-based (Not interested in)
Image 2 is a shading with highlights without edge lines (Not interested in)
Image 3 or 4(better) is what I would like reach about
 

Attachments

  • imagine__.png
    imagine__.png
    518.4 KB · Views: 14

natalia

Moderator
Staff member
Hello @devdscm

You may play around materials on your shape. The best sample, for sure, is AIS package. But, some additional materials:
  • to avoid phong-based lightning on your shape(it will switch it OFF), just prepare material with the code similar to:
C++:
Graphic3d_MaterialAspect material(name);
material.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
material.SetSpecularColor(Quantity_NOC_BLACK);
material.SetAmbientColor(Quantity_NOC_BLACK);
material.SetDiffuseColor(Quantity_NOC_BLACK);
material.SetEmissiveColor(Quantity_NOC_BLACK);
material.SetShininess(0);
  • for some style on our project(with phong-based lightning ON), we worked around specular part of material color like the next. Here we corrected material to smoth lightning on the model.
C++:
Graphic3d_MaterialAspect material(Graphic3d_NameOfMaterial_Aluminum);

material.SetAmbientColor(Quantity_Color(200. / 255., 200. / 255., 200. /255., Quantity_TOC_sRGB));
material.SetSpecularColor(Quantity_NOC_GRAY50);

drawer->ShadingAspect()->SetMaterial(material);

Some theory: OpenCASCADE visualization is based on using OpenGl shaders. Lightning, materals, shading and others use GLSL shaders. At the same time you’re welcome to implement your own shader and add it for execution to OpenCASCADE visualization. How doing this, start investigating from ‘SetShaderProgram’ of Prs3d_Drawer. Here, OpenCASCADE provides us with a DRAW command and some tests how to try this. The command name is ‘vshader’.

Also, pay attention, that PBR Metallic-Roughness shading model is implemented in OpenCASCADE and described in issue https://tracker.dev.opencascade.org/view.php?id=30700.

The result from the issue is the next:

pbr_spheres2.png

It is interesting to know which way you’ll chose and what results you achieve, please be-on-the-line)
 
Top