1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00
occt/tests/v3d/glsl/outline2
asl 6ef0d6f156 0024437: Visualization - silhouette edges based on OpenGL
Added new flag Graphic3d_AspectFillArea3d::ToDrawSilhouette() activating silhouette (outline) rendering.

The new feature can simulate fake HLR look-n-feel,
when combined with Aspect_IS_HIDDENLINE interior style (filling object with background color),
face boundary edges (with most continuity flag set to c2 or lower).

Silhouette GLSL program is very simple - it displaces model alongside vertex normal,
so that it is applicable only to smooth surfaces and closed volumes,
and produces visual artifacts at sharp corners, especially when face boundary is disabled.

OpenGl_SetOfShaderPrograms has been modified so that to reduce
dimensions of the grid of static size based on amount of program combinations.

OpenGl_PrimitiveArray no more allocates VBO resources if primitive array
is marked to be not drawn via interior style / line type / marker type.
2019-02-28 20:25:51 +03:00

32 lines
905 B
Plaintext

puts "========"
puts "0024437: Visualization - silhouette edges based on OpenGL"
puts "Draw bottle sample"
puts "========"
puts ""
pload MODELING VISUALIZATION
# test for creation of bottle as in tutorial (script is in samples)
source $env(CSF_OCCTSamplesPath)/tcl/bottle.tcl
vsetcolorbg 255 255 255
vzbufftrihedron -type wireframe -colorLabels BLACK
vaspects bottle -setDrawSilhouette 1 -setEdgeColor BLACK -setFaceBoundaryDraw 1 -setMostContinuity c0 -setFaceBoundaryColor BLACK -setInteriorStyle HIDDENLINE
vrenderparams -rendScale 2
vcamera -ortho
vfit
vaspects bottle -setDrawSilhouette 0
vdump $::imagedir/${::casename}_ortho0.png
vaspects bottle -setDrawSilhouette 1
vdump $::imagedir/${::casename}_ortho1.png
vcamera -persp
vfit
vaspects bottle -setDrawSilhouette 0
vdump $::imagedir/${::casename}_persp0.png
vaspects bottle -setDrawSilhouette 1
vdump $::imagedir/${::casename}_persp1.png